mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
commit
3d139aecc2
5 changed files with 18 additions and 22 deletions
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -1,3 +1,3 @@
|
|||
[submodule "md5sum/rust-crypto"]
|
||||
path = md5sum/rust-crypto
|
||||
path = deps/rust-crypto
|
||||
url = git://github.com/DaGenix/rust-crypto.git
|
||||
|
|
21
Makefile
21
Makefile
|
@ -70,7 +70,7 @@ EXES := \
|
|||
$(sort $(filter $(BUILD),$(filter-out $(DONT_BUILD),$(PROGS))))
|
||||
|
||||
CRATES := \
|
||||
$(sort $(filter $(EXES), $(filter-out md5sum true false, $(EXES))))
|
||||
$(sort $(filter $(EXES), $(filter-out true false, $(EXES))))
|
||||
|
||||
INSTALL ?= $(EXES)
|
||||
|
||||
|
@ -95,12 +95,13 @@ TESTS := \
|
|||
EXES_PATHS := $(addprefix build/,$(EXES))
|
||||
command = sh -c '$(1)'
|
||||
|
||||
|
||||
# Main exe build rule
|
||||
define EXE_BUILD
|
||||
-include build/$(1).d
|
||||
ifeq ($(wildcard $(1)/Makefile),)
|
||||
build/$(1): $(1)/$(1).rs | build
|
||||
$(call command,$(RUSTC) $(RUSTCFLAGS) --dep-info build/$(1).d -o build/$(1) $(1)/$(1).rs)
|
||||
$(call command,$(RUSTC) $(RUSTCFLAGS) -L build/ --dep-info build/$(1).d -o build/$(1) $(1)/$(1).rs)
|
||||
clean_$(1):
|
||||
else
|
||||
build/$(1): $(1)/$(1).rs | build
|
||||
|
@ -113,7 +114,7 @@ endef
|
|||
define CRATE_BUILD
|
||||
-include build/$(1).d
|
||||
build/$(2): $(1)/$(1).rs | build
|
||||
$(call command,$(RUSTC) $(RUSTCFLAGS) --crate-type rlib --dep-info build/$(1).d $(1)/$(1).rs --out-dir build)
|
||||
$(call command,$(RUSTC) $(RUSTCFLAGS) -L build/ --crate-type rlib --dep-info build/$(1).d $(1)/$(1).rs --out-dir build)
|
||||
endef
|
||||
|
||||
# Test exe built rules
|
||||
|
@ -127,9 +128,9 @@ endef
|
|||
|
||||
# Main rules
|
||||
ifneq ($(MULTICALL), 1)
|
||||
all: $(EXES_PATHS)
|
||||
all: deps $(EXES_PATHS)
|
||||
else
|
||||
all: build/uutils
|
||||
all: deps build/uutils
|
||||
|
||||
-include build/uutils.d
|
||||
|
||||
|
@ -137,6 +138,14 @@ build/uutils: uutils/uutils.rs $(addprefix build/, $(foreach crate,$(CRATES),$(s
|
|||
$(RUSTC) $(RUSTCFLAGS) -L build/ --dep-info $@.d uutils/uutils.rs -o $@
|
||||
endif
|
||||
|
||||
# Dependencies
|
||||
LIBCRYPTO := $(shell $(RUSTC) --crate-file-name --crate-type rlib deps/rust-crypto/src/rust-crypto/lib.rs)
|
||||
-include build/rust-crypto.d
|
||||
build/$(LIBCRYPTO):
|
||||
$(RUSTC) $(RUSTCFLAGS) --crate-type rlib --dep-info build/rust-crypto.d deps/rust-crypto/src/rust-crypto/lib.rs --out-dir build/
|
||||
|
||||
deps: build build/$(LIBCRYPTO)
|
||||
|
||||
test: tmp $(addprefix test_,$(TESTS))
|
||||
$(RM) -rf tmp
|
||||
|
||||
|
@ -200,4 +209,4 @@ busytest: build/busybox build/.config
|
|||
endif
|
||||
endif
|
||||
|
||||
.PHONY: all test clean busytest install uninstall
|
||||
.PHONY: all deps test clean busytest install uninstall
|
||||
|
|
0
md5sum/rust-crypto → deps/rust-crypto
vendored
0
md5sum/rust-crypto → deps/rust-crypto
vendored
|
@ -1,15 +0,0 @@
|
|||
include ../common.mk
|
||||
|
||||
all: ../build/md5sum
|
||||
|
||||
CRYPTO_DIR := rust-crypto
|
||||
CRYPTO_LIB := $(CRYPTO_DIR)/$(shell $(RUSTC) --crate-file-name --crate-type rlib $(CRYPTO_DIR)/src/rust-crypto/lib.rs)
|
||||
|
||||
../build/md5sum: md5sum.rs $(CRYPTO_LIB)
|
||||
$(RUSTC) $(RUSTFLAGS) -L $(CRYPTO_DIR) -o $@ $<
|
||||
|
||||
$(CRYPTO_LIB): $(CRYPTO_DIR)/src/rust-crypto/*.rs
|
||||
cd $(CRYPTO_DIR) && make
|
||||
|
||||
clean:
|
||||
cd $(CRYPTO_DIR) && make clean
|
|
@ -32,6 +32,7 @@ extern crate hostname;
|
|||
extern crate id;
|
||||
extern crate kill;
|
||||
extern crate logname;
|
||||
extern crate md5sum;
|
||||
extern crate mkdir;
|
||||
extern crate nl;
|
||||
extern crate paste;
|
||||
|
@ -91,6 +92,7 @@ fn util_map() -> HashMap<&str, fn(Vec<String>) -> int> {
|
|||
map.insert("id", id::uumain);
|
||||
map.insert("kill", kill::uumain);
|
||||
map.insert("logname", logname::uumain);
|
||||
map.insert("md5sum", md5sum::uumain);
|
||||
map.insert("mkdir", mkdir::uumain);
|
||||
map.insert("nl", nl::uumain);
|
||||
map.insert("paste", paste::uumain);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue