Makefile.am 2.9 KB

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