diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-09-19 00:08:31 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-09-22 11:08:32 +0200 |
commit | f2899508b3bd55ecdbd45a02e0e8071b95906b3a (patch) | |
tree | 061ab2746bbebb6ffff3fd1ecf845292c860a0bc /solenv | |
parent | 4c51feb06e9ee9be25eca5ae58d07cd6c12bca63 (diff) |
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
0ffab9363d527d55b12b9b09d7136ca1c9d171e0
"force 'main' to always be DLLPUBLIC."
Change-Id: I3e1ee7425dd430bb83c7cd59e265869a0541b38d
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/AllLangResTarget.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/Executable.mk | 22 | ||||
-rw-r--r-- | solenv/gbuild/ExternalExecutable.mk | 5 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 12 | ||||
-rw-r--r-- | solenv/gbuild/UnoApiTarget.mk | 6 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_class.mk | 20 | ||||
-rw-r--r-- | solenv/gbuild/platform/mingw.mk | 4 |
7 files changed, 33 insertions, 40 deletions
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk index ac7a9afdbdeb..0265bbadd9a6 100644 --- a/solenv/gbuild/AllLangResTarget.mk +++ b/solenv/gbuild/AllLangResTarget.mk @@ -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,\ diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index c12287b5c14f..433ee0eeba1a 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -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 diff --git a/solenv/gbuild/ExternalExecutable.mk b/solenv/gbuild/ExternalExecutable.mk index f934b62c9685..0d2a8cc13ce7 100644 --- a/solenv/gbuild/ExternalExecutable.mk +++ b/solenv/gbuild/ExternalExecutable.mk @@ -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 diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 6bcb3dfd3ac4..83c4e232d075 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -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 diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index adab8cc2f080..5ec75a5ce208 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -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) \ diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 92c23910cde6..af84d3526158 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -370,15 +370,17 @@ 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_set_ilibtarget,$(2),$(3)) + $(call gb_LinkTarget_add_auxtargets,$(2),\ - $(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(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_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_get_target,$(2)) \ $(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE := $(call gb_LinkTarget_get_pdbfile,$(2)) $(call gb_LinkTarget_get_target,$(2)) : TARGETGUI := @@ -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) \ diff --git a/solenv/gbuild/platform/mingw.mk b/solenv/gbuild/platform/mingw.mk index ceb67679f006..e36343b51c23 100644 --- a/solenv/gbuild/platform/mingw.mk +++ b/solenv/gbuild/platform/mingw.mk @@ -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) \ |