207 lines
4.8 KiB
Makefile
Executable File
207 lines
4.8 KiB
Makefile
Executable File
###############################
|
|
# Makefile for PNP
|
|
#
|
|
# Last Modified: 11-13-2023
|
|
###############################
|
|
|
|
VERSION=@PACKAGE_VERSION@
|
|
|
|
# Source code directories
|
|
srcdir=@srcdir@
|
|
SRC_BASE=@srcdir@/src
|
|
SRC_SHARE=@srcdir@/share
|
|
SRC_LIB=@srcdir@/lib
|
|
SRC_SCRIPTS=@srcdir@/scripts
|
|
SRC_CONFIG=@srcdir@/sample-config
|
|
SRC_MAN=@srcdir@/man
|
|
SRC_CONTRIB=@srcdir@/contrib
|
|
SRC_HELPERS=@srcdir@/helpers
|
|
|
|
CC=@CC@
|
|
CFLAGS=@CFLAGS@ @DEFS@
|
|
LDFLAGS=@LDFLAGS@ @LIBS@
|
|
|
|
prefix=@prefix@
|
|
exec_prefix=@exec_prefix@
|
|
LOGDIR=@localstatedir@
|
|
BINDIR=@bindir@
|
|
LIBEXECDIR=@libexecdir@
|
|
KOHANA=@KOHANA@
|
|
CGIDIR=@sbindir@
|
|
INSTALL=@INSTALL@
|
|
INSTALL_OPTS=@INSTALL_OPTS@
|
|
HTTP_INSTALL_OPTS=@HTTP_INSTALL_OPTS@
|
|
DATAROOTDIR=@datarootdir@
|
|
NAGIOS_VERSION=@NAGIOS_VER@
|
|
CACHE_DIR=@CACHE_DIR@
|
|
|
|
SELINUX=@SELINUX@
|
|
SELINUX_DEVELDIR=@SELINUX_DEVELDIR@
|
|
|
|
CP=@CP@
|
|
PERL=@PERL@
|
|
|
|
.PHONY: clean rpm dist distclean devclean
|
|
|
|
none:
|
|
@echo "Please supply a command line argument (i.e. 'make all'). Other targets are:"
|
|
@echo " clean distclean dist"
|
|
@echo " install install-init install-selinux fullinstall"
|
|
|
|
all:
|
|
cd $(SRC_BASE) && $(MAKE) $@
|
|
cd $(SRC_SHARE) && $(MAKE) $@
|
|
cd $(SRC_SCRIPTS) && $(MAKE) $@
|
|
cd $(SRC_CONFIG) && $(MAKE) $@
|
|
chmod a+r $(SRC_CONTRIB)/ssi/status-header.ssi
|
|
|
|
@echo ""
|
|
@echo "*** Compile finished ***"
|
|
@echo ""
|
|
@echo " make install"
|
|
@echo " - This installs directories, binaries and php files"
|
|
@echo ""
|
|
@echo " make install-selinux"
|
|
@echo " - This installs the selinux setup (if you are using selinux)"
|
|
@echo ""
|
|
@echo ""
|
|
@echo " make fullinstall"
|
|
@echo " - install everything "
|
|
@echo ""
|
|
@echo "Enjoy."
|
|
@echo ""
|
|
|
|
# this section from autoconf doc suggestions
|
|
# reautoconf if config changed
|
|
configure: configure.ac
|
|
autoconf
|
|
|
|
# autoheader might not change config.h.in, so touch a stamp file.
|
|
include/config.h.in: include/stamp-h.in ;
|
|
include/stamp-h.in: configure.ac
|
|
autoheader
|
|
date -Is > 'include/stamp-h.in'
|
|
|
|
include/config.h: include/stamp-h ;
|
|
include/stamp-h: include/config.h.in config.status
|
|
./config.status
|
|
|
|
Makefile: Makefile.in config.status
|
|
./config.status
|
|
|
|
config.status: configure
|
|
./config.status --recheck
|
|
|
|
|
|
scripts:
|
|
cd $(SRC_SCRIPTS) && $(MAKE) $@
|
|
|
|
share:
|
|
cd $(SRC_SHARE) && $(MAKE) $@
|
|
|
|
|
|
clean:
|
|
cd $(SRC_BASE) && $(MAKE) $@
|
|
cd $(SRC_MAN) && $(MAKE) $@
|
|
cd $(SRC_SHARE) && $(MAKE) $@
|
|
cd $(SRC_LIB) && $(MAKE) $@
|
|
cd $(SRC_SCRIPTS) && $(MAKE) $@
|
|
cd $(SRC_CONFIG) && $(MAKE) $@
|
|
-rm -f *.cfg core
|
|
-rm -f *~ *.*~ */*~ */*.*~
|
|
-rm -f config.log config.status config.cache
|
|
@SE@ rm -f pnp4nagios.fc
|
|
@SE@ rm -f pnp4nagios.if pnp4nagios.pp* tmp
|
|
|
|
distclean:
|
|
cd $(SRC_BASE) && $(MAKE) $@
|
|
cd $(SRC_MAN) && $(MAKE) $@
|
|
cd $(SRC_SHARE) && $(MAKE) $@
|
|
cd $(SRC_LIB) && $(MAKE) $@
|
|
cd $(SRC_SCRIPTS) && $(MAKE) $@
|
|
cd $(SRC_CONFIG) && $(MAKE) $@
|
|
-rm -f *.cfg core
|
|
-rm -f *~ *.*~ */*~ */*.*~
|
|
-rm -f config.log config.status config.cache
|
|
rm -f Makefile include/stamp-h1 include/config.h config.status config.log
|
|
rm -f subst summary
|
|
rm -f $(SRC_CONTRIB)/ssi/status-header.ssi
|
|
rm -f $(SRC_CONTRIB)/fedora/pnp4nagios.logrotate.conf
|
|
rm -f $(SRC_CONTRIB)/fedora/logwatch/conf/logfiles/pnp4nagios.conf
|
|
@SE@ rm -f pnp4nagios.fc pnp4nagios.if pnp4nagios.pp* tmp
|
|
|
|
devclean: distclean
|
|
|
|
|
|
install-init:
|
|
cd $(SRC_SCRIPTS) && $(MAKE) $@
|
|
|
|
|
|
install:
|
|
cd $(SRC_BASE) && $(MAKE) $@
|
|
cd $(SRC_MAN) && $(MAKE) $@
|
|
cd $(SRC_SHARE) && $(MAKE) $@
|
|
if [ x$(KOHANA) = xyes ]; then \
|
|
cd $(SRC_LIB) && $(MAKE) $@; \
|
|
fi
|
|
cd $(SRC_SCRIPTS) && $(MAKE) $@
|
|
cd $(SRC_CONFIG) && $(MAKE) $@
|
|
$(INSTALL) $(HTTP_INSTALL_OPTS) -d $(DESTDIR)$(CACHE_DIR)
|
|
@echo ""
|
|
@echo "*** Main program, Scripts and HTML files installed ***"
|
|
@echo ""
|
|
@echo ""
|
|
@echo ""
|
|
|
|
# Nagios might have some pnp4nagios selinux entries
|
|
# so mask out duplicates.
|
|
|
|
install-selinux:
|
|
@SE@ -rm nagios.pp
|
|
@SE@ -semodule -E nagios 2>/dev/null >/dev/null
|
|
@SE@ if [ -e nagios.pp ] ; then \
|
|
@SE@ semodule_unpackage nagios.pp nagios.mod nagios.fc ; \
|
|
@SE@ for pnpdir in /etc/pnp4nagios /var/log/pnp4nagios /var/lib/pnp4nagios /usr/lib/pnp4nagios ; \
|
|
@SE@ do \
|
|
@SE@ if grep -q "^$pnpdir" nagios.fc ; \
|
|
@SE@ then \
|
|
@SE@ sed -i "\\|^$pnpdir|s/^/#/" pnp4nagios.fc ; \
|
|
@SE@ fi \
|
|
@SE@ done \
|
|
@SE@ fi
|
|
@SE@ $(MAKE) -f $(SELINUX_DEVELDIR)/Makefile load
|
|
@SE@ fixfiles restore @datadir@ @pkgsysconfdir@
|
|
@SE@ fixfiles restore @PERFDATA_DIR@ @logdir@
|
|
@SE@ fixfiles restore @PERFDATA_SPOOL_DIR@ @piddir@
|
|
|
|
|
|
install-unstripped:
|
|
cd $(SRC_BASE) && $(MAKE) $@
|
|
cd $(SRC_SHARE) && $(MAKE) $@
|
|
cd $(SRC_SCRIPTS) && $(MAKE) $@
|
|
$(MAKE) install-basic
|
|
|
|
|
|
fullinstall:
|
|
$(MAKE) install
|
|
$(MAKE) install-selinux
|
|
$(PERL) summary fullinstall
|
|
@echo ""
|
|
@echo "*** Main program, Scripts and HTML files installed ***"
|
|
@echo "Config files in: @pkgsysconfdir@ might need updating."
|
|
@echo ""
|
|
@echo ""
|
|
@echo "Enjoy."
|
|
@echo ""
|
|
|
|
|
|
dist:
|
|
ci/maketar.sh $(VERSION)
|
|
mv ci/pnp4nagios*.tgz .
|
|
mv ci/pnp4nagios*.zip .
|
|
|
|
|
|
|
|
|
|
|