make: Pass target os instead of inconsistent CROSS.

This commit is contained in:
Rémi Bernon 2025-01-12 12:22:24 +01:00 committed by Arkadiusz Hiler
parent c8c66cc457
commit b33c6a4ec0
9 changed files with 144 additions and 148 deletions

View File

@ -107,8 +107,8 @@ DAV1D_MESON_ARGS = \
-Denable_tests=false -Denable_tests=false
$(eval $(call rules-source,dav1d,$(SRCDIR)/dav1d)) $(eval $(call rules-source,dav1d,$(SRCDIR)/dav1d))
$(eval $(call rules-meson,dav1d,i386)) $(eval $(call rules-meson,dav1d,i386,unix))
$(eval $(call rules-meson,dav1d,x86_64)) $(eval $(call rules-meson,dav1d,x86_64,unix))
## ##
@ -119,8 +119,8 @@ GST_ORC_MESON_ARGS := \
-Dorc-test=disabled -Dorc-test=disabled
$(eval $(call rules-source,gst_orc,$(SRCDIR)/gst-orc)) $(eval $(call rules-source,gst_orc,$(SRCDIR)/gst-orc))
$(eval $(call rules-meson,gst_orc,i386)) $(eval $(call rules-meson,gst_orc,i386,unix))
$(eval $(call rules-meson,gst_orc,x86_64)) $(eval $(call rules-meson,gst_orc,x86_64,unix))
## ##
@ -136,8 +136,8 @@ GSTREAMER_MESON_ARGS := \
GSTREAMER_DEPENDS = gst_orc GSTREAMER_DEPENDS = gst_orc
$(eval $(call rules-source,gstreamer,$(SRCDIR)/gstreamer/subprojects/gstreamer)) $(eval $(call rules-source,gstreamer,$(SRCDIR)/gstreamer/subprojects/gstreamer))
$(eval $(call rules-meson,gstreamer,i386)) $(eval $(call rules-meson,gstreamer,i386,unix))
$(eval $(call rules-meson,gstreamer,x86_64)) $(eval $(call rules-meson,gstreamer,x86_64,unix))
## ##
@ -145,8 +145,8 @@ $(eval $(call rules-meson,gstreamer,x86_64))
## ##
$(eval $(call rules-source,graphene,$(SRCDIR)/graphene)) $(eval $(call rules-source,graphene,$(SRCDIR)/graphene))
$(eval $(call rules-meson,graphene,i386)) $(eval $(call rules-meson,graphene,i386,unix))
$(eval $(call rules-meson,graphene,x86_64)) $(eval $(call rules-meson,graphene,x86_64,unix))
## ##
@ -177,8 +177,8 @@ GST_BASE_MESON_ARGS := \
GST_BASE_DEPENDS = gst_orc graphene gstreamer GST_BASE_DEPENDS = gst_orc graphene gstreamer
$(eval $(call rules-source,gst_base,$(SRCDIR)/gstreamer/subprojects/gst-plugins-base)) $(eval $(call rules-source,gst_base,$(SRCDIR)/gstreamer/subprojects/gst-plugins-base))
$(eval $(call rules-meson,gst_base,i386)) $(eval $(call rules-meson,gst_base,i386,unix))
$(eval $(call rules-meson,gst_base,x86_64)) $(eval $(call rules-meson,gst_base,x86_64,unix))
## ##
@ -208,8 +208,8 @@ GST_GOOD_MESON_ARGS := \
GST_GOOD_DEPENDS = gst_orc gstreamer gst_base GST_GOOD_DEPENDS = gst_orc gstreamer gst_base
$(eval $(call rules-source,gst_good,$(SRCDIR)/gstreamer/subprojects/gst-plugins-good/)) $(eval $(call rules-source,gst_good,$(SRCDIR)/gstreamer/subprojects/gst-plugins-good/))
$(eval $(call rules-meson,gst_good,i386)) $(eval $(call rules-meson,gst_good,i386,unix))
$(eval $(call rules-meson,gst_good,x86_64)) $(eval $(call rules-meson,gst_good,x86_64,unix))
## ##
## gst-plugins-bad ## gst-plugins-bad
@ -224,8 +224,8 @@ GST_BAD_MESON_ARGS := \
GST_BAD_DEPENDS = gst_orc gstreamer gst_base GST_BAD_DEPENDS = gst_orc gstreamer gst_base
$(eval $(call rules-source,gst_bad,$(SRCDIR)/gstreamer/subprojects/gst-plugins-bad/)) $(eval $(call rules-source,gst_bad,$(SRCDIR)/gstreamer/subprojects/gst-plugins-bad/))
$(eval $(call rules-meson,gst_bad,i386)) $(eval $(call rules-meson,gst_bad,i386,unix))
$(eval $(call rules-meson,gst_bad,x86_64)) $(eval $(call rules-meson,gst_bad,x86_64,unix))
## ##
## FFmpeg ## FFmpeg
@ -241,8 +241,8 @@ FFMPEG_CONFIGURE_ARGS := \
--enable-demuxer=matroska \ --enable-demuxer=matroska \
$(eval $(call rules-source,ffmpeg,$(SRCDIR)/ffmpeg)) $(eval $(call rules-source,ffmpeg,$(SRCDIR)/ffmpeg))
$(eval $(call rules-configure,ffmpeg,i386)) $(eval $(call rules-configure,ffmpeg,i386,unix))
$(eval $(call rules-configure,ffmpeg,x86_64)) $(eval $(call rules-configure,ffmpeg,x86_64,unix))
## Only use ffmpeg to build gst-libav; we don't ship it. ## Only use ffmpeg to build gst-libav; we don't ship it.
$(OBJ)/.ffmpeg-i386-dist: $(OBJ)/.ffmpeg-i386-dist:
@ -257,8 +257,8 @@ $(OBJ)/.ffmpeg-x86_64-dist:
GST_LIBAV_DEPENDS = gst_orc gstreamer gst_base ffmpeg GST_LIBAV_DEPENDS = gst_orc gstreamer gst_base ffmpeg
$(eval $(call rules-source,gst_libav,$(SRCDIR)/gstreamer/subprojects/gst-libav)) $(eval $(call rules-source,gst_libav,$(SRCDIR)/gstreamer/subprojects/gst-libav))
$(eval $(call rules-meson,gst_libav,i386)) $(eval $(call rules-meson,gst_libav,i386,unix))
$(eval $(call rules-meson,gst_libav,x86_64)) $(eval $(call rules-meson,gst_libav,x86_64,unix))
## ##
@ -271,8 +271,8 @@ GST_PLUGINS_RS_CARGO_ARGS = \
GST_PLUGINS_RS_DEPENDS = gst_orc gstreamer gst_base dav1d GST_PLUGINS_RS_DEPENDS = gst_orc gstreamer gst_base dav1d
$(eval $(call rules-source,gst_plugins_rs,$(SRCDIR)/gst-plugins-rs)) $(eval $(call rules-source,gst_plugins_rs,$(SRCDIR)/gst-plugins-rs))
$(eval $(call rules-cargo,gst_plugins_rs,i386)) $(eval $(call rules-cargo,gst_plugins_rs,i386,unix))
$(eval $(call rules-cargo,gst_plugins_rs,x86_64)) $(eval $(call rules-cargo,gst_plugins_rs,x86_64,unix))
$(OBJ)/.gst_plugins_rs-x86_64-post-build: $(OBJ)/.gst_plugins_rs-x86_64-post-build:
mkdir -p $(GST_PLUGINS_RS_x86_64_DST)/lib/x86_64-linux-gnu/gstreamer-1.0/ mkdir -p $(GST_PLUGINS_RS_x86_64_DST)/lib/x86_64-linux-gnu/gstreamer-1.0/
@ -290,8 +290,8 @@ $(OBJ)/.gst_plugins_rs-i386-post-build:
## ##
$(eval $(call rules-source,vulkan-headers,$(SRCDIR)/Vulkan-Headers)) $(eval $(call rules-source,vulkan-headers,$(SRCDIR)/Vulkan-Headers))
$(eval $(call rules-cmake,vulkan-headers,i386,CROSS)) $(eval $(call rules-cmake,vulkan-headers,i386,windows))
$(eval $(call rules-cmake,vulkan-headers,x86_64,CROSS)) $(eval $(call rules-cmake,vulkan-headers,x86_64,windows))
## ##
@ -299,8 +299,8 @@ $(eval $(call rules-cmake,vulkan-headers,x86_64,CROSS))
## ##
$(eval $(call rules-source,spirv-headers,$(SRCDIR)/SPIRV-Headers)) $(eval $(call rules-source,spirv-headers,$(SRCDIR)/SPIRV-Headers))
$(eval $(call rules-cmake,spirv-headers,i386,CROSS)) $(eval $(call rules-cmake,spirv-headers,i386,windows))
$(eval $(call rules-cmake,spirv-headers,x86_64,CROSS)) $(eval $(call rules-cmake,spirv-headers,x86_64,windows))
## ##
@ -308,8 +308,8 @@ $(eval $(call rules-cmake,spirv-headers,x86_64,CROSS))
## ##
$(eval $(call rules-source,glslang,$(SRCDIR)/glslang)) $(eval $(call rules-source,glslang,$(SRCDIR)/glslang))
$(eval $(call rules-cmake,glslang,i386)) $(eval $(call rules-cmake,glslang,i386,unix))
$(eval $(call rules-cmake,glslang,x86_64)) $(eval $(call rules-cmake,glslang,x86_64,unix))
## ##
@ -320,8 +320,8 @@ LSTEAMCLIENT_DEPENDS = wine
LSTEAMCLIENT_LDFLAGS = -static-libgcc -static-libstdc++ LSTEAMCLIENT_LDFLAGS = -static-libgcc -static-libstdc++
$(eval $(call rules-source,lsteamclient,$(SRCDIR)/lsteamclient)) $(eval $(call rules-source,lsteamclient,$(SRCDIR)/lsteamclient))
$(eval $(call rules-makedep,lsteamclient,i386,CROSS)) $(eval $(call rules-makedep,lsteamclient,i386))
$(eval $(call rules-makedep,lsteamclient,x86_64,CROSS)) $(eval $(call rules-makedep,lsteamclient,x86_64))
## ##
@ -332,8 +332,8 @@ $(eval $(call rules-makedep,lsteamclient,x86_64,CROSS))
OPENXR_CMAKE_ARGS = -DHAVE_FILESYSTEM_WITHOUT_LIB=0 OPENXR_CMAKE_ARGS = -DHAVE_FILESYSTEM_WITHOUT_LIB=0
$(eval $(call rules-source,openxr,$(SRCDIR)/OpenXR-SDK)) $(eval $(call rules-source,openxr,$(SRCDIR)/OpenXR-SDK))
# $(eval $(call rules-cmake,openxr,i386)) # $(eval $(call rules-cmake,openxr,i386,unix))
$(eval $(call rules-cmake,openxr,x86_64)) $(eval $(call rules-cmake,openxr,x86_64,unix))
## ##
@ -345,7 +345,7 @@ WINEOPENXR_LDFLAGS = -lopenxr_loader
WINEOPENXR_DEPENDS = wine openxr WINEOPENXR_DEPENDS = wine openxr
$(eval $(call rules-source,wineopenxr,$(SRCDIR)/wineopenxr)) $(eval $(call rules-source,wineopenxr,$(SRCDIR)/wineopenxr))
$(eval $(call rules-makedep,wineopenxr,x86_64,CROSS)) $(eval $(call rules-makedep,wineopenxr,x86_64))
DIST_WINEOPENXR64_JSON := $(DIST_PREFIX)/drive_c/openxr/wineopenxr64.json DIST_WINEOPENXR64_JSON := $(DIST_PREFIX)/drive_c/openxr/wineopenxr64.json
$(WINEOPENXR_SRC)/wineopenxr64.json: wineopenxr $(WINEOPENXR_SRC)/wineopenxr64.json: wineopenxr
@ -372,8 +372,8 @@ STEAMEXE_LDFLAGS = \
STEAMEXE_DEPENDS = wine STEAMEXE_DEPENDS = wine
$(eval $(call rules-source,steamexe,$(SRCDIR)/steam_helper)) $(eval $(call rules-source,steamexe,$(SRCDIR)/steam_helper))
$(eval $(call rules-makedep,steamexe,i386,CROSS)) $(eval $(call rules-makedep,steamexe,i386))
$(eval $(call rules-makedep,steamexe,x86_64,CROSS)) $(eval $(call rules-makedep,steamexe,x86_64))
$(OBJ)/.steamexe-i386-post-build: $(OBJ)/.steamexe-i386-post-build:
mkdir -p $(DST_LIBDIR)/i386-linux-gnu/ mkdir -p $(DST_LIBDIR)/i386-linux-gnu/
@ -390,11 +390,11 @@ $(OBJ)/.steamexe-x86_64-post-build:
## ##
$(eval $(call rules-source,piper,$(SRCDIR)/piper)) $(eval $(call rules-source,piper,$(SRCDIR)/piper))
$(eval $(call rules-cmake,piper,x86_64)) $(eval $(call rules-cmake,piper,x86_64,unix))
$(OBJ)/.piper-x86_64-post-build: $(OBJ)/.piper-x86_64-post-build:
mkdir -p $(PIPER_x86_64_DST)/lib/$(x86_64_TARGET) mkdir -p $(PIPER_x86_64_DST)/lib/$(x86_64-unix_TARGET)
mv $(PIPER_x86_64_DST)/*.so* $(PIPER_x86_64_DST)/lib/$(x86_64_TARGET) mv $(PIPER_x86_64_DST)/*.so* $(PIPER_x86_64_DST)/lib/$(x86_64-unix_TARGET)
mkdir -p $(DST_DIR)/share mkdir -p $(DST_DIR)/share
cp -a $(PIPER_x86_64_DST)/{espeak-ng-data,libtashkeel_model.ort} $(DST_DIR)/share/ cp -a $(PIPER_x86_64_DST)/{espeak-ng-data,libtashkeel_model.ort} $(DST_DIR)/share/
touch $@ touch $@
@ -442,8 +442,8 @@ WINE_i386_LIBDIR = $(WINE_i386_DST)/lib
WINE_x86_64_LIBDIR = $(WINE_x86_64_DST)/lib WINE_x86_64_LIBDIR = $(WINE_x86_64_DST)/lib
$(eval $(call rules-source,wine,$(SRCDIR)/wine)) $(eval $(call rules-source,wine,$(SRCDIR)/wine))
$(eval $(call rules-autoconf,wine,i386)) $(eval $(call rules-autoconf,wine,i386,unix))
$(eval $(call rules-autoconf,wine,x86_64)) $(eval $(call rules-autoconf,wine,x86_64,unix))
$(eval $(call rules-wine-requests,wine)) $(eval $(call rules-wine-requests,wine))
$(OBJ)/.wine-post-source: $(OBJ)/.wine-post-source:
@ -475,8 +475,8 @@ VRCLIENT_LDFLAGS = -static-libgcc -static-libstdc++
VRCLIENT_DEPENDS = vulkan-headers wine VRCLIENT_DEPENDS = vulkan-headers wine
$(eval $(call rules-source,vrclient,$(SRCDIR)/vrclient_x64)) $(eval $(call rules-source,vrclient,$(SRCDIR)/vrclient_x64))
$(eval $(call rules-makedep,vrclient,i386,CROSS)) $(eval $(call rules-makedep,vrclient,i386))
$(eval $(call rules-makedep,vrclient,x86_64,CROSS)) $(eval $(call rules-makedep,vrclient,x86_64))
## ##
@ -495,8 +495,8 @@ DXVK_x86_64_MESON_ARGS = --bindir=$(DXVK_x86_64_DST)/lib/wine/dxvk/x86_64-window
DXVK_DEPENDS = glslang DXVK_DEPENDS = glslang
$(eval $(call rules-source,dxvk,$(SRCDIR)/dxvk)) $(eval $(call rules-source,dxvk,$(SRCDIR)/dxvk))
$(eval $(call rules-meson,dxvk,i386,CROSS)) $(eval $(call rules-meson,dxvk,i386,windows))
$(eval $(call rules-meson,dxvk,x86_64,CROSS)) $(eval $(call rules-meson,dxvk,x86_64,windows))
$(OBJ)/.dxvk-post-source: $(OBJ)/.dxvk-post-source:
sed -re 's#@VCS_TAG@#$(shell git -C $(SRCDIR)/dxvk describe --always --abbrev=15 --dirty=0)#' \ sed -re 's#@VCS_TAG@#$(shell git -C $(SRCDIR)/dxvk describe --always --abbrev=15 --dirty=0)#' \
@ -515,8 +515,8 @@ DXVK_NVAPI_i386_MESON_ARGS = --bindir=$(DXVK_NVAPI_i386_DST)/lib/wine/nvapi/i386
DXVK_NVAPI_x86_64_MESON_ARGS = --bindir=$(DXVK_NVAPI_x86_64_DST)/lib/wine/nvapi/x86_64-windows DXVK_NVAPI_x86_64_MESON_ARGS = --bindir=$(DXVK_NVAPI_x86_64_DST)/lib/wine/nvapi/x86_64-windows
$(eval $(call rules-source,dxvk-nvapi,$(SRCDIR)/dxvk-nvapi)) $(eval $(call rules-source,dxvk-nvapi,$(SRCDIR)/dxvk-nvapi))
$(eval $(call rules-meson,dxvk-nvapi,i386,CROSS)) $(eval $(call rules-meson,dxvk-nvapi,i386,windows))
$(eval $(call rules-meson,dxvk-nvapi,x86_64,CROSS)) $(eval $(call rules-meson,dxvk-nvapi,x86_64,windows))
$(OBJ)/.dxvk-nvapi-post-source: $(OBJ)/.dxvk-nvapi-post-source:
mkdir -p $(DST_LIBDIR)/wine/nvapi mkdir -p $(DST_LIBDIR)/wine/nvapi
@ -560,8 +560,8 @@ VKD3D_i386_LIBDIR = $(VKD3D_i386_DST)/lib
VKD3D_x86_64_LIBDIR = $(VKD3D_x86_64_DST)/lib VKD3D_x86_64_LIBDIR = $(VKD3D_x86_64_DST)/lib
$(eval $(call rules-source,vkd3d,$(SRCDIR)/vkd3d)) $(eval $(call rules-source,vkd3d,$(SRCDIR)/vkd3d))
$(eval $(call rules-autoconf,vkd3d,i386,CROSS)) $(eval $(call rules-autoconf,vkd3d,i386,windows))
$(eval $(call rules-autoconf,vkd3d,x86_64,CROSS)) $(eval $(call rules-autoconf,vkd3d,x86_64,windows))
$(OBJ)/.vkd3d-x86_64-post-build: $(OBJ)/.vkd3d-x86_64-post-build:
mkdir -p $(VKD3D_x86_64_LIBDIR)/vkd3d/x86_64-windows mkdir -p $(VKD3D_x86_64_LIBDIR)/vkd3d/x86_64-windows
@ -596,8 +596,8 @@ ifneq ($(UNSTRIPPED_BUILD),)
endif endif
$(eval $(call rules-source,vkd3d-proton,$(SRCDIR)/vkd3d-proton)) $(eval $(call rules-source,vkd3d-proton,$(SRCDIR)/vkd3d-proton))
$(eval $(call rules-meson,vkd3d-proton,i386,CROSS)) $(eval $(call rules-meson,vkd3d-proton,i386,windows))
$(eval $(call rules-meson,vkd3d-proton,x86_64,CROSS)) $(eval $(call rules-meson,vkd3d-proton,x86_64,windows))
$(OBJ)/.vkd3d-proton-post-source: $(OBJ)/.vkd3d-proton-post-source:
sed -re 's#@VCS_TAG@#$(shell git -C $(SRCDIR)/vkd3d-proton describe --always --exclude=* --abbrev=15 --dirty=0)#' \ sed -re 's#@VCS_TAG@#$(shell git -C $(SRCDIR)/vkd3d-proton describe --always --exclude=* --abbrev=15 --dirty=0)#' \
@ -652,8 +652,8 @@ ifneq ($(wildcard $(SRCDIR)/eac-bridge/.*),)
EAC_DEPENDS = wine EAC_DEPENDS = wine
$(eval $(call rules-source,eac,$(SRCDIR)/eac-bridge)) $(eval $(call rules-source,eac,$(SRCDIR)/eac-bridge))
$(eval $(call create-rules-common,eac,EAC,x86_64)) $(eval $(call create-rules-common,eac,EAC,x86_64,unix))
$(eval $(call create-rules-common,eac,EAC,i386)) $(eval $(call create-rules-common,eac,EAC,i386,unix))
$(OBJ)/.eac-x86_64-build: $(OBJ)/.eac-x86_64-build:
@ -689,7 +689,7 @@ endif
SYMSTORE_DEPENDS = wine SYMSTORE_DEPENDS = wine
$(eval $(call rules-source,symstore,$(SRCDIR)/symstore)) $(eval $(call rules-source,symstore,$(SRCDIR)/symstore))
$(eval $(call create-rules-common,symstore,SYMSTORE,x86_64)) $(eval $(call create-rules-common,symstore,SYMSTORE,x86_64,unix))
$(OBJ)/.symstore-x86_64-build: $(OBJ)/.symstore-x86_64-build:
@echo ":: building symstore helper..." >&2 @echo ":: building symstore helper..." >&2

View File

@ -1,8 +1,8 @@
# parameters: # parameters:
# $(1): lowercase package name # $(1): lowercase package name
# $(2): uppercase package name # $(2): uppercase package name
# $(3): build target <arch> # $(3): build target arch
# $(4): CROSS/<empty>, cross compile # $(4): build target os
# #
define create-rules-autoconf define create-rules-autoconf
$(call create-rules-common,$(1),$(2),$(3),$(4)) $(call create-rules-common,$(1),$(2),$(3),$(4))
@ -19,7 +19,7 @@ $$(OBJ)/.$(1)-$(3)-configure: $$($(2)_SRC)/configure
$$($(2)_SRC)/configure $(--quiet?) -C \ $$($(2)_SRC)/configure $(--quiet?) -C \
--prefix="$$($(2)_$(3)_DST)" \ --prefix="$$($(2)_$(3)_DST)" \
--libdir="$$($(2)_$(3)_DST)/lib" \ --libdir="$$($(2)_$(3)_DST)/lib" \
--host="$$($(4)$(3)_TARGET)" \ --host="$$($(3)-$(4)_TARGET)" \
$$($(2)_$(3)_ENV) \ $$($(2)_$(3)_ENV) \
$$($(3)_AUTOCONF_ARGS) \ $$($(3)_AUTOCONF_ARGS) \
$$($(2)_AUTOCONF_ARGS) \ $$($(2)_AUTOCONF_ARGS) \

View File

@ -1,10 +1,11 @@
# parameters: # parameters:
# $(1): lowercase package name # $(1): lowercase package name
# $(2): uppercase package name # $(2): uppercase package name
# $(3): build target <arch> # $(3): build target arch
# $(4): build target os
# #
define create-rules-cargo define create-rules-cargo
$(call create-rules-common,$(1),$(2),$(3)) $(call create-rules-common,$(1),$(2),$(3),$(4))
$$(OBJ)/.$(1)-$(3)-configure: $$(OBJ)/.$(1)-$(3)-configure:
@echo ":: configuring $(1)-$(3)..." >&2 @echo ":: configuring $(1)-$(3)..." >&2
@ -16,16 +17,16 @@ $$(OBJ)/.$(1)-$(3)-build:
cargo build $(--quiet?) --release \ cargo build $(--quiet?) --release \
$$(filter -j%,$$(MAKEFLAGS)) \ $$(filter -j%,$$(MAKEFLAGS)) \
--target-dir $$($(2)_$(3)_OBJ) \ --target-dir $$($(2)_$(3)_OBJ) \
$$($(3)_CARGO_ARGS) \ $$($(3)-$(4)_CARGO_ARGS) \
$$($(2)_CARGO_ARGS) \ $$($(2)_CARGO_ARGS) \
$$($(2)_$(3)_CARGO_ARGS) $$($(2)_$(3)_CARGO_ARGS)
touch $$@ touch $$@
endef endef
rules-cargo = $(call create-rules-cargo,$(1),$(call toupper,$(1)),$(2)) rules-cargo = $(call create-rules-cargo,$(1),$(call toupper,$(1)),$(2),$(3))
i386_CARGO_TARGET := i686-unknown-linux-gnu i386-unix_CARGO_TARGET := i686-unknown-linux-gnu
x86_64_CARGO_TARGET := x86_64-unknown-linux-gnu x86_64-unix_CARGO_TARGET := x86_64-unknown-linux-gnu
i386_CARGO_ARGS := --target $(i386_CARGO_TARGET) i386-unix_CARGO_ARGS := --target $(i386-unix_CARGO_TARGET)
x86_64_CARGO_ARGS := --target $(x86_64_CARGO_TARGET) x86_64-unix_CARGO_ARGS := --target $(x86_64-unix_CARGO_TARGET)

View File

@ -1,8 +1,8 @@
# parameters: # parameters:
# $(1): lowercase package name # $(1): lowercase package name
# $(2): uppercase package name # $(2): uppercase package name
# $(3): build target <arch> # $(3): build target arch
# $(4): CROSS/<empty>, cross compile # $(4): build target os
# #
define create-rules-cmake define create-rules-cmake
$(call create-rules-common,$(1),$(2),$(3),$(4)) $(call create-rules-common,$(1),$(2),$(3),$(4))
@ -15,12 +15,9 @@ $$(OBJ)/.$(1)-$(3)-configure: $$($(2)_SRC)/CMakeLists.txt
cd "$$($(2)_$(3)_OBJ)" && env $$($(2)_$(3)_ENV) \ cd "$$($(2)_$(3)_OBJ)" && env $$($(2)_$(3)_ENV) \
cmake "$$($(2)_SRC)" \ cmake "$$($(2)_SRC)" \
-DCMAKE_INSTALL_PREFIX="$$($(2)_$(3)_DST)" \ -DCMAKE_INSTALL_PREFIX="$$($(2)_$(3)_DST)" \
-DCMAKE_INSTALL_LIBDIR="lib/$$($(4)$(3)_LIBDIR)" \ -DCMAKE_INSTALL_LIBDIR="lib/$$($(3)-$(4)_LIBDIR)" \
-DCMAKE_BUILD_TYPE=plain \ -DCMAKE_BUILD_TYPE=plain \
-DCMAKE_SYSTEM_NAME=$(if $(4),Windows,) \ $$($(3)-$(4)_CMAKE_ARGS) \
-DCMAKE_SHARED_LIBRARY_PREFIX_C=$(if $(4),,lib) \
-DCMAKE_IMPORT_LIBRARY_PREFIX_C=$(if $(4),,lib) \
$$($(3)_CMAKE_ARGS) \
$$($(2)_CMAKE_ARGS) \ $$($(2)_CMAKE_ARGS) \
$$($(2)_$(3)_CMAKE_ARGS) $$($(2)_$(3)_CMAKE_ARGS)
@ -35,4 +32,9 @@ $$(OBJ)/.$(1)-$(3)-build:
touch $$@ touch $$@
endef endef
i386-unix_CMAKE_ARGS := -DCMAKE_SHARED_LIBRARY_PREFIX_C=lib -DCMAKE_IMPORT_LIBRARY_PREFIX_C=lib
x86_64-unix_CMAKE_ARGS := -DCMAKE_SHARED_LIBRARY_PREFIX_C=lib -DCMAKE_IMPORT_LIBRARY_PREFIX_C=lib
i386-windows_CMAKE_ARGS := -DCMAKE_SYSTEM_NAME=Windows
x86_64-windows_CMAKE_ARGS := -DCMAKE_SYSTEM_NAME=Windows
rules-cmake = $(call create-rules-cmake,$(1),$(call toupper,$(1)),$(2),$(3)) rules-cmake = $(call create-rules-cmake,$(1),$(call toupper,$(1)),$(2),$(3))

View File

@ -1,8 +1,8 @@
# parameters: # parameters:
# $(1): lowercase package name # $(1): lowercase package name
# $(2): uppercase package name # $(2): uppercase package name
# $(3): build target <arch> # $(3): build target arch
# $(4): CROSS/<empty>, cross compile # $(4): build target os
define create-rules-common define create-rules-common
$(2)_$(3)_OBJ := $$(OBJ)/obj-$(1)-$(3) $(2)_$(3)_OBJ := $$(OBJ)/obj-$(1)-$(3)
$(2)_$(3)_DST := $$(OBJ)/dst-$(1)-$(3) $(2)_$(3)_DST := $$(OBJ)/dst-$(1)-$(3)
@ -94,37 +94,36 @@ all: $(1)
.PHONY: all .PHONY: all
$(2)_$(3)_INCFLAGS = $$(foreach d,$$($(2)_$(3)_DEPS),-I$$($$(d)_$(3)_INCDIR)) $(2)_$(3)_INCFLAGS = $$(foreach d,$$($(2)_$(3)_DEPS),-I$$($$(d)_$(3)_INCDIR))
$(2)_$(3)_LIBFLAGS = $$(foreach d,$$($(2)_$(3)_DEPS),-L$$($$(d)_$(3)_LIBDIR)/$$($(4)$(3)_LIBDIR)) \ $(2)_$(3)_LIBFLAGS = $$(foreach d,$$($(2)_$(3)_DEPS),-L$$($$(d)_$(3)_LIBDIR)/$$($(3)-$(4)_LIBDIR)) \
$$(foreach d,$$($(2)_$(3)_DEPS),-Wl,-rpath-link=$$($$(d)_$(3)_LIBDIR)/$$($(4)$(3)_LIBDIR)) \ $$(foreach d,$$($(2)_$(3)_DEPS),-Wl,-rpath-link=$$($$(d)_$(3)_LIBDIR)/$$($(3)-$(4)_LIBDIR)) \
# PKG_CONFIG is intentionally never using CROSS target, as it's missing # PKG_CONFIG is intentionally never using windows target, as it's missing
# wrapper scripts in the toolchain, we use PKG_CONFIG_LIBDIR directly # wrapper scripts in the toolchain, we use PKG_CONFIG_LIBDIR directly
# instead. # instead.
# #
# RC and WIDL are intentionally always using CROSS target, as their # RC and WIDL are intentionally always using windows target, as their
# native version doesn't exist. # unix version doesn't exist.
$(2)_$(3)_ENV = \ $(2)_$(3)_ENV = \
CARGO_TARGET_$$(call toupper,$$($(3)_CARGO_TARGET))_LINKER="$$($(4)$(3)_TARGET)-gcc" \ CARGO_TARGET_$$(call toupper,$$($(3)-$(4)_CARGO_TARGET))_LINKER="$$($(3)-$(4)_TARGET)-gcc" \
CCACHE_BASEDIR="$$(CCACHE_BASEDIR)" \ CCACHE_BASEDIR="$$(CCACHE_BASEDIR)" \
STRIP="$$(STRIP)" \ STRIP="$$(STRIP)" \
AR="$$($(4)$(3)_TARGET)-ar" \ AR="$$($(3)-$(4)_TARGET)-ar" \
RANLIB="$$($(4)$(3)_TARGET)-ranlib" \ RANLIB="$$($(3)-$(4)_TARGET)-ranlib" \
CC="$$($(4)$(3)_TARGET)-gcc" \ CC="$$($(3)-$(4)_TARGET)-gcc" \
CXX="$$($(4)$(3)_TARGET)-g++" \ CXX="$$($(3)-$(4)_TARGET)-g++" \
LD="$$($(4)$(3)_TARGET)-ld" \ LD="$$($(3)-$(4)_TARGET)-ld" \
RC="$$(CROSS$(3)_TARGET)-windres" \ RC="$$($(3)-windows_TARGET)-windres" \
WIDL="$$(CROSS$(3)_TARGET)-widl" \ WIDL="$$($(3)-windows_TARGET)-widl" \
PKG_CONFIG="$$($(3)_TARGET)-pkg-config" \ PKG_CONFIG="$$($(3)-unix_TARGET)-pkg-config" \
PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_DEPS),$$($$(d)_$(3)_BINDIR)),,:):$$$$PATH" \ PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_DEPS),$$($$(d)_$(3)_BINDIR)),,:):$$$$PATH" \
LD_LIBRARY_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_DEPS),$$($$(d)_$(3)_LIBDIR)/$$($(4)$(3)_LIBDIR)),,:)$$$$LD_LIBRARY_PATH" \ LD_LIBRARY_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_DEPS),$$($$(d)_$(3)_LIBDIR)/$$($(3)-$(4)_LIBDIR)),,:)$$$$LD_LIBRARY_PATH" \
PKG_CONFIG_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_DEPS),$$($$(d)_$(3)_LIBDIR)/$$($(4)$(3)_LIBDIR)/pkgconfig))" \ PKG_CONFIG_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_DEPS),$$($$(d)_$(3)_LIBDIR)/$$($(3)-$(4)_LIBDIR)/pkgconfig))" \
PKG_CONFIG_LIBDIR="/usr/lib/$$($(4)$(3)_LIBDIR)/pkgconfig:/usr/share/pkgconfig" \ PKG_CONFIG_LIBDIR="/usr/lib/$$($(3)-$(4)_LIBDIR)/pkgconfig:/usr/share/pkgconfig" \
CFLAGS="$$($(2)_$(3)_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)" \ CFLAGS="$$($(2)_$(3)_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)" \
CPPFLAGS="$$($(2)_$(3)_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)" \ CPPFLAGS="$$($(2)_$(3)_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)" \
CXXFLAGS="$$($(2)_$(3)_INCFLAGS) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS) -std=c++17" \ CXXFLAGS="$$($(2)_$(3)_INCFLAGS) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS) -std=c++17" \
LDFLAGS="$$($(2)_$(3)_LIBFLAGS) $$($(2)_$(3)_LDFLAGS) $$($(2)_LDFLAGS) $$($(4)LDFLAGS)" \ LDFLAGS="$$($(2)_$(3)_LIBFLAGS) $$($(2)_$(3)_LDFLAGS) $$($(2)_LDFLAGS) $$($(3)-$(4)_LDFLAGS)" \
SOURCE_DATE_EPOCH="$$($(2)_$(3)_SOURCE_DATE_EPOCH)" \ SOURCE_DATE_EPOCH="$$($(2)_$(3)_SOURCE_DATE_EPOCH)" \
ifeq ($(1),wine) ifeq ($(1),wine)
@ -132,22 +131,22 @@ ifeq ($(1),wine)
$(2)_$(3)_ENV += \ $(2)_$(3)_ENV += \
CROSSCFLAGS="$$($(2)_$(3)_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)" \ CROSSCFLAGS="$$($(2)_$(3)_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)" \
CROSSLDFLAGS="$$($(2)_$(3)_LIBFLAGS) $$($(2)_$(3)_LDFLAGS) $$($(2)_LDFLAGS) $$(CROSSLDFLAGS)" \ CROSSLDFLAGS="$$($(2)_$(3)_LIBFLAGS) $$($(2)_$(3)_LDFLAGS) $$($(2)_LDFLAGS) $$(CROSSLDFLAGS)" \
i386_AR="$$(CROSSi386_TARGET)-ar" \ i386_AR="$$(i386-windows_TARGET)-ar" \
i386_RANLIB="$$(CROSSi386_TARGET)-ranlib" \ i386_RANLIB="$$(i386-windows_TARGET)-ranlib" \
i386_CC="$$(CROSSi386_TARGET)-gcc" \ i386_CC="$$(i386-windows_TARGET)-gcc" \
i386_CXX="$$(CROSSi386_TARGET)-g++" \ i386_CXX="$$(i386-windows_TARGET)-g++" \
i386_LD="$$(CROSSi386_TARGET)-ld" \ i386_LD="$$(i386-windows_TARGET)-ld" \
i386_CFLAGS="$$($(2)_i386_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(32_COMMON_FLAGS)" \ i386_CFLAGS="$$($(2)_i386_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(32_COMMON_FLAGS)" \
i386_LDFLAGS="$$($(2)_i386_LIBFLAGS) $$($(2)_i386_LDFLAGS) $$($(2)_LDFLAGS) $$(CROSSLDFLAGS)" \ i386_LDFLAGS="$$($(2)_i386_LIBFLAGS) $$($(2)_i386_LDFLAGS) $$($(2)_LDFLAGS) $$(CROSSLDFLAGS)" \
i386_PKG_CONFIG_LIBDIR="/usr/lib/$$(CROSSi386_LIBDIR)/pkgconfig:/usr/share/pkgconfig" \ i386_PKG_CONFIG_LIBDIR="/usr/lib/$$(i386-windows_LIBDIR)/pkgconfig:/usr/share/pkgconfig" \
x86_64_AR="$$(CROSSx86_64_TARGET)-ar" \ x86_64_AR="$$(x86_64-windows_TARGET)-ar" \
x86_64_RANLIB="$$(CROSSx86_64_TARGET)-ranlib" \ x86_64_RANLIB="$$(x86_64-windows_TARGET)-ranlib" \
x86_64_CC="$$(CROSSx86_64_TARGET)-gcc" \ x86_64_CC="$$(x86_64-windows_TARGET)-gcc" \
x86_64_CXX="$$(CROSSx86_64_TARGET)-g++" \ x86_64_CXX="$$(x86_64-windows_TARGET)-g++" \
x86_64_LD="$$(CROSSx86_64_TARGET)-ld" \ x86_64_LD="$$(x86_64-windows_TARGET)-ld" \
x86_64_CFLAGS="$$($(2)_x86_64_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(64_COMMON_FLAGS)" \ x86_64_CFLAGS="$$($(2)_x86_64_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(64_COMMON_FLAGS)" \
x86_64_LDFLAGS="$$($(2)_x86_64_LIBFLAGS) $$($(2)_x86_64_LDFLAGS) $$($(2)_LDFLAGS) $$(CROSSLDFLAGS)" \ x86_64_LDFLAGS="$$($(2)_x86_64_LIBFLAGS) $$($(2)_x86_64_LDFLAGS) $$($(2)_LDFLAGS) $$(CROSSLDFLAGS)" \
x86_64_PKG_CONFIG_LIBDIR="/usr/lib/$$(CROSSx86_64_LIBDIR)/pkgconfig:/usr/share/pkgconfig" \ x86_64_PKG_CONFIG_LIBDIR="/usr/lib/$$(x86_64-windows_LIBDIR)/pkgconfig:/usr/share/pkgconfig" \
endif endif
@ -160,20 +159,15 @@ else
install-strip = objcopy $(OBJCOPY_FLAGS) --strip-debug $(1) $(2)/$(notdir $(1)) && rm -f $(2)/$(notdir $(1)).debug install-strip = objcopy $(OBJCOPY_FLAGS) --strip-debug $(1) $(2)/$(notdir $(1)) && rm -f $(2)/$(notdir $(1)).debug
endif endif
i386_TARGET := i686-linux-gnu i386-unix_TARGET := i686-linux-gnu
x86_64_TARGET := x86_64-linux-gnu x86_64-unix_TARGET := x86_64-linux-gnu
CROSSi386_TARGET := i686-w64-mingw32 i386-windows_TARGET := i686-w64-mingw32
CROSSx86_64_TARGET := x86_64-w64-mingw32 x86_64-windows_TARGET := x86_64-w64-mingw32
i386_LIBDIR := i386-linux-gnu i386-unix_LIBDIR := i386-linux-gnu
x86_64_LIBDIR := x86_64-linux-gnu x86_64-unix_LIBDIR := x86_64-linux-gnu
CROSSi386_LIBDIR := i386-w64-mingw32 i386-windows_LIBDIR := i386-w64-mingw32
CROSSx86_64_LIBDIR := x86_64-w64-mingw32 x86_64-windows_LIBDIR := x86_64-w64-mingw32
i386_WINEDIR := wine/i386-unix
x86_64_WINEDIR := wine/x86_64-unix
CROSSi386_WINEDIR := wine/i386-windows
CROSSx86_64_WINEDIR := wine/x86_64-windows
$(OBJ)/.%-i386-post-build: $(OBJ)/.%-i386-post-build:
touch $@ touch $@

View File

@ -1,8 +1,8 @@
# parameters: # parameters:
# $(1): lowercase package name # $(1): lowercase package name
# $(2): uppercase package name # $(2): uppercase package name
# $(3): build target <arch> # $(3): build target arch
# $(4): CROSS/<empty>, cross compile # $(4): build target os
# #
define create-rules-configure define create-rules-configure
$(call create-rules-common,$(1),$(2),$(3),$(4)) $(call create-rules-common,$(1),$(2),$(3),$(4))
@ -12,11 +12,10 @@ $$(OBJ)/.$(1)-$(3)-configure:
cd "$$($(2)_$(3)_OBJ)" && env $$($(2)_$(3)_ENV) \ cd "$$($(2)_$(3)_OBJ)" && env $$($(2)_$(3)_ENV) \
$$($(2)_SRC)/configure $(--quiet?) \ $$($(2)_SRC)/configure $(--quiet?) \
--cross-prefix=$$($(3)_TARGET)- \ --cross-prefix=$$($(3)-$(4)_TARGET)- \
--target-os=linux \
--prefix="$$($(2)_$(3)_DST)" \ --prefix="$$($(2)_$(3)_DST)" \
--libdir="$$($(2)_$(3)_LIBDIR)/$$($(4)$(3)_LIBDIR)" \ --libdir="$$($(2)_$(3)_LIBDIR)/$$($(3)-$(4)_LIBDIR)" \
$$($(3)_CONFIGURE_ARGS) \ $$($(3)-$(4)_CONFIGURE_ARGS) \
$$($(2)_CONFIGURE_ARGS) \ $$($(2)_CONFIGURE_ARGS) \
$$($(2)_$(3)_CONFIGURE_ARGS) $$($(2)_$(3)_CONFIGURE_ARGS)
@ -31,7 +30,9 @@ $$(OBJ)/.$(1)-$(3)-build:
touch $$@ touch $$@
endef endef
i386_CONFIGURE_ARGS := --arch=x86 i386-unix_CONFIGURE_ARGS := --arch=x86 --target-os=linux
x86_64_CONFIGURE_ARGS := --arch=x86_64 x86_64-unix_CONFIGURE_ARGS := --arch=x86_64 --target-os=linux
i386-windows_CONFIGURE_ARGS := --arch=x86 --target-os=windows
x86_64-windows_CONFIGURE_ARGS := --arch=x86_64 --target-os=windows
rules-configure = $(call create-rules-configure,$(1),$(call toupper,$(1)),$(2),$(3)) rules-configure = $(call create-rules-configure,$(1),$(call toupper,$(1)),$(2),$(3))

View File

@ -1,10 +1,10 @@
# parameters: # parameters:
# $(1): lowercase package name # $(1): lowercase package name
# $(2): uppercase package name # $(2): uppercase package name
# $(3): build target <arch> # $(3): build target arch
# #
define create-rules-makedep define create-rules-makedep
$(call create-rules-common,$(1),$(2),$(3)) # cannot pass $(4)/CROSS here because of link flags for remaining .dll.so modules $(call create-rules-common,$(1),$(2),$(3),unix)
$$(OBJ)/.$(1)-$(3)-configure: $$(OBJ)/.$(1)-$(3)-configure:
@echo ":: configuring $(1)-$(3)..." >&2 @echo ":: configuring $(1)-$(3)..." >&2
@ -20,21 +20,21 @@ $$(OBJ)/.$(1)-$(3)-configure:
-e '/^CFLAGS/c CFLAGS = $$($(2)_$(3)_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)' \ -e '/^CFLAGS/c CFLAGS = $$($(2)_$(3)_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)' \
-e '/^CPPFLAGS/c CPPFLAGS = $$($(2)_$(3)_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)' \ -e '/^CPPFLAGS/c CPPFLAGS = $$($(2)_$(3)_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS)' \
-e '/^CXXFLAGS/c CXXFLAGS = $$($(2)_$(3)_INCFLAGS) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS) -std=c++17' \ -e '/^CXXFLAGS/c CXXFLAGS = $$($(2)_$(3)_INCFLAGS) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS) -std=c++17' \
-e '/^LDFLAGS/c LDFLAGS = $$($(2)_$(3)_LIBFLAGS) $$($(2)_$(3)_LDFLAGS) $$($(2)_LDFLAGS)' \ -e '/^LDFLAGS/c LDFLAGS = $$($(2)_$(3)_LIBFLAGS) $$($(2)_$(3)_LDFLAGS) $$($(2)_LDFLAGS) $$($(3)-unix_LDFLAGS)' \
\ \
-e '/^x86_64_CC/a x86_64_CXX = $$(CROSSx86_64_TARGET)-g++' \ -e '/^x86_64_CC/a x86_64_CXX = $$(x86_64-windows_TARGET)-g++' \
-e '/^x86_64_CFLAGS/c x86_64_CFLAGS = $$($(2)_x86_64_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(x86_64_COMMON_FLAGS)' \ -e '/^x86_64_CFLAGS/c x86_64_CFLAGS = $$($(2)_x86_64_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(x86_64_COMMON_FLAGS)' \
-e '/^x86_64_CPPFLAGS/c x86_64_CPPFLAGS = $$($(2)_x86_64_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$(x86_64_COMMON_FLAGS)' \ -e '/^x86_64_CPPFLAGS/c x86_64_CPPFLAGS = $$($(2)_x86_64_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$(x86_64_COMMON_FLAGS)' \
-e '/^x86_64_CXXFLAGS/c x86_64_CXXFLAGS = $$($(2)_x86_64_INCFLAGS) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$(x86_64_COMMON_FLAGS) -std=c++17' \ -e '/^x86_64_CXXFLAGS/c x86_64_CXXFLAGS = $$($(2)_x86_64_INCFLAGS) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$(x86_64_COMMON_FLAGS) -std=c++17' \
-e '/^x86_64_LDFLAGS/c x86_64_LDFLAGS = $$($(2)_x86_64_LIBFLAGS) $$($(2)_x86_64_LDFLAGS) $$(CROSSLDFLAGS)' \ -e '/^x86_64_LDFLAGS/c x86_64_LDFLAGS = $$($(2)_x86_64_LIBFLAGS) $$($(2)_x86_64_LDFLAGS) $$(x86_64-windows_LDFLAGS)' \
\ \
-e '/^i386_CC/a i386_CXX = $$(CROSSi386_TARGET)-g++' \ -e '/^i386_CC/a i386_CXX = $$(i386-windows_TARGET)-g++' \
-e '/^i386_CFLAGS/c i386_CFLAGS = $$($(2)_i386_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(i386_COMMON_FLAGS)' \ -e '/^i386_CFLAGS/c i386_CFLAGS = $$($(2)_i386_INCFLAGS) $$($(2)_CFLAGS) $$(COMMON_FLAGS) $$(i386_COMMON_FLAGS)' \
-e '/^i386_CPPFLAGS/c i386_CPPFLAGS = $$($(2)_i386_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$(i386_COMMON_FLAGS)' \ -e '/^i386_CPPFLAGS/c i386_CPPFLAGS = $$($(2)_i386_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$(i386_COMMON_FLAGS)' \
-e '/^i386_CXXFLAGS/c i386_CXXFLAGS = $$($(2)_i386_INCFLAGS) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$(i386_COMMON_FLAGS) -std=c++17' \ -e '/^i386_CXXFLAGS/c i386_CXXFLAGS = $$($(2)_i386_INCFLAGS) $$($(2)_CXXFLAGS) $$(COMMON_FLAGS) $$(i386_COMMON_FLAGS) -std=c++17' \
-e '/^i386_LDFLAGS/c i386_LDFLAGS = $$($(2)_i386_LIBFLAGS) $$($(2)_i386_LDFLAGS) $$(CROSSLDFLAGS)' \ -e '/^i386_LDFLAGS/c i386_LDFLAGS = $$($(2)_i386_LIBFLAGS) $$($(2)_i386_LDFLAGS) $$(i386-windows_LDFLAGS)' \
\ \
-e 's@UNIXLDFLAGS =@UNIXLDFLAGS = -L$$(WINE_$(3)_LIBDIR)/$$($(3)_WINEDIR) -l:ntdll.so@' \ -e 's@UNIXLDFLAGS =@UNIXLDFLAGS = -L$$(WINE_$(3)_LIBDIR)/wine/$(3)-unix -l:ntdll.so@' \
$$(WINE_$(3)_OBJ)/Makefile > $$($(2)_$(3)_OBJ)/Makefile $$(WINE_$(3)_OBJ)/Makefile > $$($(2)_$(3)_OBJ)/Makefile
cd "$$($(2)_$(3)_OBJ)" && env $$($(2)_$(3)_ENV) \ cd "$$($(2)_$(3)_OBJ)" && env $$($(2)_$(3)_ENV) \
@ -51,4 +51,4 @@ $$(OBJ)/.$(1)-$(3)-build:
touch $$@ touch $$@
endef endef
rules-makedep = $(call create-rules-makedep,$(1),$(call toupper,$(1)),$(2),$(3)) rules-makedep = $(call create-rules-makedep,$(1),$(call toupper,$(1)),$(2))

View File

@ -1,8 +1,8 @@
# parameters: # parameters:
# $(1): lowercase package name # $(1): lowercase package name
# $(2): uppercase package name # $(2): uppercase package name
# $(3): build target <arch> # $(3): build target arch
# $(4): CROSS/<empty>, cross compile # $(4): build target os
# #
define create-rules-meson define create-rules-meson
$(call create-rules-common,$(1),$(2),$(3),$(4)) $(call create-rules-common,$(1),$(2),$(3),$(4))
@ -23,11 +23,11 @@ pkgconfig = '$$$$PKG_CONFIG'
needs_exe_wrapper = true needs_exe_wrapper = true
c_args = [$$(call list-quote,$$($(2)_$(3)_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS))] c_args = [$$(call list-quote,$$($(2)_$(3)_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS))]
cpp_args = [$$(call list-quote,$$($(2)_$(3)_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS) -std=c++17)] cpp_args = [$$(call list-quote,$$($(2)_$(3)_INCFLAGS) $$($(2)_CPPFLAGS) $$(COMMON_FLAGS) $$($(3)_COMMON_FLAGS) -std=c++17)]
link_args = [$$(call list-quote,$$($(2)_$(3)_LIBFLAGS) $$($(2)_$(3)_LDFLAGS) $$($(2)_LDFLAGS) $$($(4)LDFLAGS))] link_args = [$$(call list-quote,$$($(2)_$(3)_LIBFLAGS) $$($(2)_$(3)_LDFLAGS) $$($(2)_LDFLAGS) $$($(3)-$(4)_LDFLAGS))]
pkg_config_libdir = '$$$$PKG_CONFIG_LIBDIR' pkg_config_libdir = '$$$$PKG_CONFIG_LIBDIR'
[host_machine] [host_machine]
system = '$$($(4)$(3)_MESON_SYSTEM)' system = '$$($(4)_MESON_SYSTEM)'
cpu_family = '$$($(3)_MESON_CPU)' cpu_family = '$$($(3)_MESON_CPU)'
cpu = '$$($(3)_MESON_CPU)' cpu = '$$($(3)_MESON_CPU)'
endian = 'little' endian = 'little'
@ -47,10 +47,10 @@ $$(OBJ)/.$(1)-$(3)-configure: $$($(2)_SRC)/meson.build
env $$($(2)_$(3)_ENV) \ env $$($(2)_$(3)_ENV) \
meson "$$($(2)_$(3)_OBJ)" "$$($(2)_SRC)" \ meson "$$($(2)_$(3)_OBJ)" "$$($(2)_SRC)" \
--prefix="$$($(2)_$(3)_DST)" \ --prefix="$$($(2)_$(3)_DST)" \
--libdir="lib/$$($(4)$(3)_LIBDIR)" \ --libdir="lib/$$($(3)-$(4)_LIBDIR)" \
--buildtype=plain \ --buildtype=plain \
--cross-file=$$($(2)_$(3)_OBJ)/cross.txt \ --cross-file=$$($(2)_$(3)_OBJ)/cross.txt \
$$($(3)_MESON_ARGS) \ $$($(3)-$(4)_MESON_ARGS) \
$$($(2)_MESON_ARGS) \ $$($(2)_MESON_ARGS) \
$$($(2)_$(3)_MESON_ARGS) \ $$($(2)_$(3)_MESON_ARGS) \
$$(MESON_STRIP_ARG) $$(MESON_STRIP_ARG)
@ -67,9 +67,7 @@ endef
i386_MESON_CPU := x86 i386_MESON_CPU := x86
x86_64_MESON_CPU := x86_64 x86_64_MESON_CPU := x86_64
i386_MESON_SYSTEM := linux unix_MESON_SYSTEM := linux
x86_64_MESON_SYSTEM := linux windows_MESON_SYSTEM := windows
CROSSi386_MESON_SYSTEM := windows
CROSSx86_64_MESON_SYSTEM := windows
rules-meson = $(call create-rules-meson,$(1),$(call toupper,$(1)),$(2),$(3)) rules-meson = $(call create-rules-meson,$(1),$(call toupper,$(1)),$(2),$(3))

View File

@ -1,11 +1,11 @@
# parameters: # parameters:
# $(1): lowercase package name # $(1): lowercase package name
# $(2): uppercase package name # $(2): uppercase package name
# $(3): build target <arch> # $(3): build target arch
# $(4): module name (with extension) # $(4): module name (with extension)
# #
define create-rules-winemaker define create-rules-winemaker
$(call create-rules-common,$(1),$(2),$(3)) $(call create-rules-common,$(1),$(2),$(3),unix)
$(2)_$(3)_OBJ := $$($(2)_$(3)_OBJ)/$(4) $(2)_$(3)_OBJ := $$($(2)_$(3)_OBJ)/$(4)
$$(OBJ)/.$(1)-$(3)-configure: $$(OBJ)/.$(1)-$(3)-configure:
@ -31,10 +31,10 @@ $$(OBJ)/.$(1)-$(3)-build:
$$(MAKE) -C "$$($(2)_$(3)_OBJ)" LIBRARIES="$$($(2)_LDFLAGS)" $$(MAKE) -C "$$($(2)_$(3)_OBJ)" LIBRARIES="$$($(2)_LDFLAGS)"
cd "$$($(2)_$(3)_OBJ)" && touch "$(basename $(4)).spec" && env $$($(2)_$(3)_ENV) \ cd "$$($(2)_$(3)_OBJ)" && touch "$(basename $(4)).spec" && env $$($(2)_$(3)_ENV) \
winebuild --$(lastword $(subst ., ,$(4))) --fake-module -E "$(basename $(4)).spec" -o "$(4).fake" winebuild --$(lastword $(subst ., ,$(4))) --fake-module -E "$(basename $(4)).spec" -o "$(4).fake"
mkdir -p $$($(2)_$(3)_LIBDIR)/$($(3)_WINEDIR) mkdir -p $$($(2)_$(3)_LIBDIR)/wine/$(3)-unix
cp -a $$($(2)_$(3)_OBJ)/$(4).so $$($(2)_$(3)_LIBDIR)/$($(3)_WINEDIR)/ cp -a $$($(2)_$(3)_OBJ)/$(4).so $$($(2)_$(3)_LIBDIR)/wine/$(3)-unix/
mkdir -p $$($(2)_$(3)_LIBDIR)/$(CROSS$(3)_WINEDIR) mkdir -p $$($(2)_$(3)_LIBDIR)/wine/$(3)-windows
cp -a $$($(2)_$(3)_OBJ)/$(4).fake $$($(2)_$(3)_LIBDIR)/$(CROSS$(3)_WINEDIR)/$(4) cp -a $$($(2)_$(3)_OBJ)/$(4).fake $$($(2)_$(3)_LIBDIR)/wine/$(3)-windows/$(4)
touch $$@ touch $$@
endef endef