mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 20:17:45 +00:00
Modify Makefile to build correctly when using BUILD
This commit is contained in:
parent
ab08e623ef
commit
141e858407
1 changed files with 8 additions and 0 deletions
8
Makefile
8
Makefile
|
@ -130,9 +130,13 @@ endef
|
||||||
ALIAS_SOURCE = $(firstword $(subst :, ,$(1)))
|
ALIAS_SOURCE = $(firstword $(subst :, ,$(1)))
|
||||||
ALIAS_TARGET = $(word 2,$(subst :, ,$(1)))
|
ALIAS_TARGET = $(word 2,$(subst :, ,$(1)))
|
||||||
define MAKE_ALIAS
|
define MAKE_ALIAS
|
||||||
|
|
||||||
|
ifneq ($(ALIAS_TARGET,$(1)),)
|
||||||
all: build/$(call ALIAS_TARGET,$(1))
|
all: build/$(call ALIAS_TARGET,$(1))
|
||||||
build/$(call ALIAS_TARGET,$(1)): build/$(call ALIAS_SOURCE,$(1))
|
build/$(call ALIAS_TARGET,$(1)): build/$(call ALIAS_SOURCE,$(1))
|
||||||
$(call command,install build/$(call ALIAS_SOURCE,$(1)) build/$(call ALIAS_TARGET,$(1)))
|
$(call command,install build/$(call ALIAS_SOURCE,$(1)) build/$(call ALIAS_TARGET,$(1)))
|
||||||
|
endif
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Test exe built rules
|
# Test exe built rules
|
||||||
|
@ -145,11 +149,15 @@ tmp/$(1)_test: $(1)/test.rs
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Main rules
|
# Main rules
|
||||||
|
ifeq ($(BUILD), $(PROGS))
|
||||||
all: $(EXES_PATHS) build/uutils
|
all: $(EXES_PATHS) build/uutils
|
||||||
|
|
||||||
-include build/uutils.d
|
-include build/uutils.d
|
||||||
build/uutils: uutils/uutils.rs $(addprefix build/, $(addsuffix .timestamp, $(CRATES)))
|
build/uutils: uutils/uutils.rs $(addprefix build/, $(addsuffix .timestamp, $(CRATES)))
|
||||||
$(RUSTC) $(RUSTCFLAGS) -L build/ --dep-info $@.d uutils/uutils.rs -o $@
|
$(RUSTC) $(RUSTCFLAGS) -L build/ --dep-info $@.d uutils/uutils.rs -o $@
|
||||||
|
else
|
||||||
|
all: $(EXES_PATHS)
|
||||||
|
endif
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
LIBCRYPTO = $(shell $(RUSTC) --crate-file-name --crate-type rlib deps/rust-crypto/src/rust-crypto/lib.rs)
|
LIBCRYPTO = $(shell $(RUSTC) --crate-file-name --crate-type rlib deps/rust-crypto/src/rust-crypto/lib.rs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue