692ef0aa1f
Parts of the rules, including the magical ones created via make/rules-*.mk, are executed inside of the container via SHELL override, and parts are executed on the host side. This makes reasoning about and debugging the rules much harder than it should be. It also requirs the users to have certain programs installed on the host in addition to docker/podman. With this change `make` will act as a simple pass through to inside of the container for the most part. One notable exception is installation which still happens the host side.
29 lines
774 B
Makefile
29 lines
774 B
Makefile
# parameters:
|
|
# $(1): lowercase package name
|
|
# $(2): uppercase package name
|
|
# $(3): 32/64, build type
|
|
#
|
|
define create-rules-cargo
|
|
$(call create-rules-common,$(1),$(2),$(3))
|
|
|
|
$$(OBJ)/.$(1)-configure$(3):
|
|
@echo ":: configuring $(3)bit $(1)..." >&2
|
|
touch $$@
|
|
|
|
$$(OBJ)/.$(1)-build$(3):
|
|
@echo ":: building $(3)bit $(1)..." >&2
|
|
cd $$($(2)_SRC) && env $$($(2)_ENV$(3)) \
|
|
cargo build \
|
|
$$(filter -j%,$$(MAKEFLAGS)) \
|
|
--target "$$(CARGO_TARGET_$(3))" \
|
|
--target-dir $$($(2)_OBJ$(3)) \
|
|
$$(CARGO_BUILD_ARG) \
|
|
$$($(2)_CARGO_ARGS) \
|
|
$$($(2)_CARGO_ARGS$(3))
|
|
touch $$@
|
|
endef
|
|
|
|
rules-cargo = $(call create-rules-cargo,$(1),$(call toupper,$(1)),$(2))
|
|
|
|
CARGO_TARGET_32 := i686-unknown-linux-gnu
|
|
CARGO_TARGET_64 := x86_64-unknown-linux-gnu
|