blob: 7150b9bf7d7d1c78f62447ec2e4f5ac196d1d584 [file] [log] [blame]
Andrew Morgan2c9c0532007-07-10 20:50:21 -07001#
Andrew Morgan2c9c0532007-07-10 20:50:21 -07002# Makefile for libcap
Andrew Morgancd45c572007-08-13 23:16:50 -07003#
Andrew Morgan2c9c0532007-07-10 20:50:21 -07004topdir=$(shell pwd)
5include Make.Rules
6
7#
8# flags
9#
10
Andrew G. Morgandce069b2016-02-06 19:42:27 -080011all install clean kdebug: %: %-here
Andrew G. Morgan953e7f12008-06-02 22:02:01 -070012 $(MAKE) -C libcap $@
Andrew G. Morgane64aa182008-01-17 19:31:45 -080013ifneq ($(PAM_CAP),no)
Andrew G. Morgan953e7f12008-06-02 22:02:01 -070014 $(MAKE) -C pam_cap $@
Andrew G. Morgane64aa182008-01-17 19:31:45 -080015endif
Andrew G. Morgan0615d992019-05-19 14:57:20 -070016ifeq ($(GOLANG),yes)
17 $(MAKE) -C go $@
Andrew G. Morganffa7df02020-07-03 15:27:09 -070018 rm -f cap/go.sum
Andrew G. Morgan0615d992019-05-19 14:57:20 -070019endif
Andrew G. Morgane9f55d92019-12-02 20:48:13 -080020 $(MAKE) -C tests $@
Andrew G. Morgan953e7f12008-06-02 22:02:01 -070021 $(MAKE) -C progs $@
22 $(MAKE) -C doc $@
Andrew G. Morgandce069b2016-02-06 19:42:27 -080023 $(MAKE) -C kdebug $@
Andrew Morgan2c9c0532007-07-10 20:50:21 -070024
25all-here:
26
27install-here:
28
29clean-here:
30 $(LOCALCLEAN)
31
32distclean: clean
33 $(DISTCLEAN)
Andrew G. Morgandc22ad62020-07-13 19:28:32 -070034 @echo "CONFIRM Go package cap has right version dependency on cap/psx:"
Andrew G. Morgan973c34a2020-07-19 14:59:05 -070035 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 to v$(GOMAJOR).$(VERSION).$(MINOR)" ; exit 1 ; done
Andrew G. Morgandc22ad62020-07-13 19:28:32 -070036 @echo "ALL go.mod files updated"
Andrew G. Morgandbeb06b2020-08-15 11:17:55 -070037 @echo "Now validate that everything is checked in to a clean tree.."
Andrew G. Morgan2e862482020-12-12 15:53:01 -080038 test -z "$$(git status --ignored -s)"
Andrew G. Morgandbeb06b2020-08-15 11:17:55 -070039 @echo "All good!"
Andrew Morgan2c9c0532007-07-10 20:50:21 -070040
41release: distclean
Andrew G. Morgan83dc0342018-09-15 14:49:09 -070042 cd .. && ln -s libcap libcap-$(VERSION).$(MINOR) && tar cvf libcap-$(VERSION).$(MINOR).tar --exclude patches libcap-$(VERSION).$(MINOR)/* && rm libcap-$(VERSION).$(MINOR)
Andrew G. Morgana613b002011-07-24 19:24:16 -070043
Andrew G. Morgan8030da12018-09-09 12:32:56 -070044test: all
Andrew Delgadillo9c740a52021-02-02 21:56:11 +000045 $(MAKE) -C libcap $@
46 $(MAKE) -C tests $@
Andrew G. Morgan99c995b2019-12-22 08:08:48 -080047ifneq ($(PAM_CAP),no)
48 $(MAKE) -C pam_cap $@
Andrew G. Morgan2b5f5632019-12-13 17:30:23 -080049endif
Andrew G. Morgan99c995b2019-12-22 08:08:48 -080050ifeq ($(GOLANG),yes)
Andrew Delgadillo9c740a52021-02-02 21:56:11 +000051 $(MAKE) -C go $@
Andrew G. Morgan99c995b2019-12-22 08:08:48 -080052endif
Andrew Delgadillo9c740a52021-02-02 21:56:11 +000053 $(MAKE) -C progs $@
Andrew G. Morgan8030da12018-09-09 12:32:56 -070054
Andrew G. Morgandada2712019-12-15 10:52:55 -080055sudotest: all
Andrew Delgadillo9c740a52021-02-02 21:56:11 +000056 $(MAKE) -C tests $@
Andrew G. Morgan99c995b2019-12-22 08:08:48 -080057ifneq ($(PAM_CAP),no)
58 $(MAKE) -C pam_cap $@
Andrew G. Morgandada2712019-12-15 10:52:55 -080059endif
Andrew G. Morgan99c995b2019-12-22 08:08:48 -080060ifeq ($(GOLANG),yes)
Andrew Delgadillo9c740a52021-02-02 21:56:11 +000061 $(MAKE) -C go $@
Andrew G. Morgan99c995b2019-12-22 08:08:48 -080062endif
Andrew Delgadillo9c740a52021-02-02 21:56:11 +000063 $(MAKE) -C progs $@
Andrew G. Morgandada2712019-12-15 10:52:55 -080064
Andrew G. Morgan6b395552020-06-02 20:56:01 -070065distcheck:
66 ./distcheck.sh
Andrew Delgadillo9c740a52021-02-02 21:56:11 +000067 $(MAKE) DYNAMIC=yes clean all test sudotest
68 $(MAKE) CC=/usr/local/musl/bin/musl-gcc clean all test sudotest
69 $(MAKE) clean all test sudotest
70 $(MAKE) distclean
Andrew G. Morgan6b395552020-06-02 20:56:01 -070071
Andrew G. Morgan79e421f2020-09-06 17:06:54 -070072morgangodoc:
73 @echo "Now the release is made, you want to remember to run:"
74 @echo
75 @echo "GOPROXY=https://proxy.golang.org GO111MODULE=on go get kernel.org/pub/linux/libs/security/libcap/cap@v$(GOMAJOR).$(VERSION).$(MINOR)"
76 @echo
77 @echo "This will cause a go.dev documentation update."
78
Andrew G. Morgandca9b222020-07-09 19:58:53 -070079morganrelease: distcheck
Andrew G. Morgan24aa3182020-07-07 20:00:46 -070080 @echo "sign the main library tag twice: older DSA key; and newer RSA (kernel.org) key"
Andrew G. Morgan83dc0342018-09-15 14:49:09 -070081 git tag -u D41A6DF2 -s libcap-$(VERSION).$(MINOR) -m "This is libcap-$(VERSION).$(MINOR)"
82 git tag -u E2CCF3F4 -s libcap-korg-$(VERSION).$(MINOR) -m "This is libcap-$(VERSION).$(MINOR)"
Andrew G. Morgan24aa3182020-07-07 20:00:46 -070083 @echo "The following are for the Go module tracking."
84 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)."
Andrew G Morgan1fe9b312020-07-03 20:36:43 -070085 git tag -u D41A6DF2 -s psx/v$(GOMAJOR).$(VERSION).$(MINOR) -m "This is the version tag for the 'psx' Go package associated with libcap-$(VERSION).$(MINOR)."
86 git tag -u D41A6DF2 -s cap/v$(GOMAJOR).$(VERSION).$(MINOR) -m "This is the version tag for the 'cap' Go package associated with libcap-$(VERSION).$(MINOR)."
Andrew Delgadillo9c740a52021-02-02 21:56:11 +000087 $(MAKE) release
Andrew G. Morgan83dc0342018-09-15 14:49:09 -070088 @echo "sign the tar file using korg key"
89 cd .. && gpg -sba -u E2CCF3F4 libcap-$(VERSION).$(MINOR).tar
Andrew Delgadillo9c740a52021-02-02 21:56:11 +000090 $(MAKE) morgangodoc