Makefile.am 2.7 KB

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