c121 nrpe-2.12 # vim Makefile(研究)

gentoo nrpe-2.12 # echo $0
-bash
gentoo nrpe-2.12 # echo $SHELL
/bin/bash

rm -rf */*           //删除目录下所有文件,保留当前的位置下的所有文件和目录.

$(命令) 返回该命令的结果

 

 ./configure --prefix=/etc/nagios =========>Makefile.in生成Makefile

c121 #ls 

nrpe-2.12  nrpe-2.12.tar.gz

c121 #tar  xf  nrpe-2.12.tar.gz

c121 nrpe-2.12 # ls
Changelog    config.sub   docs    init-script.debian.in   install-sh    nrpe.spec    SECURITY    update-version
config.guess   configure   include   init-script.in   LEGAL    README   src
config.log   configure.in    init-script    init-script.suse    Makefile    README.SSL   subst
config.status contrib   init-script.debian   init-script.suse.in   Makefile.in   sample-config    subst.in

c121 nrpe-2.12 # vim Makefile

###############################
# Makefile for NRPE
#
# Last Modified: 03-14-2007
###############################

# Source code directories
SRC_BASE=./src/

eg:c121 nrpe-2.12 # ls ./src/

check_nrpe.c Makefile Makefile.in nrpe.c snprintf.c utils.c

SRC_INCLUDE=./include/

eg:c121 nrpe-2.12 # ls ./include/

common.h config.h config.h.in dh.h nrpe.h utils.h

CC=gcc
CFLAGS=-g -O2 -I/usr/include/openssl -I/usr/include -DHAVE_CONFIG_H
LDFLAGS= -L/usr/lib64 -lssl -lcrypto

prefix=/etc/nagios/
exec_prefix=${prefix}       //--prefix=/etc/nagios
CFGDIR=${prefix}/etc
BINDIR=${exec_prefix}/bin
SBINDIR=${exec_prefix}/sbin
LIBEXECDIR=${exec_prefix}/libexec
INSTALL=/usr/bin/install -c            ///usr/bin/install --help   ==> -c      (ignored)
NAGIOS_INSTALL_OPTS=-o nagios -g nagios
NRPE_INSTALL_OPTS=-o nagios -g nagios

INIT_DIR=@init_dir@
INIT_OPTS=-o root -g root


all:
cd $(SRC_BASE); $(MAKE) ; cd ..

@echo ""
@echo "*** Compile finished ***"
@echo ""
@echo "If the NRPE daemon and client compiled without any errors, you"
@echo "can continue with the installation or upgrade process."
@echo ""

@echo "Read the PDF documentation (NRPE.pdf) for information on the next"
@echo "steps you should take to complete the installation or upgrade."
@echo ""
nrpe:
cd $(SRC_BASE); $(MAKE) ; cd ..

check_nrpe:
cd $(SRC_BASE); $(MAKE) ; cd ..


install-plugin:
cd $(SRC_BASE) && $(MAKE) $@

install-daemon:
cd $(SRC_BASE) && $(MAKE) $@

install:
cd $(SRC_BASE) && $(MAKE) $@

install-xinetd:
$(INSTALL) -m 644 sample-config/nrpe.xinetd /etc/xinetd.d/nrpe

install-daemon-config:
$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)

eg:/usr/bin/install -c    -m 775 $(-o nagios -g nagios)  -d $(DESTDIR)$(/etc/nagios/etc)
$(INSTALL) -m 644 $(NRPE_INSTALL_OPTS) sample-config/nrpe.cfg $(DESTDIR)$(CFGDIR)

clean:
cd $(SRC_BASE); $(MAKE) $@ ; cd ..
rm -f core
rm -f *~ */*~

distclean: clean
cd $(SRC_BASE); $(MAKE) $@ ; cd ..
rm -f config.log config.status config.cache nrpe.cfg nrpe.xinetd subst $(SRC_INCLUDE)/config.h init-script init-script.debian init-script.freebsd init-script.suse
rm -f sample-config/*.cfg sample-config/*.xinetd
rm -f Makefile


devclean: distclean

posted @ 2015-07-19 18:12  arun_yh  阅读(152)  评论(0编辑  收藏  举报