Makefile.am 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. libexec_PROGRAMS = check_dhcp check_icmp @EXTRAS_ROOT@
  9. EXTRA_PROGRAMS = pst3
  10. EXTRA_DIST = pst3.c
  11. BASEOBJS = ../plugins/utils.o ../lib/libnagiosplug.a ../lib/libcoreutils.a
  12. NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
  13. NETLIBS = $(NETOBJS) $(SOCKETLIBS)
  14. TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
  15. TESTS = @PLUGIN_TEST@
  16. test:
  17. perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
  18. setuid_root_mode = 4550
  19. group = nagios
  20. # /* Author Coreutils team - see ACKNOWLEDGEMENTS */
  21. INSTALL_SUID = \
  22. for f in $(EXTRA_PROGRAMS) ; do \
  23. p=$$f; \
  24. echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
  25. $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
  26. echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
  27. chown root $(DESTDIR)$(libexecdir)/$$p; \
  28. echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
  29. chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
  30. done
  31. install-root: $(EXTRA_PROGRAMS)
  32. @$(INSTALL_SUID)
  33. install-exec-local: $(EXTRA_PROGRAMS)
  34. @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
  35. rm -f $$TMPFILE; \
  36. echo > $$TMPFILE; \
  37. ## See if we can create a setuid root executable in $(libexecdir).
  38. ## If not, then don't even try to install setuid plugins.
  39. can_create_suid_root_executable=no; \
  40. chown root $$TMPFILE > /dev/null 2>&1 \
  41. && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
  42. && can_create_suid_root_executable=yes; \
  43. rm -f $$TMPFILE; \
  44. if test $$can_create_suid_root_executable = yes; then \
  45. $(INSTALL_SUID); \
  46. else \
  47. echo "WARNING: insufficient access; not installing setuid plugins"; \
  48. echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
  49. fi
  50. # /* Author Coreutils team sub-citation */
  51. ##############################################################################
  52. # the actual targets
  53. check_dhcp_LDADD = $(NETLIBS)
  54. check_icmp_LDADD = $(SOCKETLIBS)
  55. pst3_LDADD = -lkvm
  56. check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
  57. check_icmp_DEPENDENCIES = check_icmp.c