1# 2# Makefile for libcap 3# 4topdir=$(shell pwd) 5include Make.Rules 6 7# 8# flags 9# 10 11all install clean: %: %-here 12 $(MAKE) -C libcap $@ 13ifneq ($(PAM_CAP),no) 14 $(MAKE) -C pam_cap $@ 15endif 16ifeq ($(GOLANG),yes) 17 $(MAKE) -C go $@ 18 rm -f cap/go.sum 19endif 20 $(MAKE) -C tests $@ 21 $(MAKE) -C progs $@ 22 $(MAKE) -C doc $@ 23 $(MAKE) -C kdebug $@ 24 25all-here: 26 27install-here: 28 29clean-here: 30 $(LOCALCLEAN) 31 32distclean: clean 33 $(DISTCLEAN) 34 @echo "CONFIRM Go package cap has right version dependency on cap/psx:" 35 for x in $$(find . -name go.mod); do grep -F -v "module" $$x | fgrep "kernel.org/pub/linux/libs/security/libcap" > /dev/null || continue ; grep -F "v$(GOMAJOR).$(VERSION).$(MINOR)" $$x > /dev/null && continue ; echo "$$x is not updated. Try running: ./gomods.sh v$(GOMAJOR).$(VERSION).$(MINOR)" ; exit 1 ; done 36 @echo "ALL go.mod files updated" 37 @echo "Now validate that everything is checked in to a clean tree.." 38 test -z "$$(git status --ignored -s)" 39 @echo "All good!" 40 41release: distclean 42 cd .. && ln -s libcap libcap-$(VERSION).$(MINOR) && tar cvf libcap-$(VERSION).$(MINOR).tar --exclude patches libcap-$(VERSION).$(MINOR)/* && rm libcap-$(VERSION).$(MINOR) 43 44test: all 45 $(MAKE) -C libcap $@ 46 $(MAKE) -C tests $@ 47ifneq ($(PAM_CAP),no) 48 $(MAKE) -C pam_cap $@ 49endif 50ifeq ($(GOLANG),yes) 51 $(MAKE) -C go $@ 52endif 53 $(MAKE) -C progs $@ 54 55ktest: all 56 $(MAKE) -C kdebug test 57 58sudotest: all 59 $(MAKE) -C tests $@ 60ifneq ($(PAM_CAP),no) 61 $(MAKE) -C pam_cap $@ 62endif 63ifeq ($(GOLANG),yes) 64 $(MAKE) -C go $@ 65endif 66 $(MAKE) -C progs $@ 67 68distcheck: 69 ./distcheck.sh 70 $(MAKE) DYNAMIC=yes clean all test sudotest 71 $(MAKE) DYNAMIC=no COPTS="-O2 -std=c89" clean all test sudotest 72 $(MAKE) PAM_CAP=no CC=/usr/local/musl/bin/musl-gcc clean all test sudotest 73 $(MAKE) CC=clang clean all test sudotest 74 $(MAKE) clean all test sudotest 75 $(MAKE) distclean 76 77morgangodoc: 78 @echo "Now the release is made, you want to remember to run one of:" 79 @echo 80 @echo " GOPROXY=https://proxy.golang.org GO111MODULE=on go get kernel.org/pub/linux/libs/security/libcap/cap@v$(GOMAJOR).$(VERSION).$(MINOR)" 81 @echo 82 @echo or press the request button on this page: 83 @echo 84 @echo " https://pkg.go.dev/kernel.org/pub/linux/libs/security/libcap/cap@v$(GOMAJOR).$(VERSION).$(MINOR)" 85 @echo 86 @echo "This will cause a go.dev documentation update." 87 88morganrelease: distcheck 89 @echo "sign the main library tag twice: older DSA key; and newer RSA (kernel.org) key" 90 git tag -u D41A6DF2 -s libcap-$(VERSION).$(MINOR) -m "This is libcap-$(VERSION).$(MINOR)" 91 git tag -u E2CCF3F4 -s libcap-korg-$(VERSION).$(MINOR) -m "This is libcap-$(VERSION).$(MINOR)" 92 @echo "The following are for the Go module tracking." 93 git tag -u D41A6DF2 -s v$(GOMAJOR).$(VERSION).$(MINOR) -m "This is the version tag for the 'libcap' Go base directory associated with libcap-$(VERSION).$(MINOR)." 94 git tag -u D41A6DF2 -s psx/v$(GOMAJOR).$(VERSION).$(MINOR) -m "This is the (stable) version tag for the 'psx' Go package associated with libcap-$(VERSION).$(MINOR)." 95 git tag -u D41A6DF2 -s cap/v$(GOMAJOR).$(VERSION).$(MINOR) -m "This is the (stable) version tag for the 'cap' Go package associated with libcap-$(VERSION).$(MINOR)." 96 $(MAKE) release 97 @echo "sign the tar file using korg key" 98 cd .. && gpg -sba -u E2CCF3F4 libcap-$(VERSION).$(MINOR).tar 99 $(MAKE) morgangodoc 100