summaryrefslogtreecommitdiffstats
path: root/plugins/Makefile.am
blob: 420ed059b44acabb03caf62dc5d770b59b63c8cb (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
## Process this file with automake to produce Makefile.in

VPATH = $(top_srcdir) $(top_srcdir)/plugins $(top_srcdir)/plugins/t

INCLUDES = @LDAPINCLUDE@ @PGINCLUDE@ @SSLINCLUDE@ 

libexec_PROGRAMS = check_disk check_dummy check_http check_load \
	check_mrtg check_mrtgtraf check_nwstat check_overcr check_ping \
	check_procs check_real check_smtp check_ssh check_tcp check_time \
	check_udp check_ups check_users check_vsz negate urlize \
	check_ftp check_imap check_nntp check_pop \
	@EXTRAS@

EXTRA_PROGRAMS = check_mysql check_radius check_pgsql check_snmp check_hpjd \
	check_swap check_fping check_ldap check_game check_dig \
	check_nagios check_by_ssh check_dns check_nt

EXTRA_DIST = t utils.c netutils.c popen.c getopt.h getopt.c getopt1.c snprintf.c

PLUGINHDRS = common.h config.h

BASEOBJS = utils.o
NETOBJS = netutils.o $(BASEOBJS)
NETLIBS = $(NETOBJS) $(SOCKETLIBS)

TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)

TESTS = @PLUGIN_TEST@

test:
	perl -I $(top_builddir) -I $(top_srcdir) ../test.pl

AM_INSTALL_PROGRAM_FLAGS = @INSTALL_OPTS@

##############################################################################
# the actual targets

check_ftp_SOURCES = check_tcp.c
check_imap_SOURCES = check_tcp.c
check_nntp_SOURCES = check_tcp.c
check_pop_SOURCES = check_tcp.c

check_dig_LDADD = $(BASEOBJS) popen.o
check_disk_LDADD = $(BASEOBJS) popen.o
check_dns_LDADD = $(BASEOBJS) popen.o
check_dummy_LDADD = $(BASEOBJS)
check_fping_LDADD = $(BASEOBJS) popen.o
check_game_LDADD = $(BASEOBJS)
check_http_LDADD = $(NETLIBS) $(SSLLIBS)
check_hpjd_LDADD = $(BASEOBJS) popen.o
check_ldap_LDADD = $(NETLIBS) $(LDAPLIBS)
check_load_LDADD = $(BASEOBJS) popen.o
check_mrtg_LDADD = $(BASEOBJS)
check_mrtgtraf_LDADD = $(BASEOBJS)
check_mysql_LDADD = $(BASEOBJS) $(MYSQLLIBS)
check_nagios_LDADD = $(BASEOBJS) popen.o
check_nt_LDADD = $(NETLIBS)
check_nwstat_LDADD = $(NETLIBS)
check_overcr_LDADD = $(NETLIBS)
check_pgsql_LDADD = $(BASEOBJS) $(PGLIBS)
check_ping_LDADD = $(BASEOBJS) popen.o
check_procs_LDADD = $(BASEOBJS) popen.o
check_radius_LDADD = $(BASEOBJS) $(RADIUSLIBS)
check_real_LDADD = $(NETLIBS)
check_snmp_LDADD = $(BASEOBJS) popen.o
check_smtp_LDADD = $(NETLIBS)
check_ssh_LDADD = $(NETLIBS)
check_swap_LDADD = $(BASEOBJS) popen.o
check_tcp_LDADD = $(NETLIBS) $(SSLLIBS)
check_time_LDADD = $(NETLIBS)
check_udp_LDADD = $(NETLIBS)
check_ups_LDADD = $(NETLIBS)
check_users_LDADD = $(BASEOBJS) popen.o
check_vsz_LDADD = $(BASEOBJS) popen.o
check_by_ssh_LDADD = $(BASEOBJS) popen.o
negate_LDADD = $(BASEOBJS) popen.o
urlize_LDADD = $(BASEOBJS) popen.o
check_ftp_LDADD = $(NETLIBS) $(SSLLIBS)
check_imap_LDADD = $(NETLIBS) $(SSLLIBS)
check_nntp_LDADD = $(NETLIBS) $(SSLLIBS)
check_pop_LDADD = $(NETLIBS) $(SSLLIBS)

