mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
make: simplify make variables
Replace {,DONT_}{BUILD,INSTALL,TEST,BUSYTEST} with UTILS and SKIP_UTILS.
This commit is contained in:
parent
8aead4f36e
commit
f50eebb5f9
2 changed files with 14 additions and 37 deletions
30
Makefile
30
Makefile
|
@ -121,7 +121,7 @@ ifneq ($(OS),Windows_NT)
|
|||
PROGS := $(PROGS) $(UNIX_PROGS)
|
||||
endif
|
||||
|
||||
BUILD ?= $(PROGS)
|
||||
UTILS ?= $(PROGS)
|
||||
|
||||
# Programs with usable tests
|
||||
TEST_PROGS := \
|
||||
|
@ -172,23 +172,8 @@ TEST_PROGS := \
|
|||
unlink \
|
||||
wc
|
||||
|
||||
TEST ?= $(TEST_PROGS)
|
||||
|
||||
TESTS := \
|
||||
$(sort $(filter $(TEST),$(filter-out $(DONT_TEST),$(TEST_PROGS))))
|
||||
|
||||
INSTALL ?= $(PROGS)
|
||||
BUSYTEST ?= $(PROGS)
|
||||
|
||||
ifneq (,$(filter install, $(MAKECMDGOALS)))
|
||||
override BUILD:=$(INSTALL)
|
||||
override DONT_BUILD:=$(DONT_INSTALL)
|
||||
else
|
||||
ifneq (,$(filter busytest, $(MAKECMDGOALS)))
|
||||
override BUILD:=$(BUSYTEST)
|
||||
override DONT_BUILD:=$(DONT_BUSYTEST)
|
||||
endif
|
||||
endif
|
||||
$(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(TEST_PROGS))))
|
||||
|
||||
define BUILD_EXE
|
||||
build_exe_$(1):
|
||||
|
@ -207,12 +192,9 @@ endef
|
|||
|
||||
# Output names
|
||||
EXES := \
|
||||
$(sort $(filter $(BUILD),$(filter-out $(DONT_BUILD),$(PROGS))))
|
||||
$(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(PROGS))))
|
||||
|
||||
INSTALL ?= $(EXES)
|
||||
|
||||
INSTALLEES := \
|
||||
$(sort $(filter $(INSTALL),$(filter-out $(DONT_INSTALL),$(EXES) uutils)))
|
||||
INSTALLEES := ${EXES} uutils
|
||||
|
||||
# Shared library extension
|
||||
SYSTEM := $(shell uname)
|
||||
|
@ -247,7 +229,7 @@ build-uutils:
|
|||
build: build-uutils build-pkgs
|
||||
|
||||
$(foreach test,$(TESTS),$(eval $(call TEST_INTEGRATION,$(test))))
|
||||
$(foreach test,$(PROGS),$(eval $(call TEST_BUSYBOX,$(test))))
|
||||
$(foreach test,$(filter-out $(SKIP_UTILS),$(PROGS)),$(eval $(call TEST_BUSYBOX,$(test))))
|
||||
|
||||
test: $(addprefix test_integration_,$(TESTS))
|
||||
|
||||
|
@ -270,7 +252,7 @@ $(BUILDDIR)/busybox: busybox-src build-uutils $(BUILDDIR)/.config
|
|||
ifeq ($(EXES),)
|
||||
busytest:
|
||||
else
|
||||
busytest: $(BUILDDIR)/busybox $(addprefix test_busybox_,$(EXES))
|
||||
busytest: $(BUILDDIR)/busybox $(addprefix test_busybox_,$(filter-out $(SKIP_UTILS),$(EXES)))
|
||||
endif
|
||||
|
||||
clean:
|
||||
|
|
21
README.md
21
README.md
|
@ -34,17 +34,12 @@ make
|
|||
|
||||
To build all but a few of the available utilities:
|
||||
```
|
||||
make DONT_BUILD='UTILITY_1 UTILITY_2'
|
||||
make SKIP_UTILS='UTILITY_1 UTILITY_2'
|
||||
```
|
||||
|
||||
To build only a few of the available utilities:
|
||||
```
|
||||
make BUILD='UTILITY_1 UTILITY_2'
|
||||
```
|
||||
|
||||
To build with LTO and stripping:
|
||||
```
|
||||
make ENABLE_LTO=y ENABLE_STRIP=y
|
||||
make UTILS='UTILITY_1 UTILITY_2'
|
||||
```
|
||||
|
||||
Installation Instructions
|
||||
|
@ -57,12 +52,12 @@ make install
|
|||
|
||||
To install all but a few of the available utilities:
|
||||
```
|
||||
make DONT_INSTALL='UTILITY_1 UTILITY_2' install
|
||||
make SKIP_UTILS='UTILITY_1 UTILITY_2' install
|
||||
```
|
||||
|
||||
To install only a few of the available utilities:
|
||||
```
|
||||
make INSTALL='UTILITY_1 UTILITY_2' install
|
||||
make UTILS='UTILITY_1 UTILITY_2' install
|
||||
```
|
||||
|
||||
To install every program with a prefix (e.g. uu-echo uu-cat):
|
||||
|
@ -113,12 +108,12 @@ make test
|
|||
|
||||
To test all but a few of the available utilities:
|
||||
```
|
||||
make DONT_TEST='UTILITY_1 UTILITY_2' test
|
||||
make SKIP_UTILS='UTILITY_1 UTILITY_2' test
|
||||
```
|
||||
|
||||
To test only a few of the available utilities:
|
||||
```
|
||||
make TEST='UTILITY_1 UTILITY_2' test
|
||||
make UTILS='UTILITY_1 UTILITY_2' test
|
||||
```
|
||||
|
||||
Run busybox tests
|
||||
|
@ -133,12 +128,12 @@ make busytest
|
|||
|
||||
To run busybox's tests for a few of the available utilities
|
||||
```
|
||||
make BUSYTEST='UTILITY_1 UTILITY_2' busytest
|
||||
make UTILS='UTILITY_1 UTILITY_2' busytest
|
||||
```
|
||||
|
||||
To pass an argument like "-v" to the busybox test runtime
|
||||
```
|
||||
make BUSYTEST='UTILITY_1 UTILITY_2' RUNTEST_ARGS='-v' busytest
|
||||
make UTILS='UTILITY_1 UTILITY_2' RUNTEST_ARGS='-v' busytest
|
||||
```
|
||||
|
||||
Contribute
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue