Makefile.am 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ## Process this file with automake to produce Makefile.in
  2. VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t
  3. INCLUDES = -I.. -I$(top_srcdir)/lib -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@ @SSLLIBS@
  8. EXTRA_PROGRAMS = check_dhcp check_icmp
  9. if WANT_PST3
  10. EXTRA_PROGRAMS += pst3
  11. pst3_DEPENDENCIES = pst3.c
  12. endif
  13. BASEOBJS = ../plugins/utils.o ../lib/libnagiosplug.a ../lib/libcoreutils.a
  14. NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
  15. NETLIBS = $(NETOBJS) $(SOCKETLIBS)
  16. TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
  17. TESTS = @PLUGIN_TEST@
  18. test:
  19. perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
  20. all-local: $(EXTRA_PROGRAMS)
  21. setuid_root_mode = 4550
  22. group = nagios
  23. # /* Author Coreutils team - see ACKNOWLEDGEMENTS */
  24. INSTALL_SUID = \
  25. for f in $(EXTRA_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: $(EXTRA_PROGRAMS)
  35. @$(INSTALL_SUID)
  36. install-exec-local: $(EXTRA_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 = $(NETLIBS)
  57. check_icmp_LDADD = $(SOCKETLIBS)
  58. check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
  59. check_icmp_DEPENDENCIES = check_icmp.c