diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2021-09-04 14:05:11 -0700 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2021-09-04 14:05:11 -0700 |
commit | 5ef14d07420c299ecd8de96928a5d1ce1e232df3 (patch) | |
tree | 5935e55ff1d193d27853e287b033dc8f824f1df8 | |
parent | 99799844ad9272d43892881d1090369e6032aec2 (diff) | |
download | libcap2-5ef14d07420c299ecd8de96928a5d1ce1e232df3.tar.gz |
Refactor top level Makefile to reduce redundant building
Make build a bit quicker for folk that don't want to run tests.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r-- | Makefile | 28 | ||||
-rw-r--r-- | doc/Makefile | 6 | ||||
-rw-r--r-- | go/Makefile | 5 | ||||
-rw-r--r-- | libcap/Makefile | 3 | ||||
-rw-r--r-- | pam_cap/Makefile | 2 | ||||
-rw-r--r-- | progs/Makefile | 5 |
6 files changed, 21 insertions, 28 deletions
@@ -8,7 +8,7 @@ include Make.Rules # flags # -all install clean: %: %-here +all test sudotest install clean: %: %-here $(MAKE) -C libcap $@ ifneq ($(PAM_CAP),no) $(MAKE) -C pam_cap $@ @@ -20,10 +20,13 @@ endif $(MAKE) -C tests $@ $(MAKE) -C progs $@ $(MAKE) -C doc $@ - $(MAKE) -C kdebug $@ all-here: +test-here: + +sudotest-here: + install-here: clean-here: @@ -41,30 +44,9 @@ distclean: clean release: distclean cd .. && ln -s libcap libcap-$(VERSION).$(MINOR) && tar cvf libcap-$(VERSION).$(MINOR).tar --exclude patches libcap-$(VERSION).$(MINOR)/* && rm libcap-$(VERSION).$(MINOR) -test: all - $(MAKE) -C libcap $@ - $(MAKE) -C tests $@ -ifneq ($(PAM_CAP),no) - $(MAKE) -C pam_cap $@ -endif -ifeq ($(GOLANG),yes) - $(MAKE) -C go $@ -endif - $(MAKE) -C progs $@ - ktest: all $(MAKE) -C kdebug test -sudotest: all - $(MAKE) -C tests $@ -ifneq ($(PAM_CAP),no) - $(MAKE) -C pam_cap $@ -endif -ifeq ($(GOLANG),yes) - $(MAKE) -C go $@ -endif - $(MAKE) -C progs $@ - distcheck: ./distcheck.sh $(MAKE) DYNAMIC=no COPTS="-D_FORTIFY_SOURCE=2 -O1 -g" clean test diff --git a/doc/Makefile b/doc/Makefile index e2802dc..9614180 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -32,6 +32,12 @@ MANS = $(MAN1S) $(MAN3S) $(MAN8S) all: $(MANS) +test: + @echo no doc tests available + +sudotest: + @echo no doc sudotests available + .PHONY: html html: mkdir -p html diff --git a/go/Makefile b/go/Makefile index 5af5321..2b2061b 100644 --- a/go/Makefile +++ b/go/Makefile @@ -14,8 +14,9 @@ IMPORTDIR=kernel.org/pub/linux/libs/security/libcap PKGDIR=pkg/$(GOOSARCH)/$(IMPORTDIR) DEPS=../libcap/libcap.a ../libcap/libpsx.a +TESTS=compare-cap try-launching psx-signals -all: PSXGOPACKAGE CAPGOPACKAGE web setid gowns captree compare-cap try-launching psx-signals +all: PSXGOPACKAGE CAPGOPACKAGE web setid gowns captree $(DEPS): $(MAKE) -C ../libcap all @@ -93,7 +94,7 @@ endif b210613: b210613.go CAPGOPACKAGE CC="$(CC)" CGO_ENABLED="$(CGO_REQUIRED)" $(CGO_LDFLAGS_ALLOW) CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) build -mod=vendor $< -test: all +test: all $(TESTS) CC="$(CC)" CGO_ENABLED="$(CGO_REQUIRED)" $(CGO_LDFLAGS_ALLOW) $(GO) test -mod=vendor $(IMPORTDIR)/psx CC="$(CC)" CGO_ENABLED="$(CGO_REQUIRED)" $(CGO_LDFLAGS_ALLOW) $(GO) test -mod=vendor $(IMPORTDIR)/cap LD_LIBRARY_PATH=../libcap ./compare-cap diff --git a/libcap/Makefile b/libcap/Makefile index 4b96a0c..84340f2 100644 --- a/libcap/Makefile +++ b/libcap/Makefile @@ -148,6 +148,9 @@ ifeq ($(PTHREADS),yes) endif endif +sudotest: + @echo no sudotests for libcap + install: install-static ifeq ($(SHARED),yes) $(MAKE) install-shared diff --git a/pam_cap/Makefile b/pam_cap/Makefile index b245307..a000978 100644 --- a/pam_cap/Makefile +++ b/pam_cap/Makefile @@ -72,7 +72,7 @@ test: testlink test_pam_cap pam_cap.so LD_LIBRARY_PATH=../libcap ./pam_cap.so --help @echo "module can be run as an executable!" -sudotest: test test_pam_cap +sudotest: test_pam_cap $(SUDO) ./test_pam_cap root 0x0 0x0 0x0 config=./capability.conf $(SUDO) ./test_pam_cap root 0x0 0x0 0x0 config=./sudotest.conf $(SUDO) ./test_pam_cap alpha 0x0 0x0 0x0 config=./capability.conf diff --git a/progs/Makefile b/progs/Makefile index 2f887c8..e2bd7fe 100644 --- a/progs/Makefile +++ b/progs/Makefile @@ -42,7 +42,8 @@ ifeq ($(RAISE_SETFCAP),yes) $(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap endif -test: $(PROGS) capsh +test: + @echo "no program tests without privilege, try 'make sudotest'" capshdoc.h.cf: capshdoc.h ./mkcapshdoc.sh ./mkcapshdoc.sh > $@ @@ -60,7 +61,7 @@ uns_test: ../tests/uns_test.c $(MAKE) -C ../tests uns_test cp ../tests/uns_test . -sudotest: test tcapsh-static uns_test +sudotest: tcapsh-static uns_test $(SUDO) $(LDPATH) ./quicktest.sh clean: |