Makefile.am 2.7 KB

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