build: Simplify cargo target replacement.
This commit is contained in:
parent
808b99bd27
commit
09568c2159
2 changed files with 5 additions and 2 deletions
|
@ -14,9 +14,12 @@ $$(OBJ)/.$(1)-configure$(3):
|
|||
$$(OBJ)/.$(1)-build$(3):
|
||||
@echo ":: building $(3)bit $(1)..." >&2
|
||||
cd $$($(2)_SRC) && env $$($(2)_ENV$(3)) \
|
||||
cargo build $$(filter -j%,$$(MAKEFLAGS)) --target "$$(ARCH$(3))-unknown-linux-gnu" --target-dir $$($(2)_OBJ$(3)) $$(CARGO_BUILD_ARG)
|
||||
cargo build $$(filter -j%,$$(MAKEFLAGS)) --target "$$(CARGO_TARGET_$(3))" --target-dir $$($(2)_OBJ$(3)) $$(CARGO_BUILD_ARG)
|
||||
touch $$@
|
||||
endif
|
||||
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
|
||||
|
|
|
@ -109,7 +109,7 @@ CONTAINERGOALS := $(CONTAINERGOALS) $(filter $(1),$(MAKECMDGOALS))
|
|||
|
||||
$(2)_ENV$(3) = \
|
||||
CARGO_HOME=$$(OBJ)/.cargo \
|
||||
CARGO_TARGET_$$(call toupper,$$(ARCH$(3))-unknown-linux-gnu)_LINKER="$$(ARCH$(3))-linux-gnu-gcc" \
|
||||
CARGO_TARGET_$$(call toupper,$$(CARGO_TARGET_$(3)))_LINKER="$$(ARCH$(3))-linux-gnu-gcc" \
|
||||
CCACHE_BASEDIR="$$(CCACHE_BASEDIR)" \
|
||||
STRIP="$$(STRIP)" \
|
||||
CC="$$(CCACHE_BIN) $$(ARCH$(3))-linux-gnu-gcc" \
|
||||
|
|
Loading…
Reference in a new issue