mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-05-28 14:27:39 +03:00
45 lines
1.6 KiB
Makefile
45 lines
1.6 KiB
Makefile
# parameters:
|
|
# $(1): lowercase package name
|
|
# $(2): uppercase package name
|
|
# $(3): 32/64, build type
|
|
# $(4): module name (with extension)
|
|
#
|
|
define create-rules-winemaker
|
|
$(call create-rules-common,$(1),$(2),$(3))
|
|
$(2)_$(3)_OBJ := $$($(2)_$(3)_OBJ)/$(4)
|
|
|
|
$$(OBJ)/.$(1)-$(3)-configure:
|
|
@echo ":: configuring $(1)-$(3)..." >&2
|
|
rsync -arx "$$($(2)_SRC)/" "$$($(2)_$(3)_OBJ)/"
|
|
cd "$$($(2)_$(3)_OBJ)" && env $$($(2)_$(3)_ENV) \
|
|
winemaker --nosource-fix --nolower-include --nodlls --nomsvcrt \
|
|
"-I$$(WINE_SRC)/include" \
|
|
"-I$$(WINE_SRC)/include/wine" \
|
|
"-I$$(WINE_$(3)_DST)/include/wine" \
|
|
$(patsubst %.dll,--dll,$(patsubst %.exe,--guiexe,$(4))) \
|
|
$$($(3)_WINEMAKER_ARGS) \
|
|
$$($(2)_WINEMAKER_ARGS) \
|
|
$$($(2)_$(3)_WINEMAKER_ARGS) \
|
|
.
|
|
sed -re 's@_LDFLAGS=@_LDFLAGS= $$$$(LDFLAGS) @' -i "$$($(2)_$(3)_OBJ)/Makefile"
|
|
touch $$@
|
|
|
|
$$(OBJ)/.$(1)-$(3)-build:
|
|
@echo ":: building $(1)-$(3)..." >&2
|
|
rsync -arx "$$($(2)_SRC)/" "$$($(2)_$(3)_OBJ)/"
|
|
env $$($(2)_$(3)_ENV) \
|
|
$$(MAKE) -C "$$($(2)_$(3)_OBJ)" LIBRARIES="$$($(2)_LDFLAGS)"
|
|
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"
|
|
mkdir -p $$($(2)_$(3)_LIBDIR)/$($(3)_WINEDIR)
|
|
cp -a $$($(2)_$(3)_OBJ)/$(4).so $$($(2)_$(3)_LIBDIR)/$($(3)_WINEDIR)/
|
|
mkdir -p $$($(2)_$(3)_LIBDIR)/$(CROSS$(3)_WINEDIR)
|
|
cp -a $$($(2)_$(3)_OBJ)/$(4).fake $$($(2)_$(3)_LIBDIR)/$(CROSS$(3)_WINEDIR)/$(4)
|
|
touch $$@
|
|
endef
|
|
|
|
32_WINEMAKER_ARGS := --wine32
|
|
64_WINEMAKER_ARGS :=
|
|
|
|
rules-winemaker = $(call create-rules-winemaker,$(1),$(call toupper,$(1)),$(2),$(3))
|