diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-17 16:33:19 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-18 10:28:09 +0000 |
commit | e2884ab9c17b797f39833bf0381bd2fa1b5ea205 (patch) | |
tree | e745708d501f6272a9a7203305cbe8807e834d40 /solenv/gbuild/AutoInstall.mk | |
parent | tdf#96091 Correct ascend and descend values for OTC font. (diff) | |
download | core-e2884ab9c17b797f39833bf0381bd2fa1b5ea205.tar.gz core-e2884ab9c17b797f39833bf0381bd2fa1b5ea205.zip |
gbuild: AutoInstall: rewrite scp2 file generation in Python
Much more readable.
Change-Id: I87c696e3f2f17a98c83eab9ed8149b79902be0fe
Reviewed-on: https://gerrit.libreoffice.org/22431
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Ostrovsky <david@ostrovsky.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'solenv/gbuild/AutoInstall.mk')
-rw-r--r-- | solenv/gbuild/AutoInstall.mk | 94 |
1 files changed, 24 insertions, 70 deletions
diff --git a/solenv/gbuild/AutoInstall.mk b/solenv/gbuild/AutoInstall.mk index 1fa2d38f05c1..5bf4d985b5cd 100644 --- a/solenv/gbuild/AutoInstall.mk +++ b/solenv/gbuild/AutoInstall.mk @@ -9,82 +9,36 @@ # AutoInstall class -# this is pretty horrible because -# a) make sucks -# b) this is an abuse of make anyway -# c) make 4.0 has $(file) but Apple prefers to ship 10 year old version instead -# d) Win32 make has an 8k command line lengh limit so needs to use $(file) -# maybe generation should be moved to some python script or something - -define gb_AutoInstall__escape -$(subst .,_,$(subst -,_,$(subst /,_,$(1)))) -endef - -define gb_AutoInstall__make_define -echo "#define auto_$*_ALL \ " >> $@ -$(foreach binary,$(filter-out $(lastword $(1)),$(1)),echo " $(call gb_AutoInstall__escape,$(binary)), \ " >> $@;) -echo " $(call gb_AutoInstall__escape,$(lastword $(1)))" >> $@; -echo "" >> $@ -endef - -define gb_AutoInstall__gen_define -$(file >>$@,#define auto_$*_ALL \) -$(foreach binary,$(filter-out $(lastword $(1)),$(1)),$(file >>$@,\ - $(call gb_AutoInstall__escape,$(binary)), \)) -$(file >>$@,\ - $(call gb_AutoInstall__escape,$(lastword $(1)))) - -endef - -define gb_AutoInstall__gen_lib -$(SCP2LIBTEMPLATE)(auto_$*_lib_$(call gb_AutoInstall__escape,$(1)),$(call gb_Library_get_runtime_filename,$(1))$(if $(SCP2COMPONENTCONDITION),$(COMMA)$(SCP2COMPONENTCONDITION))) - -endef - -define gb_AutoInstall__gen_pkg -PACKAGE_FILELIST(auto_$*_pkg_$(call gb_AutoInstall__escape,$(1)),$(1).filelist) - -endef - $(dir $(call gb_AutoInstall_get_target,%)).dir : $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) $(call gb_AutoInstall_get_target,%) : $(GBUILDDIR)/AutoInstall.mk \ $(SRCDIR)/Repository.mk $(SRCDIR)/RepositoryExternal.mk \ - $(BUILDDIR)/config_host.mk + $(BUILDDIR)/config_host.mk \ + $(call gb_ExternalExecutable_get_dependencies,python) $(call gb_Output_announce,$*,$(true),AIN,3) -ifeq ($(HAVE_GNUMAKE_FILE_FUNC),) - echo "/* autogenerated installs for group $* */" > $@ - $(call gb_AutoInstall__make_define,\ - $(foreach lib,$(gb_Library_MODULE_$*),auto_$*_lib_$(lib)) \ - $(foreach lib,$(gb_SdkLinkLibrary_MODULE_$*),auto_$*_link_$(lib)) \ - $(foreach exe,$(gb_Executable_MODULE_$*),auto_$*_exe_$(exe)) \ - $(foreach jar,$(gb_Jar_MODULE_$*),auto_$*_jar_$(jar)) \ - $(foreach pkg,$(gb_Package_MODULE_$*),auto_$*_pkg_$(pkg))) - $(foreach lib,$(gb_Library_MODULE_$*),\ - echo '$(SCP2LIBTEMPLATE)(auto_$*_lib_$(call gb_AutoInstall__escape,$(lib)),$(call gb_Library_get_runtime_filename,$(lib))$(if $(SCP2COMPONENTCONDITION),$(COMMA)$(SCP2COMPONENTCONDITION)))' >> $@;) -else - $(file >$@,/* autogenerated installs for group $* */) - $(call gb_AutoInstall__gen_define,\ - $(foreach lib,$(gb_Library_MODULE_$*),auto_$*_lib_$(lib)) \ - $(foreach lib,$(gb_SdkLinkLibrary_MODULE_$*),auto_$*_link_$(lib)) \ - $(foreach exe,$(gb_Executable_MODULE_$*),auto_$*_exe_$(exe)) \ - $(foreach jar,$(gb_Jar_MODULE_$*),auto_$*_jar_$(jar)) \ - $(foreach pkg,$(gb_Package_MODULE_$*),auto_$*_pkg_$(pkg))) - $(file >>$@,$(foreach lib,$(gb_Library_MODULE_$*),$(call gb_AutoInstall__gen_lib,$(lib)))) -endif - $(foreach lib,$(gb_SdkLinkLibrary_MODULE_$*),\ - echo 'SDK_LIBRARY_LINK(auto_$*_link_$(lib),$(notdir $(call gb_Library_get_sdk_link_lib,$(lib))),../../program/$(call gb_Library_get_runtime_filename,$(lib)))' >> $@;) - $(foreach exe,$(gb_Executable_MODULE_$*),\ - echo "$(SCP2EXETEMPLATE)(auto_$*_exe_$(call gb_AutoInstall__escape,$(exe)),$(call gb_Executable_get_filename,$(exe))$(if $(SCP2COMPONENTCONDITION),$(COMMA)$(SCP2COMPONENTCONDITION)))" >> $@;) - $(foreach jar,$(gb_Jar_MODULE_$*),\ - echo '$(SCP2JARTEMPLATE)(auto_$*_jar_$(call gb_AutoInstall__escape,$(jar)),$(jar).jar)' >> $@;) -ifeq ($(HAVE_GNUMAKE_FILE_FUNC),) - $(foreach pkg,$(gb_Package_MODULE_$*),\ - echo 'PACKAGE_FILELIST(auto_$*_pkg_$(call gb_AutoInstall__escape,$(pkg)),$(pkg).filelist)' >> $@;) -else - $(file >>$@,$(foreach pkg,$(gb_Package_MODULE_$*),$(call gb_AutoInstall__gen_pkg,$(pkg)))) -endif + SDKLIBFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\ + $(foreach lib,$(gb_SdkLinkLibrary_MODULE_$*),\ + $(lib) \ + $(notdir $(call gb_Library_get_sdk_link_lib,$(lib))) \ + ../../program/$(call gb_Library_get_runtime_filename,$(lib)))) \ + && LIBFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\ + $(foreach lib,$(gb_Library_MODULE_$*),\ + $(lib) \ + $(call gb_Library_get_runtime_filename,$(lib)))) \ + && EXEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\ + $(foreach exe,$(gb_Executable_MODULE_$*),\ + $(exe) \ + $(call gb_Executable_get_filename,$(exe)))) \ + && JARFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,$(gb_Jar_MODULE_$*)) \ + && PKGFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,$(gb_Package_MODULE_$*)) \ + && $(call gb_ExternalExecutable_get_command,python) \ + $(GBUILDDIR)/gen-autoinstall.py \ + '$*' '$(SCP2COMPONENTCONDITION)' \ + '$(SCP2LIBTEMPLATE)' '$(SCP2EXETEMPLATE)' '$(SCP2JARTEMPLATE)' \ + $${SDKLIBFILE} $${LIBFILE} $${EXEFILE} $${JARFILE} $${PKGFILE} \ + > $@ \ + && rm -f $${SDKLIBFILE} $${LIBFILE} $${EXEFILE} $${JARFILE} $${PKGFILE} $(call gb_AutoInstall_get_clean_target,%) : |