Debian Codegraph @

utils/cap-audit/Makefile.am

raw
1 # Makefile.am -- cap-audit utility
2 #
3 # Copyright 2026 Red Hat Inc.
4 # All Rights Reserved.
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # Authors:
17 # Steve Grubb <[email protected]>
18 #
19
20 AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/src ${LIBBPF_CFLAGS} ${LIBAUDIT_CFLAGS}
21 AM_CFLAGS = -W -Wall -Wshadow ${WFLAGS} -Wundef -D_GNU_SOURCE
22
23 bin_PROGRAMS = cap-audit
24 cap_audit_SOURCES = cap_audit.c \
25 cap_audit_analyze.c \
26 cap_audit_event.c \
27 cap_audit_json.c \
28 cap_audit_util.c \
29 cap_audit_yaml.c \
30 cap_audit.h
31 nodist_cap_audit_SOURCES = cap_audit.skel.h
32 cap_audit_LDADD = ${top_builddir}/src/libcap-ng.la ${LIBBPF_LIBS} ${LIBAUDIT_LIBS}
33
34 EXTRA_DIST = cap_audit.bpf.c cap-audit.8
35 CLEANFILES = cap_audit.bpf.o cap_audit.skel.h vmlinux.h
36
37 if BUILD_CAP_AUDIT
38 BUILT_SOURCES = cap_audit.bpf.o cap_audit.skel.h vmlinux.h
39 endif
40
41 cap_audit.$(OBJEXT) cap_audit_analyze.$(OBJEXT) \
42 cap_audit_event.$(OBJEXT) cap_audit_json.$(OBJEXT) \
43 cap_audit_util.$(OBJEXT) cap_audit_yaml.$(OBJEXT): cap_audit.skel.h
44
45 BPF_ARCH = @BPF_ARCH@
46 BPFTOOL = @BPFTOOL@
47 CLANG = @CLANG@
48
49 BPF_CFLAGS = -g -O2 -target bpf -D__TARGET_ARCH_${BPF_ARCH} ${AM_CPPFLAGS}
50
51 cap_audit.skel.h: cap_audit.bpf.o
52 $(AM_V_GEN)$(BPFTOOL) gen skeleton $< > $@
53
54 cap_audit.bpf.o: cap_audit.bpf.c vmlinux.h
55 $(AM_V_CC)$(CLANG) $(BPF_CFLAGS) -c $< -o $@
56
57 vmlinux.h:
58 $(AM_V_GEN)$(BPFTOOL) btf dump file /sys/kernel/btf/vmlinux format c > $@
59
60 man_MANS = cap-audit.8