4
0

Makefile.am 2.7 KB

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