1 ## Process this file with automake to produce Makefile.in
3 if RELEASE_PRESENT
4 NP_VERSION = @NP_RELEASE@
5 else
6 NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
7 @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
8 .FORCE-NP-VERSION-FILE:
9 -include NP-VERSION-FILE
10 endif
12 AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"'
14 VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir)
16 AM_CPPFLAGS = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@
18 localedir = $(datadir)/locale
19 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
20 # Don't add LTLIBINTL to all, as pst3 doesn't need it
21 #LIBS = @LTLIBINTL@ @LIBS@
23 noinst_PROGRAMS = check_dhcp check_icmp @EXTRAS_ROOT@
25 EXTRA_PROGRAMS = pst3
27 EXTRA_DIST = pst3.c
29 BASEOBJS = ../plugins/utils.o ../lib/libnagiosplug.a ../gl/libgnu.a
30 NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
31 NETLIBS = $(NETOBJS) $(SOCKETLIBS)
33 TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
35 TESTS = @PLUGIN_TEST@
37 test:
38 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
40 setuid_root_mode = ug=rx,u+s
42 # /* Author Coreutils team - see ACKNOWLEDGEMENTS */
44 INSTALL_SUID = \
45 for f in $(noinst_PROGRAMS) ; do \
46 p=$$f; \
47 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
48 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
49 echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
50 chown root $(DESTDIR)$(libexecdir)/$$p; \
51 echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
52 chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
53 done
55 install-root: $(noinst_PROGRAMS)
56 @$(INSTALL_SUID)
58 install-exec-local: $(noinst_PROGRAMS)
59 @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
60 rm -f $$TMPFILE; \
61 echo > $$TMPFILE; \
62 ## See if we can create a setuid root executable in $(libexecdir).
63 ## If not, then don't even try to install setuid plugins.
64 can_create_suid_root_executable=no; \
65 chown root $$TMPFILE > /dev/null 2>&1 \
66 && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
67 && can_create_suid_root_executable=yes; \
68 rm -f $$TMPFILE; \
69 if test $$can_create_suid_root_executable = yes; then \
70 $(INSTALL_SUID); \
71 else \
72 echo "WARNING: insufficient access; not installing setuid plugins"; \
73 echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
74 fi
76 # /* Author Coreutils team sub-citation */
78 ##############################################################################
79 # the actual targets
80 check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS)
81 check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS)
83 # -m64 needed at compiler and linker phase
84 pst3_CFLAGS = @PST3CFLAGS@
85 pst3_LDFLAGS = @PST3CFLAGS@
86 # pst3 must not use nagiosplug/gnulib includes!
87 pst3_CPPFLAGS =
89 check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
90 check_icmp_DEPENDENCIES = check_icmp.c $(NETOBJS)
92 clean-local:
93 rm -f NP-VERSION-FILE