Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 1 | # |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 2 | # Makefile for libcap |
Andrew Morgan | cd45c57 | 2007-08-13 23:16:50 -0700 | [diff] [blame] | 3 | # |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 4 | topdir=$(shell pwd) |
| 5 | include Make.Rules |
| 6 | |
| 7 | # |
| 8 | # flags |
| 9 | # |
| 10 | |
Andrew G. Morgan | dce069b | 2016-02-06 19:42:27 -0800 | [diff] [blame] | 11 | all install clean kdebug: %: %-here |
Andrew G. Morgan | 953e7f1 | 2008-06-02 22:02:01 -0700 | [diff] [blame] | 12 | $(MAKE) -C libcap $@ |
Andrew G. Morgan | e64aa18 | 2008-01-17 19:31:45 -0800 | [diff] [blame] | 13 | ifneq ($(PAM_CAP),no) |
Andrew G. Morgan | 953e7f1 | 2008-06-02 22:02:01 -0700 | [diff] [blame] | 14 | $(MAKE) -C pam_cap $@ |
Andrew G. Morgan | e64aa18 | 2008-01-17 19:31:45 -0800 | [diff] [blame] | 15 | endif |
Andrew G. Morgan | 0615d99 | 2019-05-19 14:57:20 -0700 | [diff] [blame] | 16 | ifeq ($(GOLANG),yes) |
| 17 | $(MAKE) -C go $@ |
Andrew G. Morgan | ffa7df0 | 2020-07-03 15:27:09 -0700 | [diff] [blame] | 18 | rm -f cap/go.sum |
Andrew G. Morgan | 0615d99 | 2019-05-19 14:57:20 -0700 | [diff] [blame] | 19 | endif |
Andrew G. Morgan | e9f55d9 | 2019-12-02 20:48:13 -0800 | [diff] [blame] | 20 | $(MAKE) -C tests $@ |
Andrew G. Morgan | 953e7f1 | 2008-06-02 22:02:01 -0700 | [diff] [blame] | 21 | $(MAKE) -C progs $@ |
| 22 | $(MAKE) -C doc $@ |
Andrew G. Morgan | dce069b | 2016-02-06 19:42:27 -0800 | [diff] [blame] | 23 | $(MAKE) -C kdebug $@ |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 24 | |
| 25 | all-here: |
| 26 | |
| 27 | install-here: |
| 28 | |
| 29 | clean-here: |
| 30 | $(LOCALCLEAN) |
| 31 | |
| 32 | distclean: clean |
| 33 | $(DISTCLEAN) |
Andrew G. Morgan | dc22ad6 | 2020-07-13 19:28:32 -0700 | [diff] [blame] | 34 | @echo "CONFIRM Go package cap has right version dependency on cap/psx:" |
Andrew G. Morgan | 973c34a | 2020-07-19 14:59:05 -0700 | [diff] [blame] | 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 to v$(GOMAJOR).$(VERSION).$(MINOR)" ; exit 1 ; done |
Andrew G. Morgan | dc22ad6 | 2020-07-13 19:28:32 -0700 | [diff] [blame] | 36 | @echo "ALL go.mod files updated" |
Andrew G. Morgan | dbeb06b | 2020-08-15 11:17:55 -0700 | [diff] [blame] | 37 | @echo "Now validate that everything is checked in to a clean tree.." |
Andrew G. Morgan | 2e86248 | 2020-12-12 15:53:01 -0800 | [diff] [blame] | 38 | test -z "$$(git status --ignored -s)" |
Andrew G. Morgan | dbeb06b | 2020-08-15 11:17:55 -0700 | [diff] [blame] | 39 | @echo "All good!" |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 40 | |
| 41 | release: distclean |
Andrew G. Morgan | 83dc034 | 2018-09-15 14:49:09 -0700 | [diff] [blame] | 42 | cd .. && ln -s libcap libcap-$(VERSION).$(MINOR) && tar cvf libcap-$(VERSION).$(MINOR).tar --exclude patches libcap-$(VERSION).$(MINOR)/* && rm libcap-$(VERSION).$(MINOR) |
Andrew G. Morgan | a613b00 | 2011-07-24 19:24:16 -0700 | [diff] [blame] | 43 | |
Andrew G. Morgan | 8030da1 | 2018-09-09 12:32:56 -0700 | [diff] [blame] | 44 | test: all |
Andrew Delgadillo | 9c740a5 | 2021-02-02 21:56:11 +0000 | [diff] [blame] | 45 | $(MAKE) -C libcap $@ |
| 46 | $(MAKE) -C tests $@ |
Andrew G. Morgan | 99c995b | 2019-12-22 08:08:48 -0800 | [diff] [blame] | 47 | ifneq ($(PAM_CAP),no) |
| 48 | $(MAKE) -C pam_cap $@ |
Andrew G. Morgan | 2b5f563 | 2019-12-13 17:30:23 -0800 | [diff] [blame] | 49 | endif |
Andrew G. Morgan | 99c995b | 2019-12-22 08:08:48 -0800 | [diff] [blame] | 50 | ifeq ($(GOLANG),yes) |
Andrew Delgadillo | 9c740a5 | 2021-02-02 21:56:11 +0000 | [diff] [blame] | 51 | $(MAKE) -C go $@ |
Andrew G. Morgan | 99c995b | 2019-12-22 08:08:48 -0800 | [diff] [blame] | 52 | endif |
Andrew Delgadillo | 9c740a5 | 2021-02-02 21:56:11 +0000 | [diff] [blame] | 53 | $(MAKE) -C progs $@ |
Andrew G. Morgan | 8030da1 | 2018-09-09 12:32:56 -0700 | [diff] [blame] | 54 | |
Andrew G. Morgan | dada271 | 2019-12-15 10:52:55 -0800 | [diff] [blame] | 55 | sudotest: all |
Andrew Delgadillo | 9c740a5 | 2021-02-02 21:56:11 +0000 | [diff] [blame] | 56 | $(MAKE) -C tests $@ |
Andrew G. Morgan | 99c995b | 2019-12-22 08:08:48 -0800 | [diff] [blame] | 57 | ifneq ($(PAM_CAP),no) |
| 58 | $(MAKE) -C pam_cap $@ |
Andrew G. Morgan | dada271 | 2019-12-15 10:52:55 -0800 | [diff] [blame] | 59 | endif |
Andrew G. Morgan | 99c995b | 2019-12-22 08:08:48 -0800 | [diff] [blame] | 60 | ifeq ($(GOLANG),yes) |
Andrew Delgadillo | 9c740a5 | 2021-02-02 21:56:11 +0000 | [diff] [blame] | 61 | $(MAKE) -C go $@ |
Andrew G. Morgan | 99c995b | 2019-12-22 08:08:48 -0800 | [diff] [blame] | 62 | endif |
Andrew Delgadillo | 9c740a5 | 2021-02-02 21:56:11 +0000 | [diff] [blame] | 63 | $(MAKE) -C progs $@ |
Andrew G. Morgan | dada271 | 2019-12-15 10:52:55 -0800 | [diff] [blame] | 64 | |
Andrew G. Morgan | 6b39555 | 2020-06-02 20:56:01 -0700 | [diff] [blame] | 65 | distcheck: |
| 66 | ./distcheck.sh |
Andrew Delgadillo | 9c740a5 | 2021-02-02 21:56:11 +0000 | [diff] [blame] | 67 | $(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. Morgan | 6b39555 | 2020-06-02 20:56:01 -0700 | [diff] [blame] | 71 | |
Andrew G. Morgan | 79e421f | 2020-09-06 17:06:54 -0700 | [diff] [blame] | 72 | morgangodoc: |
| 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. Morgan | dca9b22 | 2020-07-09 19:58:53 -0700 | [diff] [blame] | 79 | morganrelease: distcheck |
Andrew G. Morgan | 24aa318 | 2020-07-07 20:00:46 -0700 | [diff] [blame] | 80 | @echo "sign the main library tag twice: older DSA key; and newer RSA (kernel.org) key" |
Andrew G. Morgan | 83dc034 | 2018-09-15 14:49:09 -0700 | [diff] [blame] | 81 | 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. Morgan | 24aa318 | 2020-07-07 20:00:46 -0700 | [diff] [blame] | 83 | @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 Morgan | 1fe9b31 | 2020-07-03 20:36:43 -0700 | [diff] [blame] | 85 | 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 Delgadillo | 9c740a5 | 2021-02-02 21:56:11 +0000 | [diff] [blame] | 87 | $(MAKE) release |
Andrew G. Morgan | 83dc034 | 2018-09-15 14:49:09 -0700 | [diff] [blame] | 88 | @echo "sign the tar file using korg key" |
| 89 | cd .. && gpg -sba -u E2CCF3F4 libcap-$(VERSION).$(MINOR).tar |
Andrew Delgadillo | 9c740a5 | 2021-02-02 21:56:11 +0000 | [diff] [blame] | 90 | $(MAKE) morgangodoc |