File: Makefile.am

package info (click to toggle)
zabbix 1%3A4.0.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 83,104 kB
  • sloc: php: 162,280; ansic: 154,778; sql: 96,479; sh: 5,281; makefile: 1,340; java: 1,068; cpp: 227; perl: 41; xml: 29
file content (115 lines) | stat: -rw-r--r-- 2,560 bytes parent folder | download | duplicates (2)
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
## Process this file with automake to produce Makefile.in

DIST_SUBDIRS = \
	libs \
	zabbix_agent \
	zabbix_get \
	zabbix_sender \
	zabbix_proxy \
	zabbix_server \
	zabbix_java

if AGENT
COMMON_SUBDIRS = libs
else
if SERVER
COMMON_SUBDIRS = libs
else
if PROXY
COMMON_SUBDIRS = libs
endif
endif
endif

if AGENT
AGENT_SUBDIRS = \
	zabbix_agent \
	zabbix_get \
	zabbix_sender
endif

if SERVER
SERVER_SUBDIRS = \
	zabbix_server
endif

if PROXY
if SERVER
PROXY_SUBDIRS = \
	zabbix_proxy
else

PROXY_SUBDIRS = \
	zabbix_server/dbsyncer \
	zabbix_server/dbconfig \
	zabbix_server/discoverer \
	zabbix_server/httppoller \
	zabbix_server/pinger \
	zabbix_server/poller \
	zabbix_server/trapper \
	zabbix_server/selfmon \
	zabbix_server/snmptrapper \
	zabbix_server/vmware \
	zabbix_server/ipmi \
	zabbix_server/odbc \
	zabbix_server/scripts \
	zabbix_proxy
	
endif
endif

if JAVA
JAVA_SUBDIRS = \
	zabbix_java
endif

SUBDIRS = \
	$(COMMON_SUBDIRS) \
	$(AGENT_SUBDIRS) \
	$(SERVER_SUBDIRS) \
	$(PROXY_SUBDIRS) \
	$(JAVA_SUBDIRS)

## "dist-hook" run after the distribution directory is filled, but before the actual tar (or shar) file is created.
dist-hook:
	mkdir $(distdir)/modules
	mkdir $(distdir)/modules/dummy
	cp $(srcdir)/modules/dummy/*.c $(distdir)/modules/dummy/
	cp $(srcdir)/modules/dummy/Makefile $(distdir)/modules/dummy/
	cp $(srcdir)/modules/dummy/README $(distdir)/modules/dummy/

## CUnit test support
TEST_COMMENT = "embedded unit tests - remove before commit"
TEST_LIBDIR = libs/zbxcunit
TEST_SUITESFILE = $(TEST_LIBDIR)/cu_modules.h
TEST_SRCFILES = `find . -name "*.c" | while read fn; do if grep -q $(TEST_COMMENT) $${fn}; then echo $${fn}; fi; done`
TEST_TESTFILES = `find . -name "*_test.c"`
TEST_DECLARE = "ZBX_CU_DECLARE" 

$(TEST_SUITESFILE):
	echo 'const char *cu_modules[]={' > $(TEST_SUITESFILE)
	for file in $(TEST_TESTFILES); do								\
		if [ -f "$${file%_test.c}.c" ]; then							\
			echo "#include \"$${file##*/}\" //$(TEST_COMMENT)" >> "$${file%_test.c}.c"	;\
			grep $(TEST_DECLARE) $${file} | while read line; do				\
				funcname=$${line##*(}							;\
				echo "\"$${funcname%%)*}\"," >> $(TEST_SUITESFILE)			;\
			done										;\
		fi											;\
	done
	echo 'NULL};' >> $(TEST_SUITESFILE)

test: $(TEST_SUITESFILE) 
	$(MAKE) $(AM_MAKEFLAGS) CFLAGS="$(CFLAGS) -rdynamic -DZBX_CUNIT" CUNIT_LDADD="-lcunit"

clean-test:
	rm -rf $(TEST_SUITESFILE)
	for file in $(TEST_SRCFILES); do				\
		cat $$file | sed /$(TEST_COMMENT)/d > $$file.new;	\
		mv $$file.new $$file;					\
	done
 
clean-local: clean-test

.PHONY: test clean-test