check_dig_DEPENDENCIES = check_dig.c $(BASEOBJS) popen.o $(DEPLIBS)
check_disk_DEPENDENCIES = check_disk.c $(BASEOBJS) popen.o $(DEPLIBS)
check_dns_DEPENDENCIES = check_dns.c $(BASEOBJS) popen.o $(DEPLIBS)
check_dummy_DEPENDENCIES = check_dummy.c  $(DEPLIBS)
check_fping_DEPENDENCIES = check_fping.c $(BASEOBJS) popen.o $(DEPLIBS)
check_game_DEPENDENCIES = check_game.c  $(DEPLIBS)
check_http_DEPENDENCIES = check_http.c $(NETOBJS) $(DEPLIBS)
check_hpjd_DEPENDENCIES = check_hpjd.c $(BASEOBJS) popen.o $(DEPLIBS)
check_ldap_DEPENDENCIES = check_ldap.c $(NETOBJS) $(DEPLIBS)
check_load_DEPENDENCIES = check_load.c $(BASEOBJS) popen.o $(DEPLIBS)
check_mrtg_DEPENDENCIES = check_mrtg.c  $(DEPLIBS)
check_mrtgtraf_DEPENDENCIES = check_mrtgtraf.c  $(DEPLIBS)
check_mysql_DEPENDENCIES = check_mysql.c  $(DEPLIBS)
check_nagios_DEPENDENCIES = check_nagios.c $(BASEOBJS) popen.o $(DEPLIBS)
check_nt_DEPENDENCIES = check_nt.c $(NETOBJS) $(DEPLIBS)
check_nwstat_DEPENDENCIES = check_nwstat.c $(NETOBJS) $(DEPLIBS)
check_overcr_DEPENDENCIES = check_overcr.c $(NETOBJS) $(DEPLIBS)
check_pgsql_DEPENDENCIES = check_pgsql.c  $(DEPLIBS)
check_ping_DEPENDENCIES = check_ping.c $(BASEOBJS) popen.o $(DEPLIBS)
check_procs_DEPENDENCIES = check_procs.c $(BASEOBJS) popen.o $(DEPLIBS)
check_radius_DEPENDENCIES = check_radius.c  $(DEPLIBS)
check_real_DEPENDENCIES = check_real.c $(NETOBJS) $(DEPLIBS)
check_snmp_DEPENDENCIES = check_snmp.c $(BASEOBJS) popen.o $(DEPLIBS)
check_smtp_DEPENDENCIES = check_smtp.c $(NETOBJS) $(DEPLIBS)
check_ssh_DEPENDENCIES = check_ssh.c $(NETOBJS) $(DEPLIBS)
check_swap_DEPENDENCIES = check_swap.c $(BASEOBJS) popen.o $(DEPLIBS)
check_tcp_DEPENDENCIES = check_tcp.c $(NETOBJS) $(DEPLIBS)
check_time_DEPENDENCIES = check_time.c $(NETOBJS) $(DEPLIBS)
check_udp_DEPENDENCIES = check_udp.c $(NETOBJS) $(DEPLIBS)
check_ups_DEPENDENCIES = check_ups.c $(NETOBJS) $(DEPLIBS)
check_users_DEPENDENCIES = check_users.c $(BASEOBJS) popen.o $(DEPLIBS)
check_vsz_DEPENDENCIES = check_vsz.c $(BASEOBJS) popen.o $(DEPLIBS)
check_by_ssh_DEPENDENCIES = check_by_ssh.c $(BASEOBJS) popen.o $(DEPLIBS)
negate_DEPENDENCIES = negate.c $(BASEOBJS) popen.o $(DEPLIBS)
urlize_DEPENDENCIES = urlize.c $(BASEOBJS) popen.o $(DEPLIBS)
check_ftp_DEPENDENCIES = check_tcp.c $(NETOBJS) $(DEPLIBS)
check_imap_DEPENDENCIES = check_tcp.c $(NETOBJS) $(DEPLIBS)
check_nntp_DEPENDENCIES = check_tcp.c $(NETOBJS) $(DEPLIBS)
check_pop_DEPENDENCIES = check_tcp.c $(NETOBJS) $(DEPLIBS)

##############################################################################
# secondary dependencies

popen.o: popen.c popen.h $(PLUGINHDRS)

utils.o: utils.c utils.h $(PLUGINHDRS)

netutils.o: netutils.c netutils.h $(PLUGINHDRS)

getopt.o: getopt.c getopt.h
	$(COMPILE) -c $(srcdir)/getopt.c -o $@

getopt1.o: getopt1.c getopt.h
	$(COMPILE) -c $(srcdir)/getopt1.c -o $@

snprintf.o: snprintf.c
	$(COMPILE) @NEED_VA_LIST@ -c $? -o $@

libgetopt.a: getopt.o getopt1.o
	$(AR) -r $@ getopt.o getopt1.o

libsnprintf.a: snprintf.o
	$(AR) -r $@ snprintf.o

check_ftp check_imap check_nntp check_pop:
	ln -sf check_tcp $@