-
-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathMakefile.am
155 lines (122 loc) · 3.32 KB
/
Makefile.am
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
149
150
151
152
153
154
155
### Include common Makefile configuration
#
include $(top_srcdir)/build/Makefile.am.common
### Local configuration changes
#
AUTOMAKE_OPTIONS = foreign subdir-objects
ACLOCAL_AMFLAGS = -I build/m4
### Subdir processing order
#
# Process etc/ before other subdirs
#
# If Snoopy has config file enabled, then there is a small time frame
# between installation of library and subsequent installation of
# initial configuration file where ini parsing library emits an error about
# configuration file not being found. Therefore we first install
# configuration file and only then the Snoopy library itself.
#
# Also, lib/ must be processed before src/, as ini parsing library is needed
# there if config file is enabled.
#
SUBDIRS =
if CONFIGFILE_ENABLED
SUBDIRS += etc
endif
SUBDIRS += lib
SUBDIRS += src
SUBDIRS += doc
SUBDIRS += tests
### Additional files to distribute in distribution package
#
EXTRA_DIST = \
dev-tools/libexec/get-release-version.sh \
README.md
### Make check aliases
#
checks: check
test: check
tests: check
### Enable/disable targets
#
enable: install
$(sbindir)/snoopyctl enable
# We need to run a local instance of `snoopyctl`, as `make uninstall` first
# removes the installed `snoopyctl` instance before running the `uninstall-local` target.
disable:
./src/cli/snoopyctl disable
# Disable it if we are uninstalling it, to avoid error messages
# about missing library that should be preloaded.
uninstall-local: disable
### Clean these files additionally
#
# Clean release files
clean-local-this-dir:
rm -f config.h.in~ ; \
rm -f config.log ; \
rm -f configure~ ; \
rm -rf snoopy-[0-9].[0-9].* ; \
rm -f snoopy-*.tar.gz* ; \
rm -f snoopy-latest-*.txt ; \
rm -rf cov-int* ; \
rm -rf sonarcloud-build-wrapper-output ; \
rm -rf sonar-cfamily.reproducer ; \
rm -rf .scannerwork ; \
rm -rf packaging/deb/.debhelper ; \
rm -f packaging/deb/autoreconf.after ; \
rm -f packaging/deb/autoreconf.before ; \
rm -f packaging/deb/debhelper-build-stamp ; \
rm -f packaging/deb/files ; \
rm -f packaging/deb/snoopy.debhelper.log ; \
rm -f packaging/deb/snoopy.postrm.debhelper ; \
rm -f packaging/deb/snoopy.substvars ; \
rm -rf packaging/deb/snoopy ; \
rm -f ../snoopy_*_*.buildinfo ; \
rm -f ../snoopy_*_*.changes ; \
rm -f ../snoopy_*_*.deb ; \
rm -f ../snoopy-dbgsym_*_*.ddeb ; \
rm -rf packaging/rpmbuild ; \
rm -f snoopy-*.pkg.tar.zst ; \
true
# Clean all files that were generated by bootstrap.sh, autoscan, packaging etc.
# (anything that is not in git repository must go away)
gitclean: maintainer-clean
rm -f aclocal.m4 ; \
rm -fr autom4te.cache ; \
rm -f autoscan.log ; \
rm -fr build/aux/ ; \
rm -fr build/m4/ ; \
rm -f config.h.in ; \
rm -f configure ; \
rm -f debian ; \
rm -f packaging/deb/changelog ; \
rm -f PKGBUILD ; \
true
### Maintainer targets
#
#
# Bootstrap: simplify maintainer's life
#
.PHONY: bootstrap
bootstrap: maintainer-clean
./bootstrap.sh
#
#
# Valgrind: run valgrind
#
.PHONY: valgrind
valgrind: all
valgrind -v \
--error-exitcode=1 \
--track-fds=yes \
--smc-check=all \
--leak-check=full \
--undef-value-errors=yes \
--track-origins=yes \
./tests/bin/snoopy-test run everything ;
### Code coverage
#
if CODE_COVERAGE_ENABLED
coverage-report:
./dev-tools/libexec/generate-gcov-reports.sh
coverage: coverage-clean check coverage-report
endif