]> git.proxmox.com Git - mirror_frr.git/blame - Makefile.am
*: remaining zassert => assert
[mirror_frr.git] / Makefile.am
CommitLineData
718e3744 1## Process this file with automake to produce Makefile.in.
2
4a121f99 3AUTOMAKE_OPTIONS = subdir-objects 1.12
7c2275ac 4ACLOCAL_AMFLAGS = -I m4 -Wall,no-override
4a121f99 5
aad24c5b 6AM_CFLAGS = \
0c4285d7 7 $(AC_CFLAGS) \
fdbd8086
DL
8 $(LIBYANG_CFLAGS) \
9 $(SQLITE3_CFLAGS) \
68b8a15f 10 $(UNWIND_CFLAGS) \
dbac691d
DL
11 $(SAN_FLAGS) \
12 $(WERROR) \
13 # end
aad24c5b 14AM_CPPFLAGS = \
aad24c5b 15 -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/lib \
09781197 16 -I$(top_builddir) \
5dbb0a7b
QY
17 $(LUA_INCLUDE) \
18 # end
4007e3ad 19AM_LDFLAGS = \
dbac691d 20 -export-dynamic \
d6e76257 21 $(AC_LDFLAGS) \
dbac691d
DL
22 $(SAN_FLAGS) \
23 # end
62d21cc6 24DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DCONFDATE=$(CONFDATE)
4a121f99 25
105a8189
DL
26AR_FLAGS = @AR_FLAGS@
27ARFLAGS = @ARFLAGS@
28RANLIB = @RANLIB@
29
b8dd5f9d
DL
30# these two targets are provided to easily grab autoconf/Makefile variables
31# you can use either:
32# eval `make VARFD=3 shvar-CFLAGS 3>&1 1>&2`
33# CFLAGS="`make VARFD=3 var-CFLAGS 3>&1 1>&2`"
34# where the former can be used to set several variables at once. Note the
35# fd redirections -- this is to prevent garbage from make rebuilding other
36# targets from causing issues.
37.PHONY: shvar-% var-%
38VARFD ?= 1
39shvar-%:
40 @echo "$*=\"$($*)\"" >&$(VARFD)
41var-%:
42 @echo "$($*)" >&$(VARFD)
43
a71c5039
DL
44if ONLY_CLIPPY
45.DEFAULT_GOAL := clippy-only
46endif
47clippy-only: Makefile lib/clippy config.h
48.PHONY: clippy-only
49
892d21b1
DL
50# overwriting these vars breaks cross-compilation. let's be helpful and warn.
51#
52# note: "#AUTODERP# " will be removed from Makefile by configure. These are
53# GNU make directives & automake will f*ck them up by trying to process them
54# as automake directives.
55#
56#AUTODERP# null=
57#AUTODERP# SPACE=$(null) $(null)
58#AUTODERP# mkcheck_CC = $(findstring $(SPACE)CC=, $(SPACE)$(MAKEOVERRIDES))
59#AUTODERP# mkcheck_CFLAGS = $(findstring $(SPACE)CFLAGS=, $(SPACE)$(MAKEOVERRIDES))
60#AUTODERP# mkcheck_CPPFLAGS = $(findstring $(SPACE)CPPFLAGS=,$(SPACE)$(MAKEOVERRIDES))
61#AUTODERP# mkcheck_CCLD = $(findstring $(SPACE)CCLD=, $(SPACE)$(MAKEOVERRIDES))
62#AUTODERP# mkcheck_LD = $(findstring $(SPACE)LD=, $(SPACE)$(MAKEOVERRIDES))
63#AUTODERP# mkcheck_LDFLAGS = $(findstring $(SPACE)LDFLAGS=, $(SPACE)$(MAKEOVERRIDES))
64#AUTODERP# #
65#AUTODERP# ifneq ($(mkcheck_CC),)
66#AUTODERP# $(warning WARNING: you have overwritten the "CC" variable on the make command line.)
67#AUTODERP# endif
68#AUTODERP# ifneq ($(mkcheck_CFLAGS),)
69#AUTODERP# $(warning WARNING: you have overwritten the "CFLAGS" variable on the make command line.)
70#AUTODERP# endif
71#AUTODERP# ifneq ($(mkcheck_CPPFLAGS),)
72#AUTODERP# $(warning WARNING: you have overwritten the "CPPFLAGS" variable on the make command line.)
73#AUTODERP# endif
74#AUTODERP# ifneq ($(mkcheck_CCLD),)
75#AUTODERP# $(warning WARNING: you have overwritten the "CCLD" variable on the make command line.)
76#AUTODERP# endif
77#AUTODERP# ifneq ($(mkcheck_LD),)
78#AUTODERP# $(warning WARNING: you have overwritten the "LD" variable on the make command line.)
79#AUTODERP# endif
80#AUTODERP# ifneq ($(mkcheck_LDFLAGS),)
81#AUTODERP# $(warning WARNING: you have overwritten the "LDFLAGS" variable on the make command line.)
82#AUTODERP# endif
83#AUTODERP# #
84#AUTODERP# ifneq ($(mkcheck_CC)$(mkcheck_CFLAGS)$(mkcheck_CPPFLAGS)$(mkcheck_CCLD)$(mkcheck_LD)$(mkcheck_LDFLAGS),)
85#AUTODERP# $(warning ------)
86#AUTODERP# $(warning While overwriting these variables works most of the time, it is not recommended and can cause confusing build errors.)
87#AUTODERP# $(warning This is especially problematic when cross-compiling, since tools that run on the build system during the build process will not be compiled correctly.)
88#AUTODERP# $(warning All of these variables should be supplied to 'configure', and they will be remembered and correctly applied during 'make'.)
89#AUTODERP# $(warning ------)
90#AUTODERP# endif
91
4a121f99 92EXTRA_DIST =
0045c130 93EXTRA_PROGRAMS =
4a121f99 94BUILT_SOURCES =
0f8b5fd5 95CLEANFILES =
67cf020d 96DISTCLEANFILES =
8fb40377 97SUFFIXES =
4a121f99 98
64d44794
DL
99examplesdir = $(exampledir)
100
4a121f99
DL
101bin_PROGRAMS =
102sbin_PROGRAMS =
bd354725 103sbin_SCRIPTS =
4a121f99
DL
104noinst_PROGRAMS =
105noinst_HEADERS =
106noinst_LIBRARIES =
9e53b315 107nodist_noinst_DATA =
4a121f99 108lib_LTLIBRARIES =
64d44794 109module_LTLIBRARIES =
4a121f99 110pkginclude_HEADERS =
70d27c5b 111nodist_pkginclude_HEADERS =
64d44794 112dist_examples_DATA =
1c2facd1 113dist_yangmodels_DATA =
9e53b315 114man_MANS =
74dc19a2 115vtysh_scan =
d7b86ae4 116vtysh_daemons =
94cfb069 117clippy_scan =
4a121f99 118
6a35bfba
DL
119## libtool, the self-made GNU scourge
120## ... this should fix relinking
121## ... and AUTOMAKE_DUMMY is needed to prevent automake from treating this
122## as overriding the normal targets...
123$(AUTOMAKE_DUMMY)install-moduleLTLIBRARIES: install-libLTLIBRARIES
124$(AUTOMAKE_DUMMY)install-binPROGRAMS: install-libLTLIBRARIES
125$(AUTOMAKE_DUMMY)install-sbinPROGRAMS: install-libLTLIBRARIES
126
9e53b315
DL
127include doc/subdir.am
128include doc/user/subdir.am
129include doc/manpages/subdir.am
130include doc/developer/subdir.am
ba777396 131include include/subdir.am
4a121f99 132include lib/subdir.am
67fa73f2 133include mlag/subdir.am
64d44794 134include zebra/subdir.am
bd354725 135include watchfrr/subdir.am
0f8b5fd5
DL
136include qpb/subdir.am
137include fpm/subdir.am
ec2ac5f2 138include grpc/subdir.am
bd354725 139include tools/subdir.am
4a121f99 140
84d837b7
DL
141include bgpd/subdir.am
142include bgpd/rfp-example/librfp/subdir.am
143include bgpd/rfp-example/rfptest/subdir.am
7f269117
DL
144include ripd/subdir.am
145include ripngd/subdir.am
afca0690
DL
146include ospfd/subdir.am
147include ospf6d/subdir.am
148include ospfclient/subdir.am
86e463cf 149include isisd/subdir.am
cde8cd9d 150include nhrpd/subdir.am
30237d29 151include ldpd/subdir.am
b6f5781c
DL
152include babeld/subdir.am
153include eigrpd/subdir.am
8a71d93d 154include sharpd/subdir.am
35a3c3c1 155include pimd/subdir.am
e5c83d9b 156include pbrd/subdir.am
7e24fdf3 157include staticd/subdir.am
7134904b 158include bfdd/subdir.am
1c2facd1
RW
159include yang/subdir.am
160include yang/libyang_plugins/subdir.am
5435a2bf 161include vrrpd/subdir.am
74971473
JG
162include pceplib/subdir.am
163include pceplib/test/subdir.am
4d7b695d 164include pathd/subdir.am
7f269117 165
8b7668ec 166include vtysh/subdir.am
a1286a32 167include tests/subdir.am
ff37641b 168include tests/topotests/subdir.am
718e3744 169
53d93be1
DL
170if PKGSRC
171rcdir=@pkgsrcrcdir@
172rc_SCRIPTS = \
173 pkgsrc/bgpd.sh \
174 pkgsrc/ospf6d.sh \
175 pkgsrc/ospfd.sh \
176 pkgsrc/ripd.sh \
177 pkgsrc/ripngd.sh \
178 pkgsrc/zebra.sh \
179 # end
180endif
181
182EXTRA_DIST += \
53d93be1 183 aclocal.m4 \
d85cb6b6 184 README.md \
53d93be1 185 m4/README.txt \
d6e76257 186 m4/libtool-whole-archive.patch \
06871ed9 187 config.version \
439be082
QY
188 changelog-auto \
189 changelog-auto.in \
53d93be1
DL
190 \
191 python/clidef.py \
192 python/clippy/__init__.py \
36a8fdfd
DL
193 python/clippy/elf.py \
194 python/clippy/uidhash.py \
879a9dc5 195 python/makevars.py \
94cfb069 196 python/makefile.py \
36a8fdfd
DL
197 python/tiabwarfo.py \
198 python/xrelfo.py \
199 python/test_xrelfo.py \
200 python/runtests.py \
201 \
202 python/xrefstructs.json \
53d93be1 203 \
53d93be1
DL
204 redhat/frr.logrotate \
205 redhat/frr.pam \
206 redhat/frr.spec \
53d93be1
DL
207 \
208 snapcraft/snapcraft.yaml \
209 snapcraft/README.snap_build.md \
210 snapcraft/README.usage.md \
211 snapcraft/extra_version_info.txt \
212 snapcraft/scripts \
213 snapcraft/defaults \
214 snapcraft/helpers \
215 snapcraft/snap \
f8948c1e
DL
216 babeld/Makefile \
217 bgpd/Makefile \
218 bgpd/rfp-example/librfp/Makefile \
219 bgpd/rfp-example/rfptest/Makefile \
9e53b315
DL
220 doc/Makefile \
221 doc/developer/Makefile \
222 doc/manpages/Makefile \
223 doc/user/Makefile \
f8948c1e
DL
224 eigrpd/Makefile \
225 fpm/Makefile \
ec2ac5f2 226 grpc/Makefile \
f8948c1e
DL
227 isisd/Makefile \
228 ldpd/Makefile \
229 lib/Makefile \
230 nhrpd/Makefile \
231 ospf6d/Makefile \
232 ospfclient/Makefile \
233 ospfd/Makefile \
234 pbrd/Makefile \
235 pimd/Makefile \
f8948c1e
DL
236 qpb/Makefile \
237 ripd/Makefile \
238 ripngd/Makefile \
239 staticd/Makefile \
240 tests/Makefile \
241 tools/Makefile \
242 vtysh/Makefile \
243 watchfrr/Makefile \
244 zebra/Makefile \
5435a2bf 245 vrrpd/Makefile \
53d93be1 246 # end
0fc42949 247
8fb40377
DL
248AM_V_LLVM_BC = $(am__v_LLVM_BC_$(V))
249am__v_LLVM_BC_ = $(am__v_LLVM_BC_$(AM_DEFAULT_VERBOSITY))
250am__v_LLVM_BC_0 = @echo " LLVM.BC " $@;
251am__v_LLVM_BC_1 =
252
253AM_V_LLVM_LD = $(am__v_LLVM_LD_$(V))
254am__v_LLVM_LD_ = $(am__v_LLVM_LD_$(AM_DEFAULT_VERBOSITY))
255am__v_LLVM_LD_0 = @echo " LLVM.LD " $@;
256am__v_LLVM_LD_1 =
257
258SUFFIXES += .lo.bc .o.bc
259
260.o.o.bc:
261 $(AM_V_LLVM_BC)$(COMPILE) -emit-llvm -c -o $@ $(patsubst %.o,%.c,$<)
262.lo.lo.bc:
263 $(AM_V_LLVM_BC)$(COMPILE) -emit-llvm -c -o $@ $(patsubst %.lo,%.c,$<)
264
265%.cg.json: %.bc tools/frr-llvm-cg
266 tools/frr-llvm-cg -o $@ $<
3d62176b
DL
267%.cg.dot: %.cg.json
268 $(PYTHON) $(top_srcdir)/python/callgraph-dot.py $< $@
269%.cg.svg: %.cg.dot
270 @echo if the following command fails, you need to install graphviz.
271 @echo also, the output is nondeterministic. run it multiple times and use the nicest output.
272 @echo tuning parameters may yield nicer looking graphs as well.
273 fdp -GK=0.7 -Gstart=42231337 -Gmaxiter=2000 -Elen=2 -Gnodesep=1.5 -Tsvg -o$@ $<
274# don't delete intermediaries
275.PRECIOUS: %.cg.json %.cg.dot
8fb40377
DL
276
277# <lib>.la.bc, <lib>.a.bc and <daemon>.bc targets are generated by
278# python/makefile.py
279LLVM_LINK = llvm-link-$(llvm_version)
280
281clean-local: clean-python clean-llvm-bitcode
282.PHONY: clean-python clean-llvm-bitcode
67cf020d 283clean-python:
dbd10c03
RK
284 find . -name __pycache__ -o -name .pytest_cache | xargs rm -rf
285 find . -name "*.pyc" -o -name "*_clippy.c" | xargs rm -f
67cf020d 286
8fb40377 287clean-llvm-bitcode:
3d62176b 288 find . -name "*.bc" -o -name "*.cg.json" -o -name "*.cg.dot" -o -name "*.cg.svg" | xargs rm -f
8fb40377 289
0b9013e4
DL
290redistclean:
291 $(MAKE) distclean CONFIG_CLEAN_FILES="$(filter-out $(EXTRA_DIST), $(CONFIG_CLEAN_FILES))"
292
da5a0d00
LB
293indent:
294 tools/indent.py `find sharpd bgpd eigrpd include isisd lib nhrpd ospf6d ospfd pimd qpb ripd vtysh zebra -name '*.[ch]' | grep -v include/linux`
83284209
AJ
295
296if HAVE_GCOV
297
298coverage: check
299 @ find . -name '*.o' -exec gcov {} \;
300
301yorn:
302 @ echo "OK to upload coverage to https://coverage.io [y/N]:"
303 @ read yn; test "$$yn" = "y"
304
305upload-check-coverage:
306 @ if [ "x${COMMIT}" = "x" ]; then echo "COMMIT required"; exit 1; fi
307 @ if [ "x${TOKEN}" = "x" ]; then echo "TOKEN required"; exit 1; fi
308 curl -s https://codecov.io/bash | bash -s - -C ${COMMIT} -t ${TOKEN}
309
310force-check-coverage: coverage upload-check-coverage
311
312check-coverage: coverage yorn upload-check-coverage
313
314endif