Debian Codegraph @

staprun/Makefile.am

raw
1 # Makefile.am --- automake input file for systemtap runtime tools
2
3 AUTOMAKE_OPTIONS = subdir-objects
4
5 AM_CFLAGS = -Wall -Wextra -Wunused -W -Wformat=2
6 AM_CXXFLAGS = -Wall -Wextra -Wunused -W -Wformat=2
7 if Werror
8 AM_CFLAGS += -Werror
9 AM_CXXFLAGS += -Werror
10 endif
11 AM_CPPFLAGS = -D_GNU_SOURCE
12 AM_CPPFLAGS += -I$(srcdir)/../includes
13 AM_CPPFLAGS += -I$(builddir)/../includes/sys
14 AM_CPPFLAGS += -DBINDIR='"$(bindir)"' -DSYSCONFDIR='"$(sysconfdir)"' -DPKGDATADIR='"${pkgdatadir}"' -DPKGLIBDIR='"$(pkglibexecdir)"' -DLOCALEDIR='"$(localedir)"'
15
16 AM_CFLAGS += @PIECFLAGS@
17 AM_CXXFLAGS += @PIECXXFLAGS@
18 AM_LDFLAGS = @PIELDFLAGS@
19
20 bin_PROGRAMS = staprun stap-merge stapsh
21 pkglibexec_PROGRAMS = stapio
22
23 # Tighten -Wno-format-nonliteral to just where it's needed.
24 # See the automake manual secton: "Per-Object Flags Emulation"
25 # https://www.gnu.org/software/automake/manual/html_node/Per_002dObject-Flags.html
26 noinst_LIBRARIES = libstrfloctime.a
27 libstrfloctime_a_SOURCES = strfloctime.c
28 libstrfloctime_a_CFLAGS = $(AM_CFLAGS) -Wno-format-nonliteral
29
30 staprun_SOURCES = staprun.c staprun_funcs.c ctl.c common.c start_cmd.c \
31 ../privilege.cxx ../staputil.cxx
32 staprun_CFLAGS = $(AM_CFLAGS) -DSINGLE_THREADED $(debuginfod_CFLAGS)
33 staprun_CXXFLAGS = $(AM_CXXFLAGS) -DSINGLE_THREADED $(debuginfod_CFLAGS)
34 staprun_CPPFLAGS = $(AM_CPPFLAGS)
35 staprun_LDADD = libstrfloctime.a $(staprun_LIBS) $(debuginfod_LIBS)
36 staprun_LDFLAGS = $(AM_LDFLAGS) -Wl,--whole-archive,libstrfloctime.a,--no-whole-archive $(debuginfod_LDFLAGS)
37
38 if HAVE_NSS
39 staprun_SOURCES += modverify.c ../nsscommon.cxx
40 staprun_CFLAGS += $(nss_CFLAGS)
41 staprun_CXXFLAGS += $(nss_CFLAGS)
42 staprun_LDADD += $(nss_LIBS)
43 endif
44
45 if HAVE_HTTP_SUPPORT
46 staprun_LDADD += $(openssl_LIBS)
47 endif
48
49 stapio_SOURCES = stapio.c mainloop.c common.c start_cmd.c ctl.c relay.c monitor.c
50 stapio_LDADD = libstrfloctime.a -lpthread
51 stapio_LDFLAGS = -Wl,--whole-archive,libstrfloctime.a,--no-whole-archive
52
53 if HAVE_MONITOR_LIBS
54 stapio_LDADD += $(jsonc_LIBS) -lpanel $(ncurses_LIBS)
55 endif
56
57 man_MANS = staprun.8
58
59 stap_merge_SOURCES = stap_merge.c
60 stap_merge_CFLAGS = $(AM_CFLAGS)
61 stap_merge_LDFLAGS = $(AM_LDFLAGS)
62 stap_merge_LDADD =
63
64 stapsh_SOURCES = stapsh.c
65 stapsh_CFLAGS = $(AM_CFLAGS)
66 stapsh_LDFLAGS = $(AM_LDFLAGS)
67 stapsh_LDADD =
68
69 BUILT_SOURCES =
70 CLEANFILES =
71
72 # Arrange for the top-level git_version.h to be regenerated at every "make".
73 BUILT_SOURCES += git_version.stamp
74 git_version.stamp ../git_version.h:
75 $(MAKE) -C .. $(notdir $@)
76
77
78 # Why the "id -u" condition? This way, an unprivileged user can run
79 # make install, and have "sudo stap ...." or "sudo staprun ...." work later.
80 install-exec-hook:
81 if [ `id -u` -eq 0 ] && (getent group stapusr >/dev/null \
82 || groupadd -f -g 156 -r stapusr); then \
83 chgrp stapusr "$(DESTDIR)$(bindir)/staprun" \
84 && chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \
85 fi