Debian Codegraph @

Makefile

raw ◀ ▶
1 Debian patch touch this file
1 #
2 # Makefile for libcap
3 #
4 topdir=$(shell pwd)
5 include Make.Rules
6
7 #
8 # flags
9 #
10
11 all test sudotest install clean: %: %-here
12 $(MAKE) -C libcap $@
13 ifneq ($(PAM_CAP),no)
14 $(MAKE) -C pam_cap $@
15 endif
16 ifeq ($(GOLANG),yes)
17 $(MAKE) -C go $@
18 rm -f cap/go.sum
19 endif
20 $(MAKE) -C tests $@
21 $(MAKE) -C progs $@
22 $(MAKE) -C doc $@
23
24 all-here:
25
26 test-here:
27
28 sudotest-here:
29
30 install-here:
31
32 clean-here:
33 $(LOCALCLEAN)
34
35 gomods-update:
36 ./gomods.sh v$(GOMAJOR).$(VERSION).$(MINOR)
37
38 distclean: clean
39 $(DISTCLEAN)
40 @echo "CONFIRM Go package cap has right version dependency on cap/psx:"
41 for x in $$(find . -name go.mod); do $(BUILD_FGREP) -v "module" $$x | $(BUILD_FGREP) "kernel.org/pub/linux/libs/security/libcap" > /dev/null || continue ; $(BUILD_FGREP) "v$(GOMAJOR).$(VERSION).$(MINOR)" $$x > /dev/null && continue ; echo "$$x is not updated. Try running: make gomods-update" ; exit 1 ; done
42 @echo "ALL go.mod files updated"
43 @echo "Confirm headers export current version"
44 $(BUILD_FGREP) "#define LIBCAP_MAJOR $(VERSION)" libcap/include/sys/capability.h
45 $(BUILD_FGREP) "#define LIBCAP_MINOR $(MINOR)" libcap/include/sys/capability.h
46 $(BUILD_FGREP) "#define LIBPSX_MAJOR $(VERSION)" psx/psx_syscall.h
47 $(BUILD_FGREP) "#define LIBPSX_MINOR $(MINOR)" psx/psx_syscall.h
48 @echo "Now validate that everything is checked in to a clean tree.."
•49 test -z "$$(test -x /usr/bin/git && git status --ignored -s)"
50 @echo "All good!"
51
52 release: distclean
53 cd .. && ln -s libcap libcap-$(VERSION).$(MINOR) && tar cvf libcap-$(VERSION).$(MINOR).tar --exclude patches libcap-$(VERSION).$(MINOR)/* && rm libcap-$(VERSION).$(MINOR)
54
55 ktest: all
56 $(MAKE) -C kdebug test
57
58 distcheck: distclean
59 ./distcheck.sh
60 $(MAKE) DYNAMIC=no COPTS="-D_FORTIFY_SOURCE=2 -O1 -g" clean test
61 $(MAKE) DYNAMIC=yes clean all test sudotest
62 $(MAKE) DYNAMIC=no COPTS="-O2 -std=c89" clean all test sudotest
63 $(MAKE) PAM_CAP=no CC=musl-gcc clean all test sudotest
64 $(MAKE) CC=clang clean all test sudotest
65 $(MAKE) clean all test sudotest
66 $(MAKE) distclean
67
68 morgangodoc:
69 @echo "Now the release is made, you may want to hurry go.dev up by"
70 @echo "pressing the request button on this page:"
71 @echo
72 @echo " https://pkg.go.dev/kernel.org/pub/linux/libs/security/libcap/cap@v$(GOMAJOR).$(VERSION).$(MINOR)"
73 @echo
74 @echo "This will cause a go.dev documentation update more quickly."
75
76 morganrelease: distcheck
77 @echo "sign the main library tag three times: legacy DSA key; newer RSA (kernel.org automation) key; official ed25519 key"
78 git tag -u 0D23D34C577B08C4082CFD76430C5CFF993116B1 -s sig-libcap-$(VERSION).$(MINOR) -m "official tag for libcap-$(VERSION).$(MINOR)"
79 git tag -u AF7402BC38CC10E6885C1FCA421784ABD41A6DF2 -s libcap-$(VERSION).$(MINOR) -m "legacy tag for libcap-$(VERSION).$(MINOR)"
80 git tag -u 38A644698C69787344E954CE29EE848AE2CCF3F4 -s libcap-korg-$(VERSION).$(MINOR) -m "kernel.org automation tag for libcap-$(VERSION).$(MINOR)"
81 @echo "The following are for the Go module tracking (the stylized tag names have semantic meaning)."
82 git tag -u 0D23D34C577B08C4082CFD76430C5CFF993116B1 -s v$(GOMAJOR).$(VERSION).$(MINOR) -m "version tag for the 'libcap' Go base directory associated with libcap-$(VERSION).$(MINOR)"
83 git tag -u 0D23D34C577B08C4082CFD76430C5CFF993116B1 -s psx/v$(GOMAJOR).$(VERSION).$(MINOR) -m "stable version tag for the 'psx' Go package associated with libcap-$(VERSION).$(MINOR)"
84 git tag -u 0D23D34C577B08C4082CFD76430C5CFF993116B1 -s cap/v$(GOMAJOR).$(VERSION).$(MINOR) -m "stable version tag for the 'cap' Go package associated with libcap-$(VERSION).$(MINOR)"
85 $(MAKE) release
86 @echo "sign the tar file using korg key - so it can be uploaded to kernel.org"
87 cd .. && gpg -sba -u 38A644698C69787344E954CE29EE848AE2CCF3F4 libcap-$(VERSION).$(MINOR).tar
88 $(MAKE) morgangodoc