1 ## Process this file with automake to produce Makefile.in
3 VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t
5 INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@
7 datadir = @datadir@
8 localedir = $(datadir)/locale
9 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
10 LIBS = @LIBINTL@ @LIBS@ @SSLLIBS@
12 EXTRA_PROGRAMS = check_dhcp check_icmp
14 if WANT_PST3
15 EXTRA_PROGRAMS += pst3
16 pst3_DEPENDENCIES = pst3.c
17 endif
19 BASEOBJS = ../plugins/utils.o ../lib/libnagiosplug.a ../lib/libcoreutils.a
20 NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
21 NETLIBS = $(NETOBJS) $(SOCKETLIBS)
23 TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
25 TESTS = @PLUGIN_TEST@
27 test:
28 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
30 all-local: $(EXTRA_PROGRAMS)
32 setuid_root_mode = 4550
34 group = nagios
36 # /* Author Coreutils team - see ACKNOWLEDGEMENTS */
38 INSTALL_SUID = \
39 for f in $(EXTRA_PROGRAMS) ; do \
40 p=$$f; \
41 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
42 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
43 echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
44 chown root $(DESTDIR)$(libexecdir)/$$p; \
45 echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
46 chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
47 done
49 install-root: $(EXTRA_PROGRAMS)
50 @$(INSTALL_SUID)
52 install-exec-local: $(EXTRA_PROGRAMS)
53 @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
54 rm -f $$TMPFILE; \
55 echo > $$TMPFILE; \
56 ## See if we can create a setuid root executable in $(libexecdir).
57 ## If not, then don't even try to install setuid plugins.
58 can_create_suid_root_executable=no; \
59 chown root $$TMPFILE > /dev/null 2>&1 \
60 && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
61 && can_create_suid_root_executable=yes; \
62 rm -f $$TMPFILE; \
63 if test $$can_create_suid_root_executable = yes; then \
64 $(INSTALL_SUID); \
65 else \
66 echo "WARNING: insufficient access; not installing setuid plugins"; \
67 echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
68 fi
70 # /* Author Coreutils team sub-citation */
72 ##############################################################################
73 # the actual targets
74 check_dhcp_LDADD = $(NETLIBS)
75 check_icmp_LDADD = $(SOCKETLIBS)
77 check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
78 check_icmp_DEPENDENCIES = check_icmp.c