2
0
mirror of https://github.com/ValveSoftware/Proton synced 2025-08-22 02:08:36 +00:00
Proton/make/rules-cargo.mk
2025-04-24 18:03:11 +03:00

32 lines
864 B
Makefile

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