Makefile.am 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ## Process this file with automake to produce Makefile.in
  2. VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir)
  3. INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@
  4. datadir = @datadir@
  5. localedir = $(datadir)/locale
  6. DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
  7. LIBS = @LIBINTL@ @LIBS@
  8. noinst_PROGRAMS = check_dhcp check_icmp @EXTRAS_ROOT@
  9. EXTRA_PROGRAMS = pst3
  10. EXTRA_DIST = pst3.c
  11. BASEOBJS = ../plugins/utils.o ../lib/libnagiosplug.a ../gl/libgnu.a
  12. NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
  13. NETLIBS = $(NETOBJS) $(SOCKETLIBS)
  14. TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
  15. TESTS = @PLUGIN_TEST@
  16. test:
  17. perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
  18. setuid_root_mode = ug=rx,u+s
  19. # /* Author Coreutils team - see ACKNOWLEDGEMENTS */
  20. INSTALL_SUID = \
  21. for f in $(noinst_PROGRAMS) ; do \
  22. p=$$f; \
  23. echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
  24. $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
  25. echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
  26. chown root $(DESTDIR)$(libexecdir)/$$p; \
  27. echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
  28. chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
  29. done
  30. install-root: $(noinst_PROGRAMS)
  31. @$(INSTALL_SUID)
  32. install-exec-local: $(noinst_PROGRAMS)
  33. @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
  34. rm -f $$TMPFILE; \
  35. echo > $$TMPFILE; \
  36. ## See if we can create a setuid root executable in $(libexecdir).
  37. ## If not, then don't even try to install setuid plugins.
  38. can_create_suid_root_executable=no; \
  39. chown root $$TMPFILE > /dev/null 2>&1 \
  40. && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
  41. && can_create_suid_root_executable=yes; \
  42. rm -f $$TMPFILE; \
  43. if test $$can_create_suid_root_executable = yes; then \
  44. $(INSTALL_SUID); \
  45. else \
  46. echo "WARNING: insufficient access; not installing setuid plugins"; \
  47. echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
  48. fi
  49. # /* Author Coreutils team sub-citation */
  50. ##############################################################################
  51. # the actual targets
  52. check_dhcp_LDADD = $(NETLIBS)
  53. check_icmp_LDADD = $(NETLIBS) $(SOCKETLIBS)
  54. pst3_CFLAGS = @PST3CFLAGS@
  55. pst3_LDADD = -lkvm
  56. check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
  57. check_icmp_DEPENDENCIES = check_icmp.c $(NETOBJS)