summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2013-06-18 23:34:59 +0200
committerMichael Stahl <mstahl@redhat.com>2013-09-09 22:09:15 +0200
commit64405aa69f3c4e305f11f2d3ddbddd2bbedbb264 (patch)
treef33b5146aa933e8f4f9de3befede54d65c21fd6d
parentd33b6ccda7e52e7111c0299db9a6e60400abb13b (diff)
gbuild: avoid packages when copying files into instdir
There should be only two ways how to add file into instdir: - gb_Helper_install used in gbuild - gb_Package_set_outdir used also elsewhere, preferably with scp2 containing its .filelist. Change-Id: I75ec0ba63f32acf4b56b17dc972f4488edf6a777
-rw-r--r--desktop/Module_desktop.mk1
-rw-r--r--desktop/Package_pagein_install.mk22
-rw-r--r--solenv/gbuild/AllLangResTarget.mk16
-rw-r--r--solenv/gbuild/Executable.mk15
-rw-r--r--solenv/gbuild/Helper.mk12
-rw-r--r--solenv/gbuild/Jar.mk24
-rw-r--r--solenv/gbuild/Library.mk35
-rw-r--r--solenv/gbuild/LinkTarget.mk1
-rw-r--r--solenv/gbuild/Pagein.mk8
9 files changed, 47 insertions, 87 deletions
diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk
index 05ff062c7c56..1deb99af307b 100644
--- a/desktop/Module_desktop.mk
+++ b/desktop/Module_desktop.mk
@@ -37,7 +37,6 @@ $(eval $(call gb_Module_add_targets,desktop,\
Library_migrationoo3 \
Library_unopkgapp \
$(if $(gb_RUNNABLE_INSTDIR),\
- Package_pagein_install \
Package_scripts_install \
) \
Package_scripts \
diff --git a/desktop/Package_pagein_install.mk b/desktop/Package_pagein_install.mk
deleted file mode 100644
index 8a494274fb44..000000000000
--- a/desktop/Package_pagein_install.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_Package_Package,desktop_pagein_install,$(OUTDIR)/bin))
-
-$(eval $(call gb_Package_set_outdir,desktop_pagein_install,$(INSTDIR)))
-
-$(eval $(call gb_Package_add_files,desktop_pagein_install,$(gb_PROGRAMDIRNAME),\
- pagein-calc \
- pagein-common \
- pagein-draw \
- pagein-impress \
- pagein-writer \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk
index c127dfbf7550..a63ce428ce99 100644
--- a/solenv/gbuild/AllLangResTarget.mk
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -459,8 +459,6 @@ define gb_AllLangResTarget_set_langs
gb_AllLangResTarget_LANGS := $(1)
endef
-gb_AllLangResTarget_get_packagename = AllLangResTarget/$(1)
-
$(call gb_AllLangResTarget_get_clean_target,%) :
$(call gb_Helper_abbreviate_dirs,\
rm -f $(call gb_AllLangResTarget_get_target,$*))
@@ -469,19 +467,17 @@ $(call gb_AllLangResTarget_get_target,%) :
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $@) && touch $@)
+gb_ResTarget_get_install_target = $(INSTDIR)/$(gb_PROGRAMDIRNAME)/resource/$(1).res
+
define gb_AllLangResTarget_AllLangResTarget
$(foreach lang,$(gb_AllLangResTarget_LANGS),\
$(call gb_ResTarget_ResTarget,$(1)$(lang),$(1),$(lang)))
ifneq ($(gb_RUNNABLE_INSTDIR),)
-$(call gb_Package_Package_internal,$(call gb_AllLangResTarget_get_packagename,$(1)),$(WORKDIR))
-$(call gb_Package_set_outdir,$(call gb_AllLangResTarget_get_packagename,$(1)),$(INSTDIR))
-$(call gb_AllLangResTarget_get_target,$(1)) : $(call gb_Package_get_target,$(call gb_AllLangResTarget_get_packagename,$(1)))
-$(call gb_AllLangResTarget_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(call gb_AllLangResTarget_get_packagename,$(1)))
-$(call gb_Package_add_files,$(call gb_AllLangResTarget_get_packagename,$(1)),program/resource,\
- $(foreach lang,$(gb_AllLangResTarget_LANGS),\
- $(subst $(WORKDIR)/,,$(call gb_ResTarget_get_target,$(1)$(lang)))) \
-)
+$(foreach lang,$(gb_AllLangResTarget_LANGS),\
+$(call gb_Helper_install,$(call gb_AllLangResTarget_get_target,$(1)), \
+ $(call gb_ResTarget_get_install_target,$(1)$(lang)), \
+ $(call gb_ResTarget_get_target,$(1)$(lang))))
endif
$$(eval $$(call gb_Module_register_target,$(call gb_AllLangResTarget_get_target,$(1)),$(call gb_AllLangResTarget_get_clean_target,$(1))))
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index e083c0dccbc9..0450c6f89c63 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -23,8 +23,8 @@
# gb_Executable_Executable_platform
# NOTE: SDKBIN executables are already packaged in module odk
-gb_Executable_LAYER_DIRS = \
- OOO:$(gb_Package_PROGRAMDIRNAME) \
+gb_Executable_LAYER_DIRS := \
+ OOO:$(gb_PROGRAMDIRNAME) \
UREBIN:ure/bin
$(dir $(call gb_Executable_get_runtime_target,%)).dir :
@@ -45,8 +45,7 @@ $(call gb_Executable_get_clean_target,%) :
gb_Executable__get_dir_for_layer = $(patsubst $(1):%,$(INSTDIR)/%,$(filter $(1):%,$(call gb_Executable_LAYER_DIRS)))
gb_Executable__get_dir_for_exe = $(call gb_Executable__get_dir_for_layer,$(call gb_Executable_get_layer,$(1)))
-gb_Executable__get_instdir = $(call gb_Executable__get_dir_for_exe,$(1))/$(call gb_Executable_get_filename,$(1))
-gb_Executable_get_install_target = $(if $(call gb_Executable__get_dir_for_exe,$(1)),$(call gb_Executable__get_instdir,$(1)))
+gb_Executable_get_install_target = $(call gb_Executable__get_dir_for_exe,$(1))/$(call gb_Executable_get_filename,$(1))
define gb_Executable_Executable
$(call gb_Postprocess_register_target,AllExecutables,Executable,$(1))
@@ -67,11 +66,15 @@ $(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \
$(call gb_Executable_get_runtime_target,$(1)) :| $(dir $(call gb_Executable_get_runtime_target,$(1))).dir
$(call gb_Executable_get_runtime_target,$(1)) : $(call gb_Executable_get_target_for_build,$(1))
$(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
-$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_install_target,$(1))
+$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS :=
$(call gb_Executable_Executable_platform,$(1),$(2))
ifneq ($(gb_RUNNABLE_INSTDIR),)
-$(call gb_Helper_install,Executable,$(1),$(call gb_LinkTarget_get_target,$(2)))
+$(if $(call gb_Executable__get_dir_for_exe,$(1)), \
+$(call gb_Helper_install,$(call gb_Executable_get_target,$(1)), \
+ $(call gb_Executable_get_install_target,$(1)), \
+ $(call gb_LinkTarget_get_target,$(2))) \
+)
endif
$$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1))))
$(call gb_Helper_make_userfriendly_targets,$(1),Executable)
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index 8505d760d181..e025cb5a9c78 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -201,15 +201,11 @@ define gb_Helper_execute
$(call gb_Executable_get_command,$(firstword $(1))) $(wordlist 2,$(words $(1)),$(1))
endef
-# define gb_Helper_install class instance-name target-to-install
+# define gb_Helper_install registered-target target-to-install target-from-workdir
define gb_Helper_install
-ifneq (,$(call gb_$(1)_get_install_target,$(2)))
-$(call gb_$(1)_get_target,$(2)) :| $(call gb_$(1)_get_install_target,$(2))
-$(call gb_$(1)_get_install_target,$(2)) : $(3) \
- | $(dir $(call gb_$(1)_get_install_target,$(2))).dir
-$(call gb_Deliver_add_deliverable,$(call gb_$(1)_get_install_target,$(2)),$(3),$(2))
-endif
-
+$(1) :| $(2)
+$(2) : $(3) | $(dir $(2)).dir
+$(call gb_Deliver_add_deliverable,$(2),$(3),$(2))
endef
# gb_Helper_OUTDIRLIBDIR is set by the platform to the path the dynamic linker need to use
diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk
index 99f02d9548fe..7ef7212e4a6c 100644
--- a/solenv/gbuild/Jar.mk
+++ b/solenv/gbuild/Jar.mk
@@ -23,7 +23,7 @@ gb_Jar_JAVACOMMAND := $(JAVAINTERPRETER)
gb_Jar_JARCOMMAND := jar
gb_Jar_LAYER_DIRS := \
- OOO:program/classes \
+ OOO:$(gb_PROGRAMDIRNAME)/classes \
URE:ure/share/java
# location of files going to be packed into .jar file
@@ -36,11 +36,9 @@ define gb_Jar_get_manifest_target
$(call gb_Jar_get_workdir,$(1))/META-INF/MANIFEST.MF
endef
-gb_Jar_get_packagename = Jar/$(1)
-
gb_Jar__get_layer = $(strip $(foreach group,$(gb_Jar_VALIDGROUPS),$(if $(filter $(1),$(gb_Jar_$(group))),$(group))))
-gb_Jar__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Jar_LAYER_DIRS)))
-gb_Jar__get_instdir = $(call gb_Jar__get_dir_for_layer,$(call gb_Jar__get_layer,$(1)))
+gb_Jar__get_dir_for_layer = $(patsubst $(1):%,$(INSTDIR)/%,$(filter $(1):%,$(gb_Jar_LAYER_DIRS)))
+gb_Jar_get_install_target = $(call gb_Jar__get_dir_for_layer,$(call gb_Jar__get_layer,$(1)))/$(1).jar
# creates classset and META-INF folders if they don't exist
# adds manifest version, class path, solarversion and content from sources to manifest file
@@ -105,24 +103,14 @@ $(call gb_Jar_get_outdir_target,$(1)) :| $(dir $(call gb_Jar_get_outdir_target,$
ifneq ($(gb_RUNNABLE_INSTDIR),)
$(if $(filter OOO URE,$(call gb_Jar__get_layer,$(1))),\
- $(call gb_Jar__Jar_package,$(1),$(call gb_Jar_get_packagename,$(1)),$(notdir $(call gb_Jar_get_target,$(1)))) \
+$(call gb_Helper_install,$(call gb_Jar_get_outdir_target,$(1)), \
+ $(call gb_Jar_get_install_target,$(1)), \
+ $(call gb_Jar_get_target,$(1))) \
)
endif
endef
-# gb_Jar__Jar_package jar package filename
-define gb_Jar__Jar_package
-$(call gb_Package_Package_internal,$(2),$(WORKDIR)/Jar)
-$(call gb_Package_set_outdir,$(2),$(INSTDIR))
-$(call gb_Package_add_file,$(2),$(call gb_Jar__get_instdir,$(1))/$(3),$(3))
-
-$(call gb_Package_get_target,$(2)) : $(call gb_Jar_get_target,$(1))
-$(call gb_Jar_get_outdir_target,$(1)) : $(call gb_Package_get_target,$(2))
-$(call gb_Jar_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(2))
-
-endef
-
# source files are forwarded to the ClassSet
define gb_Jar_add_sourcefile
$(call gb_JavaClassSet_add_sourcefile,$(call gb_Jar_get_classsetname,$(1)),$(2))
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 95d9d2eb0675..fb0ff64296b9 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -30,7 +30,7 @@
# gb_Library_Library_platform
gb_Library_LAYER_DIRS := \
- OOO:program \
+ OOO:$(gb_PROGRAMDIRNAME) \
URELIB:ure/$(notdir $(gb_Helper_OUTDIRLIBDIR))
# doesn't do anything, just used for hooking up component target
@@ -43,10 +43,9 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) :
rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \
$(AUXTARGETS))
-gb_Library_get_packagename = Library/$(1)
-
gb_Library__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_LAYER_DIRS)))
gb_Library_get_instdir = $(call gb_Library__get_dir_for_layer,$(call gb_Library_get_layer,$(1)))
+gb_Library_get_install_target = $(INSTDIR)/$(call gb_Library_get_instdir,$(1))/$(call gb_Library_get_runtime_filename,$(1))
define gb_Library_Library
$(call gb_Postprocess_register_target,AllLibraries,Library,$(1))
@@ -88,8 +87,10 @@ $(call gb_Library_get_clean_target,$(1)) : AUXTARGETS :=
$(call gb_Library_Library_platform,$(1),$(2),$(gb_Library_DLLDIR)/$(call gb_Library_get_dllname,$(1)))
ifneq ($(gb_RUNNABLE_INSTDIR),)
-$(if $(filter $(call gb_Library_get_layer,$(1)):%,$(gb_Library_LAYER_DIRS)),\
- $(call gb_Library__Library_package,$(1),$(call gb_Library_get_packagename,$(1)),$(call gb_Library_get_runtime_filename,$(1))) \
+$(if $(call gb_Library_get_instdir,$(1)),\
+$(call gb_Helper_install,$(call gb_Library__get_final_target,$(1)), \
+ $(call gb_Library_get_install_target,$(1)), \
+ $(call gb_LinkTarget_get_target,$(2))) \
)
endif
@@ -100,18 +101,6 @@ $(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_L
endef
-# gb_Library__Library_package library package filename
-define gb_Library__Library_package
-$(call gb_Package_Package_internal,$(2),$(gb_Helper_OUTDIRLIBDIR))
-$(call gb_Package_set_outdir,$(2),$(INSTDIR))
-$(call gb_Package_add_file,$(2),$(call gb_Library_get_instdir,$(1))/$(3),$(3))
-
-$(call gb_Library__get_final_target,$(1)) : $(call gb_Package_get_target,$(2))
-$(call gb_Package_get_target,$(2)) : $(call gb_Library_get_target,$(1))
-$(call gb_Library_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(2))
-
-endef
-
# Custom definition that does not simply forward to LinkTarget,
# because there are cases where the auxtargets are not delivered to solver...
# The auxtarget is delivered via the rule in Package.mk.
@@ -132,17 +121,19 @@ endef
# gb_Library__add_soversion_link library package linkname
define gb_Library__add_soversion_link
-$(call gb_Library_add_auxtarget,$(1),$(3))
-ifneq ($(gb_RUNNABLE_INSTDIR),)
-$(call gb_Package_add_file,$(2),$(call gb_Library_get_instdir,$(1))/$(notdir $(3)),$(notdir $(3)))
-endif
+$(call gb_Library_add_auxtarget,$(1),$(2))
endef
define gb_Library__set_soversion_script
$(call gb_LinkTarget_set_soversion_script,$(call gb_Library_get_linktargetname,$(1)),$(2),$(3))
$(call gb_Library_get_target,$(1)) : SOVERSION := $(2)
-$(call gb_Library__add_soversion_link,$(1),$(call gb_Library_get_packagename,$(1)),$(call gb_Library_get_target,$(1)).$(2))
+$(call gb_Library__add_soversion_link,$(1),$(call gb_Library_get_target,$(1)).$(2))
+ifneq ($(gb_RUNNABLE_INSTDIR),)
+$(call gb_Helper_install,$(call gb_Library__get_final_target,$(1)), \
+ $(call gb_Library_get_install_target,$(1)).$(2), \
+ $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))).$(2))
+endif
endef
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index e1854fb50bac..bb1569afd445 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -606,6 +606,7 @@ define gb_LinkTarget_set_soversion_script
$(call gb_LinkTarget_get_target,$(1)) : $(3)
$(call gb_LinkTarget_get_target,$(1)) : SOVERSION := $(2)
$(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT := $(3)
+$(call gb_LinkTarget_get_target,$(1)).$(2) : $(call gb_LinkTarget_get_target,$(1))
endef
diff --git a/solenv/gbuild/Pagein.mk b/solenv/gbuild/Pagein.mk
index c5200b002264..aa6a98a82b24 100644
--- a/solenv/gbuild/Pagein.mk
+++ b/solenv/gbuild/Pagein.mk
@@ -36,6 +36,8 @@ $(call gb_Pagein_get_clean_target,%) :
$(call gb_Pagein_get_target,%) :
$(call gb_Pagein__command,$@,$*,$^)
+gb_Pagein_get_install_target = $(INSTDIR)/$(gb_PROGRAMDIRNAME)/pagein-$(1)
+
define gb_Pagein_Pagein
$(call gb_Pagein_get_target,$(1)) : OBJECTS :=
$(call gb_Pagein_get_target,$(1)) : $(gb_Module_CURRENTMAKEFILE)
@@ -45,6 +47,12 @@ $(call gb_Deliver_add_deliverable,$(call gb_Pagein_get_outdir_target,$(1)),$(cal
$(call gb_Pagein_get_outdir_target,$(1)) : $(call gb_Pagein_get_target,$(1))
$(call gb_Pagein_get_outdir_target,$(1)) :| $(dir $(call gb_Pagein_get_outdir_target,$(1))).dir
+ifneq ($(gb_RUNNABLE_INSTDIR),)
+$(call gb_Helper_install,$(call gb_Pagein_get_outdir_target,$(1)), \
+ $(call gb_Pagein_get_install_target,$(1)), \
+ $(call gb_Pagein_get_target,$(1)))
+endif
+
endef
define gb_Pagein_add_object