Makefile.in 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ###############################
  2. # Makefile for NRPE
  3. #
  4. # Last Modified: 03-14-2007
  5. ###############################
  6. # Source code directories
  7. SRC_BASE=./src/
  8. SRC_INCLUDE=./include/
  9. CC=@CC@
  10. CFLAGS=@CFLAGS@ @DEFS@
  11. LDFLAGS=@LDFLAGS@ @LIBS@
  12. prefix=@prefix@
  13. exec_prefix=@exec_prefix@
  14. CFGDIR=@pkgsysconfdir@
  15. BINDIR=@bindir@
  16. SBINDIR=@sbindir@
  17. LIBEXECDIR=@libexecdir@
  18. INSTALL=@INSTALL@
  19. NAGIOS_INSTALL_OPTS=@NAGIOS_INSTALL_OPTS@
  20. NRPE_INSTALL_OPTS=@NRPE_INSTALL_OPTS@
  21. INIT_TYPE=@init_type@
  22. INIT_DIR=@initdir@
  23. INIT_OPTS=-o root -g root
  24. INIT_FILE=@initname@
  25. INETD_TYPE=@inetd_type@
  26. INETD_DIR=@inetddir@
  27. INETD_FILE=@inetdname@
  28. SRC_INETD=@src_inetd@
  29. SRC_INIT=@src_init@
  30. default:
  31. @echo
  32. @echo Please enter 'make [option]' where [option] is one of:
  33. @echo
  34. @echo " all builds nrpe and check_nrpe"
  35. @echo " nrpe builds nrpe only"
  36. @echo " check_nrpe builds check_nrpe only"
  37. @echo " install install nrpe and check_nrpe"
  38. @echo " install-plugin install the check_nrpe plugin"
  39. @echo " install-daemon install the nrpe daemon"
  40. @echo " install-config install the nrpe configuration file"
  41. @echo " install-inetd install the startup files for inetd, launchd, etc."
  42. @echo " install-init install the startup files for init, systemd, etc."
  43. @echo " solaris-package create the solaris package"
  44. @echo
  45. all:
  46. cd $(SRC_BASE); $(MAKE)
  47. @echo ""
  48. @echo "*** Compile finished ***"
  49. @echo ""
  50. @echo "If the NRPE daemon and client compiled without any errors, you"
  51. @echo "can continue with the installation or upgrade process."
  52. @echo ""
  53. @echo "Read the PDF documentation (NRPE.pdf) for information on the next"
  54. @echo "steps you should take to complete the installation or upgrade."
  55. @echo ""
  56. nrpe:
  57. cd $(SRC_BASE); $(MAKE)
  58. check_nrpe:
  59. cd $(SRC_BASE); $(MAKE)
  60. install-plugin:
  61. cd $(SRC_BASE); $(MAKE) $@
  62. install-daemon:
  63. cd $(SRC_BASE); $(MAKE) $@
  64. install:
  65. cd $(SRC_BASE); $(MAKE) $@
  66. install-inetd:
  67. @if test $(SRC_INETD) = unknown; then \
  68. echo No inetd file to install; \
  69. exit 1; \
  70. fi
  71. @if test $(INETD_TYPE) = inetd; then \
  72. grep -E -q "^\W*nrpe\s+" $(INETD_DIR)/$(INETD_FILE) || \
  73. cat startup/$(SRC_INETD) >> $(INETD_DIR)/$(INETD_FILE); \
  74. else \
  75. echo $(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE); \
  76. $(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE); \
  77. fi
  78. @grep -E -q "^nrpe[\t ]+5666/tcp" /etc/services || \
  79. echo "***** MAKE SURE 'nrpe 5666/tcp' IS IN YOUR /etc/services FILE"
  80. install-init:
  81. @if test $(SRC_INIT) = unknown; then \
  82. echo No init file to install; \
  83. exit 1; \
  84. fi
  85. $(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE)
  86. install-config:
  87. $(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(CFGDIR)
  88. $(INSTALL) -m 644 $(NRPE_INSTALL_OPTS) sample-config/nrpe.cfg $(CFGDIR)
  89. solaris-package:
  90. @if [ `uname -s` != "SunOS" ] ; then \
  91. echo "It is recommended you be running on Solaris to build a Solaris package"; \
  92. else \
  93. cd package/solaris; $(MAKE) build ; $(MAKE) pkg ; cd ../..; \
  94. fi
  95. clean:
  96. cd $(SRC_BASE); $(MAKE) $@; cd ..
  97. cd package/solaris; $(MAKE) $@; cd ../..
  98. rm -f core
  99. rm -f *~ */*~
  100. distclean: clean
  101. cd $(SRC_BASE); $(MAKE) $@; cd ..
  102. cd package/solaris; $(MAKE) $@; cd ../..
  103. rm -rf autom4te.cache
  104. rm -f config.log config.status config.cache sample-config/nrpe.cfg $(SRC_INCLUDE)/config.h
  105. rm -f startup/bsd-init startup/debian-init startup/default-init startup/default-inetd
  106. rm -f startup/default-service startup/default-xinetd startup/mac-org.nagios.PKG_NAME.plist
  107. rm -f startup/openrc-conf startup/openrc-init startup/solaris-PKG_NAME.xml
  108. rm -f Makefile
  109. devclean: distclean