gbuild: remove executables from OUTDIR and WORKDIR
Call and link executables directly in INSTDIR.
- gb_Library_get_target is now same as the gb_LinkTarget_get_target
- disable gb_Library_add_auxtarget, no auxtargets need to be copied
- adjust paths of all external executables to OUTDIR_FOR_BUILD for now
- use lazy assignment instead of := in AllLangResTarget because it's
read before Executable
- link.exe generates an import library for lots of executables
because they export symbols, especially since commit
0ffab9363d
"force 'main' to always be DLLPUBLIC."
Change-Id: I3e1ee7425dd430bb83c7cd59e265869a0541b38d
This commit is contained in:
@@ -2995,7 +2995,7 @@ gb_ExternalExecutable__register_xmllint :=
|
||||
else # ! SYSTEM_LIBXML_FOR_BUILD
|
||||
|
||||
define gb_ExternalExecutable__register_xmllint
|
||||
$(call gb_ExternalExecutable_set_internal,xmllint)
|
||||
$(call gb_ExternalExecutable_set_internal,xmllint,$(OUTDIR_FOR_BUILD)/bin/xmllint$(gb_Executable_EXT_for_build))
|
||||
|
||||
endef
|
||||
|
||||
@@ -3008,7 +3008,7 @@ gb_ExternalExecutable__register_xsltproc :=
|
||||
else # ! SYSTEM_LIBXSLT_FOR_BUILD
|
||||
|
||||
define gb_ExternalExecutable__register_xsltproc
|
||||
$(call gb_ExternalExecutable_set_internal,xsltproc)
|
||||
$(call gb_ExternalExecutable_set_internal,xsltproc,$(OUTDIR_FOR_BUILD)/bin/xsltproc$(gb_Executable_EXT_for_build))
|
||||
$(call gb_ExternalExecutable_add_dependencies,xsltproc,$(call gb_Package_get_target,xslt))
|
||||
|
||||
endef
|
||||
@@ -3057,7 +3057,7 @@ endef
|
||||
else # ! SYSTEM_GENBRK
|
||||
|
||||
define gb_ExternalExecutable__register_genbrk
|
||||
$(call gb_ExternalExecutable_set_internal,genbrk)
|
||||
$(call gb_ExternalExecutable_set_internal,genbrk,$(OUTDIR_FOR_BUILD)/bin/genbrk$(gb_Executable_EXT_for_build))
|
||||
$(call gb_ExternalExecutable_add_dependencies,genbrk,\
|
||||
$(call gb_Package_get_target_for_build,icu) \
|
||||
)
|
||||
@@ -3076,7 +3076,7 @@ endef
|
||||
else # ! SYSTEM_GENCCODE
|
||||
|
||||
define gb_ExternalExecutable__register_genccode
|
||||
$(call gb_ExternalExecutable_set_internal,genccode)
|
||||
$(call gb_ExternalExecutable_set_internal,genccode,$(OUTDIR_FOR_BUILD)/bin/genccode$(gb_Executable_EXT_for_build))
|
||||
$(call gb_ExternalExecutable_add_dependencies,genccode,\
|
||||
$(call gb_Package_get_target_for_build,icu) \
|
||||
)
|
||||
@@ -3095,7 +3095,7 @@ endef
|
||||
else # ! SYSTEM_GENCMN
|
||||
|
||||
define gb_ExternalExecutable__register_gencmn
|
||||
$(call gb_ExternalExecutable_set_internal,gencmn)
|
||||
$(call gb_ExternalExecutable_set_internal,gencmn,$(OUTDIR_FOR_BUILD)/bin/gencmn$(gb_Executable_EXT_for_build))
|
||||
$(call gb_ExternalExecutable_add_dependencies,gencmn,\
|
||||
$(call gb_Package_get_target_for_build,icu) \
|
||||
)
|
||||
|
@@ -38,8 +38,8 @@ $(call android_get_po,$(1)):
|
||||
mkdir -p res/values-$(1)
|
||||
$(if $(filter-out qtz,$(1)), \
|
||||
echo $(SRCDIR)/translations/source/$(1)/android/sdremote/res/values.po > translations-$(1).db &&\
|
||||
$(OUTDIR_FOR_BUILD)/bin/stringex -i res/values/strings.xml -o res/values-$(1)/strings.xml -m translations-$(1).db -l $(1), \
|
||||
$(OUTDIR_FOR_BUILD)/bin/stringex -i res/values/strings.xml -o res/values-$(1)/strings.xml -m -l $(1))
|
||||
$(gb_Executable_BINDIR_FOR_BUILD)/stringex -i res/values/strings.xml -o res/values-$(1)/strings.xml -m translations-$(1).db -l $(1), \
|
||||
$(gb_Executable_BINDIR_FOR_BUILD)/stringex -i res/values/strings.xml -o res/values-$(1)/strings.xml -m -l $(1))
|
||||
|
||||
endef
|
||||
|
||||
|
@@ -39,7 +39,7 @@
|
||||
# SrsPartMergeTarget class
|
||||
|
||||
gb_SrsPartMergeTarget_TRANSEXDEPS := $(call gb_Executable_get_runtime_dependencies,transex3)
|
||||
gb_SrsPartMergeTarget_TRANSEXCOMMAND := $(call gb_Executable_get_command,transex3)
|
||||
gb_SrsPartMergeTarget_TRANSEXCOMMAND = $(call gb_Executable_get_command,transex3)
|
||||
|
||||
define gb_SrsPartMergeTarget__command
|
||||
MERGEINPUT=`$(gb_MKTEMP)` && \
|
||||
@@ -78,7 +78,7 @@ endef
|
||||
# gb_SrsPartTarget__command_dep
|
||||
|
||||
gb_ResTarget_RSCDEPS := $(call gb_Executable_get_runtime_dependencies,rsc)
|
||||
gb_ResTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(call gb_Executable_get_command,rsc)
|
||||
gb_ResTarget_RSCCOMMAND = SOLARBINDIR=$(gb_Executable_BINDIR_FOR_BUILD) $(call gb_Executable_get_command,rsc)
|
||||
|
||||
define gb_SrsPartTarget__command
|
||||
$(call gb_Helper_abbreviate_dirs,\
|
||||
|
@@ -26,6 +26,7 @@ gb_Executable_LAYER_DIRS := \
|
||||
UREBIN:$(gb_INSTROOT)/$(LIBO_URE_BIN_FOLDER) \
|
||||
OOO:$(gb_INSTROOT)/$(gb_PROGRAMDIRNAME) \
|
||||
SDKBIN:$(INSTDIR)/$(gb_Package_SDKDIRNAME)/bin \
|
||||
NONE:$(gb_Executable_BINDIR) \
|
||||
|
||||
$(dir $(call gb_Executable_get_runtime_target,%)).dir :
|
||||
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
|
||||
@@ -62,22 +63,17 @@ define gb_Executable__Executable_impl
|
||||
$(call gb_LinkTarget_LinkTarget,$(2),Executable_$(1),$(call gb_Executable_get_layer,$(1)))
|
||||
$(call gb_LinkTarget_set_targettype,$(2),Executable)
|
||||
$(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS))
|
||||
$(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \
|
||||
| $(dir $(call gb_Executable_get_target,$(1))).dir
|
||||
$(call gb_Executable_get_target,$(1)) : \
|
||||
| $(dir $(call gb_Executable_get_target,$(1))).dir \
|
||||
$(gb_Executable_BINDIR)/.dir
|
||||
$(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_Executable_platform,$(1),$(2))
|
||||
$(call gb_Executable_Executable_platform,$(1),$(2),$(gb_Executable_BINDIR)/$(1).lib)
|
||||
|
||||
$(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))) \
|
||||
)
|
||||
$$(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)
|
||||
$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1))
|
||||
|
||||
endef
|
||||
|
||||
@@ -85,14 +81,8 @@ define gb_Executable_set_targettype_gui
|
||||
$(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,$(1))) : TARGETGUI := $(2)
|
||||
endef
|
||||
|
||||
# The auxtarget is delivered via the rule in Package.mk.
|
||||
# gb_Executable_add_auxtarget executable outdirauxtarget
|
||||
define gb_Executable_add_auxtarget
|
||||
$(call gb_LinkTarget_add_auxtarget,$(call gb_Executable_get_linktarget,$(1)),$(dir $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,$(1))))/$(notdir $(2)))
|
||||
$(call gb_Executable_get_target,$(1)) : $(2)
|
||||
$(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktarget,$(1))))/$(notdir $(2))
|
||||
$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS += $(2)
|
||||
|
||||
$(call gb_Output_error,gb_Executable_add_auxtarget should no longer be necessary)
|
||||
endef
|
||||
|
||||
define gb_Executable_forward_to_Linktarget
|
||||
|
@@ -121,11 +121,12 @@ endef
|
||||
# Set the executable as internal
|
||||
#
|
||||
# Optionally set a specific executable target to use (if the target
|
||||
# $(OUTDIR_FOR_BUILD)/bin/$(1)$(gb_Executable_EXT_for_build) is not suitable).
|
||||
# $(gb_Executable_BINDIR_FOR_BUILD)/$(1)$(gb_Executable_EXT_for_build) is
|
||||
# not suitable).
|
||||
#
|
||||
# gb_ExternalExecutable_set_internal executable call?
|
||||
define gb_ExternalExecutable_set_internal
|
||||
$(call gb_ExternalExecutable__set_internal,$(1),$(if $(strip $(2)),$(2),$(OUTDIR_FOR_BUILD)/bin/$(1)$(gb_Executable_EXT_for_build)))
|
||||
$(call gb_ExternalExecutable__set_internal,$(1),$(if $(strip $(2)),$(2),$(gb_Executable_BINDIR_FOR_BUILD)/$(1)$(gb_Executable_EXT_for_build)))
|
||||
|
||||
endef
|
||||
|
||||
|
@@ -45,13 +45,10 @@ gb_XcuDataTarget_get_outdir_target = $(gb_Configuration_registry)/data/$(1)
|
||||
gb_XcuLangpackTarget_get_outdir_target = $(gb_Configuration_registry)/spool/$(1)
|
||||
gb_XcuModuleTarget_get_outdir_target = $(gb_Configuration_registry)/spool/$(1)
|
||||
|
||||
define gb_Executable_get_target
|
||||
$(patsubst $(1):%,$(OUTDIR)/bin/%,$(filter $(1):%,$(gb_Executable_FILENAMES)))
|
||||
endef
|
||||
gb_Executable_get_target = $(gb_Executable__get_linktarget_target)
|
||||
|
||||
define gb_Executable_get_target_for_build
|
||||
$(patsubst $(1):%,$(OUTDIR_FOR_BUILD)/bin/%,$(filter $(1):%,$(gb_Executable_FILENAMES_FOR_BUILD)))
|
||||
endef
|
||||
# FIXME broken
|
||||
gb_Executable_get_target_for_build = $(gb_Executable__get_linktarget_target)
|
||||
|
||||
# FIXME: cleanup?
|
||||
gb_Library_get_target = $(gb_Library__get_linktarget_target)
|
||||
@@ -388,7 +385,7 @@ define gb_Executable__get_workdir_linktargetname
|
||||
Executable/$(call gb_Executable_get_filename,$(1))
|
||||
endef
|
||||
define gb_Executable__get_linktarget_target
|
||||
$(WORKDIR)/LinkTarget/$(call gb_Executable__get_workdir_linktargetname,$(1))
|
||||
$(call gb_Executable_get_install_target,$(1))
|
||||
endef
|
||||
define gb_Executable_get_linktarget
|
||||
$(call gb_Executable__get_workdir_linktargetname,$(1))<>$(call gb_Executable__get_linktarget_target,$(1))
|
||||
@@ -431,6 +428,7 @@ endef
|
||||
|
||||
gb_Library_WORKDIR_FOR_BUILD = $(WORKDIR_FOR_BUILD)/LinkTarget/Library
|
||||
gb_Executable_BINDIR = $(WORKDIR)/LinkTarget/Executable
|
||||
gb_Executable_BINDIR_FOR_BUILD = $(WORKDIR_FOR_BUILD)/LinkTarget/Executable
|
||||
# FIXME move platform
|
||||
gb_Library_OUTDIRLOCATION = $(if $(filter WNT,$(OS)),$(OUTDIR)/bin,$(OUTDIR)/lib)
|
||||
gb_Library_DLLDIR = $(WORKDIR)/LinkTarget/Library
|
||||
|
@@ -20,10 +20,10 @@
|
||||
# UnoApiTarget
|
||||
|
||||
gb_UnoApiTarget_UNOIDLWRITEDEPS := $(call gb_Executable_get_runtime_dependencies,unoidl-write)
|
||||
gb_UnoApiTarget_UNOIDLWRITECOMMAND := SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(call gb_Executable_get_command,unoidl-write)
|
||||
gb_UnoApiTarget_UNOIDLWRITECOMMAND := SOLARBINDIR=$(gb_Executable_BINDIR_FOR_BUILD) $(call gb_Executable_get_command,unoidl-write)
|
||||
|
||||
gb_UnoApiTarget_UNOIDLCHECKDEPS := $(call gb_Executable_get_runtime_dependencies,unoidl-check)
|
||||
gb_UnoApiTarget_UNOIDLCHECKCOMMAND := SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(call gb_Executable_get_command,unoidl-check)
|
||||
gb_UnoApiTarget_UNOIDLCHECKCOMMAND := SOLARBINDIR=$(gb_Executable_BINDIR_FOR_BUILD) $(call gb_Executable_get_command,unoidl-check)
|
||||
|
||||
define gb_UnoApiTarget__command
|
||||
$(call gb_Output_announce,$(2),$(true),UNO,4)
|
||||
@@ -126,7 +126,7 @@ $(eval $(call gb_Output_error,gb_UnoApiHeadersTarget_select_variant must be defi
|
||||
endif
|
||||
|
||||
gb_UnoApiHeadersTarget_CPPUMAKERDEPS := $(call gb_Executable_get_runtime_dependencies,cppumaker)
|
||||
gb_UnoApiHeadersTarget_CPPUMAKERCOMMAND := SOLARBINDIR=$(OUTDIR_FOR_BUILD)/bin $(call gb_Executable_get_command,cppumaker)
|
||||
gb_UnoApiHeadersTarget_CPPUMAKERCOMMAND := SOLARBINDIR=$(gb_Executable_BINDIR_FOR_BUILD) $(call gb_Executable_get_command,cppumaker)
|
||||
|
||||
define gb_UnoApiHeadersTarget__command
|
||||
$(gb_UnoApiHeadersTarget_CPPUMAKERCOMMAND) \
|
||||
|
@@ -370,14 +370,16 @@ gb_Executable_TARGETTYPEFLAGS := $(gb_Windows_PE_TARGETTYPEFLAGS)
|
||||
|
||||
gb_Executable_get_rpath :=
|
||||
|
||||
# surprisingly some executables have exports so link.exe creates import lib
|
||||
define gb_Executable_Executable_platform
|
||||
$(call gb_LinkTarget_add_auxtargets,$(2),\
|
||||
$(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
|
||||
$(call gb_LinkTarget_get_pdbfile,$(2)) \
|
||||
)
|
||||
$(call gb_LinkTarget_set_ilibtarget,$(2),$(3))
|
||||
|
||||
$(call gb_Executable_add_auxtarget,$(1),$(call gb_Executable_get_target,$(1)).manifest)
|
||||
$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest,$(1))
|
||||
$(call gb_LinkTarget_add_auxtargets,$(2),\
|
||||
$(patsubst %.lib,%.exp,$(3)) \
|
||||
$(call gb_LinkTarget_get_pdbfile2,$(2)).pdb \
|
||||
$(call gb_LinkTarget_get_pdbfile,$(2)) \
|
||||
$(call gb_LinkTarget_get_manifestfile,$(2)) \
|
||||
)
|
||||
|
||||
$(call gb_LinkTarget_get_target,$(2)) \
|
||||
$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE := $(call gb_LinkTarget_get_pdbfile,$(2))
|
||||
@@ -444,10 +446,11 @@ gb_PythonTest_PRECOMMAND := $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY
|
||||
# SrsPartTarget class
|
||||
|
||||
ifeq ($(gb_FULLDEPS),$(true))
|
||||
gb_SrsPartTarget__command_target = $(OUTDIR)/bin/makedepend$(gb_Executable_EXT)
|
||||
# FIXME this is used before TargetLocations is read?
|
||||
gb_SrsPartTarget__command_target = $(WORKDIR)/LinkTarget/Executable/makedepend.exe
|
||||
define gb_SrsPartTarget__command_dep
|
||||
$(call gb_Helper_abbreviate_dirs,\
|
||||
$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
|
||||
$(call gb_Executable_get_target,makedepend) \
|
||||
$(INCLUDE) \
|
||||
$(DEFS) \
|
||||
$(2) \
|
||||
@@ -485,12 +488,13 @@ $(eval $(call gb_Helper_make_dep_targets,\
|
||||
))
|
||||
|
||||
ifeq ($(gb_FULLDEPS),$(true))
|
||||
gb_WinResTarget__command_target = $(OUTDIR)/bin/makedepend$(gb_Executable_EXT)
|
||||
# FIXME this is used before TargetLocations is read?
|
||||
gb_WinResTarget__command_target = $(WORKDIR)/LinkTarget/Executable/makedepend.exe
|
||||
define gb_WinResTarget__command_dep
|
||||
$(call gb_Output_announce,RC:$(2),$(true),DEP,1)
|
||||
$(call gb_Helper_abbreviate_dirs,\
|
||||
mkdir -p $(dir $(1)) && \
|
||||
$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
|
||||
$(call gb_Executable_get_target,makedepend) \
|
||||
$(INCLUDE) \
|
||||
$(DEFS) \
|
||||
$(RCFILE) \
|
||||
|
@@ -321,12 +321,12 @@ $(eval $(call gb_Helper_make_dep_targets,\
|
||||
))
|
||||
|
||||
ifeq ($(gb_FULLDEPS),$(true))
|
||||
gb_WinResTarget__command_target = $(OUTDIR_FOR_BUILD)/bin/makedepend
|
||||
gb_WinResTarget__command_target = $(gb_Executable_BINDIR_FOR_BUILD)/makedepend
|
||||
define gb_WinResTarget__command_dep
|
||||
$(call gb_Output_announce,RC:$(2),$(true),DEP,1)
|
||||
$(call gb_Helper_abbreviate_dirs,\
|
||||
mkdir -p $(dir $(1)) && \
|
||||
$(OUTDIR_FOR_BUILD)/bin/makedepend \
|
||||
$(gb_Executable_BINDIR_FOR_BUILD)/makedepend \
|
||||
$(INCLUDE) \
|
||||
$(DEFS) \
|
||||
$(RCFILE) \
|
||||
|
Reference in New Issue
Block a user