diff --git a/build/makefile_base.mak b/build/makefile_base.mak index e96d014b..4d4b9e08 100644 --- a/build/makefile_base.mak +++ b/build/makefile_base.mak @@ -140,10 +140,10 @@ endif ## Global config ## -TOOLS_DIR32 := ./obj-tools32 -TOOLS_DIR64 := ./obj-tools64 -DST_BASE := ./dist +DST_BASE := $(OBJ)/dist DST_DIR := $(DST_BASE)/dist +DST_LIBDIR32 := $(DST_DIR)/lib +DST_LIBDIR64 := $(DST_DIR)/lib64 DEPLOY_DIR := ./deploy REDIST_DIR := ./redist @@ -202,20 +202,9 @@ GECKO64_TARBALL := wine-gecko-$(GECKO_VER)-x86_64.tar.xz WINEMONO_VER := 6.1.1 WINEMONO_TARBALL := wine-mono-$(WINEMONO_VER)-x86.tar.xz -# Wine outputs that need to exist for other steps (dist) -WINE_OUT_BIN := $(DST_DIR)/bin/wine64 -WINE_OUT_SERVER := $(DST_DIR)/bin/wineserver -WINE_OUT := $(WINE_OUT_BIN) $(WINE_OUT_SERVER) - FONTS := $(SRCDIR)/fonts FONTS_OBJ := ./obj-fonts -## Object directories -OBJ_DIRS := $(TOOLS_DIR32) $(TOOLS_DIR64) - -$(OBJ_DIRS): - mkdir -p $@ - ifeq ($(CONTAINER),) ## downloads -- Convenience target to download packages used during the build @@ -271,8 +260,8 @@ DIST_COPY_TARGETS := $(FILELOCK_TARGET) $(PROTON_PY_TARGET) \ $(PROTON37_TRACKED_FILES_TARGET) $(USER_SETTINGS_PY_TARGET) DIST_VERSION := $(DST_DIR)/version -DIST_OVR32 := $(DST_DIR)/lib/wine/dxvk/openvr_api_dxvk.dll -DIST_OVR64 := $(DST_DIR)/lib64/wine/dxvk/openvr_api_dxvk.dll +DIST_OVR32 := $(DST_LIBDIR32)/wine/dxvk/openvr_api_dxvk.dll +DIST_OVR64 := $(DST_LIBDIR64)/wine/dxvk/openvr_api_dxvk.dll DIST_PREFIX := $(DST_DIR)/share/default_pfx/ DIST_COMPAT_MANIFEST := $(DST_BASE)/compatibilitytool.vdf DIST_LICENSE := $(DST_BASE)/LICENSE @@ -304,11 +293,11 @@ $(DIST_OFL_LICENSE): $(OFL_LICENSE) cp -a $< $@ $(DIST_OVR32): $(SRCDIR)/openvr/bin/win32/openvr_api.dll | $(DST_DIR) - mkdir -p $(DST_DIR)/lib/wine/dxvk + mkdir -p $(DST_LIBDIR32)/wine/dxvk cp -a $< $@ $(DIST_OVR64): $(SRCDIR)/openvr/bin/win64/openvr_api.dll | $(DST_DIR) - mkdir -p $(DST_DIR)/lib64/wine/dxvk + mkdir -p $(DST_LIBDIR64)/wine/dxvk cp -a $< $@ $(DIST_COPY_TARGETS): | $(DST_DIR) @@ -370,14 +359,14 @@ ALL_TARGETS += dist GOAL_TARGETS += dist dist_prefix: wine gst_good - find $(DST_DIR)/lib/wine -type f -execdir chmod a-w '{}' '+' - find $(DST_DIR)/lib64/wine -type f -execdir chmod a-w '{}' '+' + find $(DST_LIBDIR32)/wine -type f -execdir chmod a-w '{}' '+' + find $(DST_LIBDIR64)/wine -type f -execdir chmod a-w '{}' '+' rm -rf $(abspath $(DIST_PREFIX)) python3 $(SRCDIR)/default_pfx.py $(abspath $(DIST_PREFIX)) $(abspath $(DST_DIR)) $(STEAM_RUNTIME_RUNSH) dist_wineopenxr: dist_prefix $(DIST_WINEOPENXR_JSON64) -dist: $(DIST_TARGETS) vrclient lsteamclient wineopenxr steam dxvk vkd3d-proton mediaconv dist_wineopenxr | $(DST_DIR) +dist: $(DIST_TARGETS) all-dist dist_wineopenxr | $(DST_DIR) echo `date '+%s'` `GIT_DIR=$(abspath $(SRCDIR)/.git) git describe --tags` > $(DIST_VERSION) cp $(DIST_VERSION) $(DST_BASE)/ @@ -455,16 +444,6 @@ $(eval $(call rules-source,gstreamer,$(SRCDIR)/gstreamer)) $(eval $(call rules-meson,gstreamer,32)) $(eval $(call rules-meson,gstreamer,64)) -$(OBJ)/.gstreamer-post-build64: - cp -a $(TOOLS_DIR64)/lib64/libgst* $(DST_DIR)/lib64/ && \ - cp -a $(TOOLS_DIR64)/lib64/gstreamer-1.0 $(DST_DIR)/lib64/ - touch $@ - -$(OBJ)/.gstreamer-post-build32: - cp -a $(TOOLS_DIR32)/lib/libgst* $(DST_DIR)/lib/ && \ - cp -a $(TOOLS_DIR32)/lib/gstreamer-1.0 $(DST_DIR)/lib/ - touch $@ - ## ## gst-plugins-base @@ -503,16 +482,6 @@ $(eval $(call rules-source,gst_base,$(SRCDIR)/gst-plugins-base)) $(eval $(call rules-meson,gst_base,32)) $(eval $(call rules-meson,gst_base,64)) -$(OBJ)/.gst_base-post-build64: - cp -a $(TOOLS_DIR64)/lib64/libgst* $(DST_DIR)/lib64/ && \ - cp -a $(TOOLS_DIR64)/lib64/gstreamer-1.0 $(DST_DIR)/lib64/ - touch $@ - -$(OBJ)/.gst_base-post-build32: - cp -a $(TOOLS_DIR32)/lib/libgst* $(DST_DIR)/lib/ && \ - cp -a $(TOOLS_DIR32)/lib/gstreamer-1.0 $(DST_DIR)/lib/ - touch $@ - ## ## gst-plugins-good @@ -575,16 +544,6 @@ $(eval $(call rules-source,gst_good,$(SRCDIR)/gst-plugins-good)) $(eval $(call rules-meson,gst_good,32)) $(eval $(call rules-meson,gst_good,64)) -$(OBJ)/.gst_good-post-build64: - cp -a $(TOOLS_DIR64)/lib64/libgst* $(DST_DIR)/lib64/ && \ - cp -a $(TOOLS_DIR64)/lib64/gstreamer-1.0 $(DST_DIR)/lib64/ - touch $@ - -$(OBJ)/.gst_good-post-build32: - cp -a $(TOOLS_DIR32)/lib/libgst* $(DST_DIR)/lib/ && \ - cp -a $(TOOLS_DIR32)/lib/gstreamer-1.0 $(DST_DIR)/lib/ - touch $@ - ## ## FAudio @@ -597,18 +556,6 @@ $(eval $(call rules-source,faudio,$(SRCDIR)/FAudio)) $(eval $(call rules-cmake,faudio,32)) $(eval $(call rules-cmake,faudio,64)) -$(OBJ)/.faudio-post-build32: - mkdir -p $(DST_DIR)/lib - cp -a $(TOOLS_DIR32)/lib/libFAudio* $(DST_DIR)/lib/ - [ x"$(STRIP)" = x ] || $(STRIP) $(DST_DIR)/lib/libFAudio.so - touch $@ - -$(OBJ)/.faudio-post-build64: - mkdir -p $(DST_DIR)/lib64 - cp -a $(TOOLS_DIR64)/lib64/libFAudio* $(DST_DIR)/lib64/ - [ x"$(STRIP)" = x ] || $(STRIP) $(DST_DIR)/lib64/libFAudio.so - touch $@ - ## ## jxrlib @@ -623,22 +570,6 @@ $(eval $(call rules-source,jxrlib,$(SRCDIR)/jxrlib)) $(eval $(call rules-cmake,jxrlib,32)) $(eval $(call rules-cmake,jxrlib,64)) -$(OBJ)/.jxrlib-post-build32: - mkdir -p $(DST_DIR)/lib - cp -a $(TOOLS_DIR32)/lib/libjpegxr* $(DST_DIR)/lib/ - cp -a $(TOOLS_DIR32)/lib/libjxrglue* $(DST_DIR)/lib/ - [ x"$(STRIP)" = x ] || $(STRIP) $(DST_DIR)/lib/libjpegxr.so - [ x"$(STRIP)" = x ] || $(STRIP) $(DST_DIR)/lib/libjxrglue.so - touch $@ - -$(OBJ)/.jxrlib-post-build64: - mkdir -p $(DST_DIR)/lib64 - cp -a $(TOOLS_DIR64)/lib/libjpegxr* $(DST_DIR)/lib64/ - cp -a $(TOOLS_DIR64)/lib/libjxrglue* $(DST_DIR)/lib64/ - [ x"$(STRIP)" = x ] || $(STRIP) $(DST_DIR)/lib64/libjpegxr.so - [ x"$(STRIP)" = x ] || $(STRIP) $(DST_DIR)/lib64/libjxrglue.so - touch $@ - ## ## lsteamclient @@ -659,18 +590,8 @@ $(eval $(call rules-source,lsteamclient,$(SRCDIR)/lsteamclient)) $(eval $(call rules-winemaker,lsteamclient,32,lsteamclient.dll)) $(eval $(call rules-winemaker,lsteamclient,64,lsteamclient.dll)) -$(OBJ)/.lsteamclient-post-build64: - [ x"$(STRIP)" = x ] || $(STRIP) $(LSTEAMCLIENT_OBJ64)/lsteamclient.dll.so - mkdir -pv $(DST_DIR)/lib64/wine/ - cp -af $(LSTEAMCLIENT_OBJ64)/lsteamclient.dll.so $(DST_DIR)/lib64/wine/ - touch $@ - -$(OBJ)/.lsteamclient-post-build32: - [ x"$(STRIP)" = x ] || $(STRIP) $(LSTEAMCLIENT_OBJ32)/lsteamclient.dll.so - mkdir -pv $(DST_DIR)/lib/wine/ - cp -af $(LSTEAMCLIENT_OBJ32)/lsteamclient.dll.so $(DST_DIR)/lib/wine/ - touch $@ +## ## ## openxr @@ -701,13 +622,6 @@ $(DIST_WINEOPENXR_JSON64): $(WINEOPENXR_SRC)/wineopenxr64.json mkdir -p $(dir $@) cp -a $< $@ -$(OBJ)/.wineopenxr-post-build64: - [ x"$(STRIP)" = x ] || $(STRIP) $(WINEOPENXR_OBJ64)/wineopenxr.dll.so && \ - mkdir -pv $(DST_DIR)/lib64/wine/fakedlls && \ - cp -a $(WINEOPENXR_OBJ64)/wineopenxr.dll.so $(DST_DIR)/lib64/wine/ && \ - cp -a $(WINEOPENXR_OBJ64)/wineopenxr.dll.fake $(DST_DIR)/lib64/wine/fakedlls/wineopenxr.dll - touch $@ - ## ## steam.exe @@ -727,10 +641,7 @@ $(eval $(call rules-source,steamexe,$(SRCDIR)/steam_helper)) $(eval $(call rules-winemaker,steamexe,32,steam.exe)) $(OBJ)/.steamexe-post-build32: - [ x"$(STRIP)" = x ] || $(STRIP) $(STEAMEXE_OBJ32)/steam.exe.so - mkdir -pv $(DST_DIR)/lib/wine/ - cp -af $(STEAMEXE_OBJ32)/steam.exe.so $(DST_DIR)/lib/wine/ - cp $(STEAMEXE_SRC)/libsteam_api.so $(DST_DIR)/lib/ + cp $(STEAMEXE_SRC)/libsteam_api.so $(DST_LIBDIR32)/ touch $@ @@ -764,20 +675,18 @@ $(OBJ)/.wine-post-source: $(WINE_SRC)/configure touch $@ $(OBJ)/.wine-post-build64: - mkdir -p $(DST_DIR)/{lib64,bin,share} - cp -a $(TOOLS_DIR64)/lib64 $(DST_DIR)/ - cp -a $(TOOLS_DIR64)/bin/wine64 $(DST_DIR)/bin/ - cp -a $(TOOLS_DIR64)/bin/wine64-preloader $(DST_DIR)/bin/ - cp -a $(TOOLS_DIR64)/bin/wineserver $(DST_DIR)/bin/ - cp -a $(TOOLS_DIR64)/bin/msidb $(DST_DIR)/bin/ - cp -a $(TOOLS_DIR64)/share/wine $(DST_DIR)/share/ + mkdir -p $(DST_DIR)/{bin,share} + $(call install-strip,$(WINE_DST64)/bin/wine64,$(DST_DIR)/bin) + $(call install-strip,$(WINE_DST64)/bin/wine64-preloader,$(DST_DIR)/bin) + $(call install-strip,$(WINE_DST64)/bin/wineserver,$(DST_DIR)/bin) + cp -a $(WINE_DST64)/share/wine $(DST_DIR)/share + cp -a $(WINE_DST64)/bin/msidb $(DST_DIR)/bin touch $@ $(OBJ)/.wine-post-build32: - mkdir -p $(DST_DIR)/{lib,bin} - cp -a $(TOOLS_DIR32)/lib $(DST_DIR)/ - cp -a $(TOOLS_DIR32)/bin/wine $(DST_DIR)/bin/ - cp -a $(TOOLS_DIR32)/bin/wine-preloader $(DST_DIR)/bin/ + mkdir -p $(DST_DIR)/bin + $(call install-strip,$(WINE_DST32)/bin/wine,$(DST_DIR)/bin) + $(call install-strip,$(WINE_DST32)/bin/wine-preloader,$(DST_DIR)/bin) touch $@ @@ -804,20 +713,6 @@ $(OBJ)/.vrclient-post-source: mkdir -p $(VRCLIENT_OBJ64) && cp -a $(VRCLIENT_SRC)/vrclient_x64/vrclient_x64.spec $(VRCLIENT_OBJ64)/vrclient_x64.spec touch $@ -$(OBJ)/.vrclient-post-build64: - [ x"$(STRIP)" = x ] || $(STRIP) $(VRCLIENT_OBJ64)/vrclient_x64.dll.so && \ - mkdir -pv $(DST_DIR)/lib64/wine/fakedlls && \ - cp -a $(VRCLIENT_OBJ64)/vrclient_x64.dll.so $(DST_DIR)/lib64/wine/ && \ - cp -a $(VRCLIENT_OBJ64)/vrclient_x64.dll.fake $(DST_DIR)/lib64/wine/fakedlls/vrclient_x64.dll - touch $@ - -$(OBJ)/.vrclient-post-build32: - [ x"$(STRIP)" = x ] || $(STRIP) $(VRCLIENT_OBJ32)/vrclient.dll.so && \ - mkdir -pv $(DST_DIR)/lib/wine/fakedlls && \ - cp -a $(VRCLIENT_OBJ32)/vrclient.dll.so $(DST_DIR)/lib/wine/ && \ - cp -a $(VRCLIENT_OBJ32)/vrclient.dll.fake $(DST_DIR)/lib/wine/fakedlls/vrclient.dll - touch $@ - ## ## dxvk @@ -835,26 +730,12 @@ $(eval $(call rules-meson,dxvk,32)) $(eval $(call rules-meson,dxvk,64)) $(OBJ)/.dxvk-post-build64: - mkdir -p "$(DST_DIR)/lib64/wine/dxvk" - cp -f "$(DXVK_OBJ64)"/bin/dxgi.dll "$(DST_DIR)"/lib64/wine/dxvk - cp -f "$(DXVK_OBJ64)"/bin/d3d11.dll "$(DST_DIR)"/lib64/wine/dxvk - cp -f "$(DXVK_OBJ64)"/bin/d3d10.dll "$(DST_DIR)"/lib64/wine/dxvk - cp -f "$(DXVK_OBJ64)"/bin/d3d10_1.dll "$(DST_DIR)"/lib64/wine/dxvk - cp -f "$(DXVK_OBJ64)"/bin/d3d10core.dll "$(DST_DIR)"/lib64/wine/dxvk - cp -f "$(DXVK_OBJ64)"/bin/d3d9.dll "$(DST_DIR)"/lib64/wine/dxvk - cp -f "$(DXVK_OBJ64)"/bin/dxvk_config.dll "$(DST_DIR)"/lib64/wine/dxvk + mkdir -p "$(DST_DIR)"/lib64/wine/dxvk rm -f "$(DST_DIR)"/lib64/wine/dxvk/version && if test -e $(SRCDIR)/.git; then ( cd $(SRCDIR) && git submodule status -- dxvk ) > "$(DST_DIR)"/lib64/wine/dxvk/version; fi touch $@ $(OBJ)/.dxvk-post-build32: mkdir -p "$(DST_DIR)"/lib/wine/dxvk - cp -f "$(DXVK_OBJ32)"/bin/dxgi.dll "$(DST_DIR)"/lib/wine/dxvk/ - cp -f "$(DXVK_OBJ32)"/bin/d3d11.dll "$(DST_DIR)"/lib/wine/dxvk/ - cp -f "$(DXVK_OBJ32)"/bin/d3d10.dll "$(DST_DIR)"/lib/wine/dxvk/ - cp -f "$(DXVK_OBJ32)"/bin/d3d10_1.dll "$(DST_DIR)"/lib/wine/dxvk/ - cp -f "$(DXVK_OBJ32)"/bin/d3d10core.dll "$(DST_DIR)"/lib/wine/dxvk/ - cp -f "$(DXVK_OBJ32)"/bin/d3d9.dll "$(DST_DIR)"/lib/wine/dxvk/ - cp -f "$(DXVK_OBJ32)"/bin/dxvk_config.dll "$(DST_DIR)"/lib/wine/dxvk rm -f "$(DST_DIR)"/lib/wine/dxvk/version && if test -e $(SRCDIR)/.git; then ( cd $(SRCDIR) && git submodule status -- dxvk ) > "$(DST_DIR)"/lib/wine/dxvk/version; fi touch $@ @@ -887,15 +768,11 @@ $(OBJ)/.vkd3d-proton-post-source: touch $@ $(OBJ)/.vkd3d-proton-post-build32: - mkdir -p $(abspath $(DST_DIR))/lib/ && \ - cp -af "$(VKD3D_PROTON_DST32)/bin/d3d12.dll" "$(DST_DIR)"/lib/wine/vkd3d-proton/ mkdir -p "$(DST_DIR)"/lib/wine/vkd3d-proton rm -f "$(DST_DIR)"/lib/wine/vkd3d-proton/version && if test -e $(SRCDIR)/.git; then ( cd $(SRCDIR) && git submodule status -- vkd3d-proton ) > "$(DST_DIR)"/lib/wine/vkd3d-proton/version; fi touch $@ $(OBJ)/.vkd3d-proton-post-build64: - mkdir -p $(abspath $(DST_DIR))/lib64/ && \ - cp -af "$(VKD3D_PROTON_DST64)/bin/d3d12.dll" "$(DST_DIR)"/lib64/wine/vkd3d-proton/ mkdir -p "$(DST_DIR)"/lib64/wine/vkd3d-proton rm -f "$(DST_DIR)"/lib64/wine/vkd3d-proton/version && if test -e $(SRCDIR)/.git; then ( cd $(SRCDIR) && git submodule status -- vkd3d-proton ) > "$(DST_DIR)"/lib64/wine/vkd3d-proton/version; fi touch $@ diff --git a/make/rules-common.mk b/make/rules-common.mk index aaa1d4e0..fda3e3db 100644 --- a/make/rules-common.mk +++ b/make/rules-common.mk @@ -4,7 +4,7 @@ # $(3): 32/64, build type define create-rules-common $(2)_OBJ$(3) := $$(OBJ)/obj-$(1)$(3) -$(2)_DST$(3) := $$(abspath $$(TOOLS_DIR$(3))) +$(2)_DST$(3) := $$(OBJ)/dst-$(1)$(3) $(2)_DEPS$(3) := $$(call toupper,$$($(2)_DEPENDS)) $$(call toupper,$$($(2)_DEPENDS$(3))) $(2)_BINDIR$(3) ?= $$($(2)_DST$(3))/bin @@ -32,6 +32,7 @@ $$(OBJ)/.$(1)-build$(3): $$(OBJ)/.$(1)-configure$(3) ifeq ($(CONTAINER),) $$(OBJ)/.$(1)-build$(3): container-build $$(OBJ)/.$(1)-post-build$(3): container-build +$$(OBJ)/.$(1)-dist$(3): container-build else $$(OBJ)/.$(1)-post-build$(3): $$(OBJ)/.$(1)-build$(3) endif @@ -46,7 +47,49 @@ all-build: $(1)-build .PHONY: all-build -$(1)$(3): $(1)-configure$(3) $(1)-build$(3) +ifeq ($(CONTAINER),1) +$$(OBJ)/.$(1)-dist$(3): $$(OBJ)/.$(1)-build$(3) +$$(OBJ)/.$(1)-dist$(3): $$(OBJ)/.$(1)-post-build$(3) + +ifneq ($(UNSTRIPPED_BUILD),) +$$(OBJ)/.$(1)-dist$(3): + @echo ":: installing $(3)bit $(1)..." >&2 + mkdir -p $$($(2)_LIBDIR$(3))/ $$(DST_LIBDIR$(3))/ + cd $$($(2)_LIBDIR$(3)) && find -type f -printf '$$(DST_LIBDIR$(3))/%h\0' | sort -z | uniq -z | xargs --verbose -0 -r -P8 mkdir -p + cd $$($(2)_LIBDIR$(3)) && find -type l -printf '%p\0$$(DST_LIBDIR$(3))/%p\0' | xargs --verbose -0 -r -P8 -n2 cp -a + cd $$($(2)_LIBDIR$(3)) && find -type f -not '(' -iname '*.pc' -or -iname '*.cmake' -or -iname '*.a' -or -iname '*.def' ')' \ + -printf '--only-keep-debug\0%p\0$$(DST_LIBDIR$(3))/%p.debug\0' | \ + xargs --verbose -0 -r -P8 -n3 objcopy --file-alignment=4096 + cd $$($(2)_LIBDIR$(3)) && find -type f -not '(' -iname '*.pc' -or -iname '*.cmake' -or -iname '*.a' -or -iname '*.def' ')' \ + -printf '--add-gnu-debuglink=$$(DST_LIBDIR$(3))/%p.debug\0--strip-debug\0%p\0$$(DST_LIBDIR$(3))/%p\0' | \ + xargs --verbose -0 -r -P8 -n4 objcopy --file-alignment=4096 + touch $$@ +else +$$(OBJ)/.$(1)-dist$(3): + @echo ":: installing $(3)bit $(1)..." >&2 + mkdir -p $$($(2)_LIBDIR$(3))/ $$(DST_LIBDIR$(3))/ + cd $$($(2)_LIBDIR$(3)) && find -type f -printf '$$(DST_LIBDIR$(3))/%h\0' | sort -z | uniq -z | xargs --verbose -0 -r -P8 mkdir -p + cd $$($(2)_LIBDIR$(3)) && find -type l -printf '%p\0$$(DST_LIBDIR$(3))/%p\0' | xargs --verbose -0 -r -P8 -n2 cp -a + cd $$($(2)_LIBDIR$(3)) && find -type f -not '(' -iname '*.pc' -or -iname '*.cmake' -or -iname '*.a' -or -iname '*.def' ')' \ + -printf '$$(DST_LIBDIR$(3))/%p.debug\0' | xargs --verbose -0 -r -P8 rm -f + cd $$($(2)_LIBDIR$(3)) && find -type f -not '(' -iname '*.pc' -or -iname '*.cmake' -or -iname '*.a' -or -iname '*.def' ')' \ + -printf '--strip-debug\0%p\0$$(DST_LIBDIR$(3))/%p\0' | \ + xargs --verbose -0 -r -P8 -n3 objcopy --file-alignment=4096 + touch $$@ +endif +endif + +$(1)-dist$(3): $$(OBJ)/.$(1)-dist$(3) +.INTERMEDIATE: $(1)-dist$(3) + +all-dist$(3) $(1)-dist: $(1)-dist$(3) +.PHONY: all-dist$(3) $(1)-dist + +all-dist: $(1)-dist +.PHONY: all-dist + + +$(1)$(3): $(1)-configure$(3) $(1)-build$(3) $(1)-dist$(3) .INTERMEDIATE: $(1)$(3) all$(3) $(1): $(1)$(3) @@ -69,17 +112,24 @@ $(2)_ENV$(3) = \ CROSSCXX="$$(CCACHE_BIN) $$(ARCH$(3))-w64-mingw32-g++" \ CROSSLD="$$(ARCH$(3))-w64-mingw32-ld" \ CROSSPKG_CONFIG="$$(ARCH$(3))-linux-gnu-pkg-config" \ - PATH="$$($(2)_BINDIR$(3)):$$(SRC)/glslang/bin:$$$$PATH" \ - LD_LIBRARY_PATH="$$($(2)_LIBDIR$(3)):$$$$LD_LIBRARY_PATH" \ - PKG_CONFIG_PATH="$$($(2)_LIBDIR$(3))/pkgconfig" \ - CFLAGS="-I$$($(2)_INCDIR$(3)) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(COMMON_FLAGS$(3))" \ - CXXFLAGS="-I$$($(2)_INCDIR$(3)) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$(COMMON_FLAGS$(3)) -std=c++17" \ - LDFLAGS="-L$$($(2)_LIBDIR$(3)) \ - -Wl,-rpath-link=$$($(2)_LIBDIR$(3)) \ + PATH="$$(call list-join,:,$$(foreach d,$$($(2)_DEPS$(3)),$$($$(d)_BINDIR$(3))),,:):$$(SRC)/glslang/bin:$$$$PATH" \ + LD_LIBRARY_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_DEPS$(3)),$$($$(d)_LIBDIR$(3))),,:)$$$$LD_LIBRARY_PATH" \ + PKG_CONFIG_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_DEPS$(3)),$$($$(d)_LIBDIR$(3))/pkgconfig))" \ + CFLAGS="$$(foreach d,$$($(2)_DEPS$(3)),-I$$($$(d)_INCDIR$(3))) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(COMMON_FLAGS$(3))" \ + CXXFLAGS="$$(foreach d,$$($(2)_DEPS$(3)),-I$$($$(d)_INCDIR$(3))) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$(COMMON_FLAGS$(3)) -std=c++17" \ + LDFLAGS="$$(foreach d,$$($(2)_DEPS$(3)),-L$$($$(d)_LIBDIR$(3))) \ + $$(foreach d,$$($(2)_DEPS$(3)),-Wl,-rpath-link=$$($$(d)_LIBDIR$(3))) \ $$($(2)_LDFLAGS) $$(LDFLAGS)" endef +ifneq ($(UNSTRIPPED_BUILD),) +install-strip = objcopy --file-alignment=4096 --only-keep-debug $(1) $(2)/$(notdir $(1)).debug && \ + objcopy --file-alignment=4096 --add-gnu-debuglink=$(2)/$(notdir $(1)).debug --strip-debug $(1) $(2)/$(notdir $(1)) +else +install-strip = objcopy --file-alignment=4096 --strip-debug $(1) $(2)/$(notdir $(1)) && rm -f $(2)/$(notdir $(1)).debug +endif + ARCH32 := i686 ARCH64 := x86_64