summaryrefslogtreecommitdiffstats
path: root/src/Makefile.in
blob: 090d98b73ddd2b57d9a0db97991461b1f0c58d44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
###############################
#
#  NRPE Makefile
#
###############################

srcdir=@srcdir@

# Source code directories
SRC_INCLUDE=@srcdir@/../include
CFG_INCLUDE=../include

# Mainly used for rpmbuild
# DESTDIR=

CC=@CC@
CFLAGS=@CFLAGS@ @DEFS@ -I $(CFG_INCLUDE) -I $(SRC_INCLUDE)
LDFLAGS=@LDFLAGS@ @LIBS@
SOCKETLIBS=@SOCKETLIBS@
LIBWRAPLIBS=@LIBWRAPLIBS@
OTHERLIBS=@OTHERLIBS@

CP=@CP@

prefix=$(DESTDIR)@prefix@
exec_prefix=$(DESTDIR)@exec_prefix@
CFGDIR=$(DESTDIR)@pkgsysconfdir@
BINDIR=$(DESTDIR)@bindir@
SBINDIR=$(DESTDIR)@sbindir@
LIBEXECDIR=$(DESTDIR)@libexecdir@
INSTALL=@INSTALL@
NAGIOS_INSTALL_OPTS=@NAGIOS_INSTALL_OPTS@
NRPE_INSTALL_OPTS=@NRPE_INSTALL_OPTS@

PLUGINSDIR=$(DESTDIR)@pluginsdir@
PIDDIR=$(DESTDIR)@piddir@
TMPFILESDIR=$(DESTDIR)@tmpfilesd@
SRC_TMPFILE=@src_tmpfile@


# Generated automatically from configure script
SNPRINTF_O=@SNPRINTF_O@


all: nrpe check_nrpe

nrpe: $(srcdir)/nrpe.c $(srcdir)/utils.c $(srcdir)/acl.c $(SRC_INCLUDE)/nrpe.h $(SRC_INCLUDE)/utils.h $(CFG_INCLUDE)/common.h $(CFG_INCLUDE)/config.h $(SRC_INCLUDE)/acl.h $(SNPRINTF_O)
	$(CC) $(CFLAGS) -o $@ $(srcdir)/nrpe.c $(srcdir)/utils.c $(srcdir)/acl.c $(LDFLAGS) $(SOCKETLIBS) $(LIBWRAPLIBS) $(SNPRINTF_O) $(OTHERLIBS)

check_nrpe: $(srcdir)/check_nrpe.c $(srcdir)/utils.c $(SRC_INCLUDE)/utils.h $(CFG_INCLUDE)/common.h $(CFG_INCLUDE)/config.h
	$(CC) $(CFLAGS) -o $@ $(srcdir)/check_nrpe.c $(srcdir)/utils.c $(LDFLAGS) $(SOCKETLIBS) $(SNPRINTF_O) $(OTHERLIBS)

install:
	$(MAKE) install-plugin
	$(MAKE) install-daemon

install-plugin: install-uninstall
	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(LIBEXECDIR)
	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(PLUGINSDIR)
	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) check_nrpe $(PLUGINSDIR)

install-daemon: install-uninstall
	$(INSTALL) -m 755 nrpe $(SBINDIR)
	@if test ! -d "$(PIDDIR)" ; then \
		echo $(INSTALL) -m 755 $(NRPE_INSTALL_OPTS) -d $(PIDDIR); \
		$(INSTALL) -m 755 $(NRPE_INSTALL_OPTS) -d $(PIDDIR); \
	fi
	@if test "$(TMPFILESDIR)" != "N/A" -a x$(SRC_TMPFILE) != x ; then \
		echo $(INSTALL) -m 755 -d `dirname $(TMPFILESDIR)`; \
		$(INSTALL) -m 755 -d `dirname $(TMPFILESDIR)`; \
		echo $(INSTALL) -m 644 ../startup/$(SRC_TMPFILE) $(TMPFILESDIR); \
		$(INSTALL) -m 644 ../startup/$(SRC_TMPFILE) $(TMPFILESDIR); \
	fi

install-uninstall:
	$(INSTALL) -m 755 -d $(SBINDIR)
	$(INSTALL) -m 755 ../uninstall $(SBINDIR)/nrpe-uninstall

clean:
	rm -f core nrpe check_nrpe $(SNPRINTF_O)
	rm -f *~ */*~
	rm -rf nrpe.dSYM check_nrpe.dSYM

distclean: clean
	rm -f Makefile

devclean: distclean