1# 2# libfrr 3# 4lib_LTLIBRARIES += lib/libfrr.la 5lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version 6lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(LIBM) 7 8lib_libfrr_la_SOURCES = \ 9 lib/agg_table.c \ 10 lib/atomlist.c \ 11 lib/bfd.c \ 12 lib/buffer.c \ 13 lib/checksum.c \ 14 lib/command.c \ 15 lib/command_graph.c \ 16 lib/command_lex.l \ 17 lib/command_match.c \ 18 lib/command_parse.y \ 19 lib/csv.c \ 20 lib/debug.c \ 21 lib/defaults.c \ 22 lib/distribute.c \ 23 lib/ferr.c \ 24 lib/filter.c \ 25 lib/filter_cli.c \ 26 lib/filter_nb.c \ 27 lib/frrcu.c \ 28 lib/frrlua.c \ 29 lib/frr_pthread.c \ 30 lib/frrstr.c \ 31 lib/getopt.c \ 32 lib/getopt1.c \ 33 lib/grammar_sandbox.c \ 34 lib/graph.c \ 35 lib/hash.c \ 36 lib/hook.c \ 37 lib/id_alloc.c \ 38 lib/if.c \ 39 lib/if_rmap.c \ 40 lib/imsg-buffer.c \ 41 lib/imsg.c \ 42 lib/jhash.c \ 43 lib/json.c \ 44 lib/keychain.c \ 45 lib/lib_errors.c \ 46 lib/lib_vty.c \ 47 lib/libfrr.c \ 48 lib/linklist.c \ 49 lib/log.c \ 50 lib/log_filter.c \ 51 lib/log_vty.c \ 52 lib/md5.c \ 53 lib/memory.c \ 54 lib/mlag.c \ 55 lib/module.c \ 56 lib/mpls.c \ 57 lib/srv6.c \ 58 lib/network.c \ 59 lib/nexthop.c \ 60 lib/netns_linux.c \ 61 lib/netns_other.c \ 62 lib/nexthop_group.c \ 63 lib/northbound.c \ 64 lib/northbound_cli.c \ 65 lib/northbound_db.c \ 66 lib/ntop.c \ 67 lib/openbsd-tree.c \ 68 lib/pid_output.c \ 69 lib/plist.c \ 70 lib/prefix.c \ 71 lib/privs.c \ 72 lib/ptm_lib.c \ 73 lib/pullwr.c \ 74 lib/qobj.c \ 75 lib/ringbuf.c \ 76 lib/routemap.c \ 77 lib/routemap_cli.c \ 78 lib/routemap_northbound.c \ 79 lib/sbuf.c \ 80 lib/seqlock.c \ 81 lib/sha256.c \ 82 lib/sigevent.c \ 83 lib/skiplist.c \ 84 lib/sockopt.c \ 85 lib/sockunion.c \ 86 lib/spf_backoff.c \ 87 lib/srcdest_table.c \ 88 lib/stream.c \ 89 lib/strlcat.c \ 90 lib/strlcpy.c \ 91 lib/systemd.c \ 92 lib/table.c \ 93 lib/termtable.c \ 94 lib/thread.c \ 95 lib/typerb.c \ 96 lib/typesafe.c \ 97 lib/vector.c \ 98 lib/vrf.c \ 99 lib/vty.c \ 100 lib/wheel.c \ 101 lib/workqueue.c \ 102 lib/yang.c \ 103 lib/yang_translator.c \ 104 lib/yang_wrappers.c \ 105 lib/zclient.c \ 106 lib/zlog.c \ 107 lib/zlog_targets.c \ 108 lib/printf/printf-pos.c \ 109 lib/printf/vfprintf.c \ 110 lib/printf/glue.c \ 111 lib/routing_nb.c \ 112 lib/routing_nb_config.c \ 113 # end 114 115nodist_lib_libfrr_la_SOURCES = \ 116 yang/frr-filter.yang.c \ 117 yang/frr-interface.yang.c \ 118 yang/frr-route-map.yang.c \ 119 yang/frr-route-types.yang.c \ 120 yang/frr-vrf.yang.c \ 121 yang/frr-routing.yang.c \ 122 yang/frr-nexthop.yang.c \ 123 yang/ietf/ietf-routing-types.yang.c \ 124 yang/ietf/ietf-interfaces.yang.c \ 125 yang/frr-module-translator.yang.c \ 126 yang/frr-nexthop.yang.c \ 127 # end 128 129vtysh_scan += \ 130 lib/distribute.c \ 131 lib/filter.c \ 132 lib/filter_cli.c \ 133 lib/if.c \ 134 lib/if_rmap.c \ 135 lib/keychain.c \ 136 lib/lib_vty.c \ 137 lib/nexthop_group.c \ 138 lib/plist.c \ 139 lib/routemap.c \ 140 lib/routemap_cli.c \ 141 lib/vrf.c \ 142 lib/vty.c \ 143 # end 144# can be loaded as DSO - always include for vtysh 145vtysh_scan += lib/agentx.c 146 147if SQLITE3 148lib_libfrr_la_LIBADD += $(SQLITE3_LIBS) 149lib_libfrr_la_SOURCES += lib/db.c 150endif 151 152clippy_scan += \ 153 lib/if.c \ 154 lib/filter_cli.c \ 155 lib/log_vty.c \ 156 lib/nexthop_group.c \ 157 lib/northbound_cli.c \ 158 lib/plist.c \ 159 lib/routemap_cli.c \ 160 lib/vty.c \ 161 # end 162 163pkginclude_HEADERS += \ 164 lib/agg_table.h \ 165 lib/atomlist.h \ 166 lib/bfd.h \ 167 lib/bitfield.h \ 168 lib/buffer.h \ 169 lib/checksum.h \ 170 lib/mlag.h \ 171 lib/command.h \ 172 lib/command_graph.h \ 173 lib/command_match.h \ 174 lib/compiler.h \ 175 lib/csv.h \ 176 lib/db.h \ 177 lib/debug.h \ 178 lib/defaults.h \ 179 lib/distribute.h \ 180 lib/ferr.h \ 181 lib/filter.h \ 182 lib/freebsd-queue.h \ 183 lib/frrlua.h \ 184 lib/frr_pthread.h \ 185 lib/frratomic.h \ 186 lib/frrcu.h \ 187 lib/frrstr.h \ 188 lib/getopt.h \ 189 lib/graph.h \ 190 lib/hash.h \ 191 lib/hook.h \ 192 lib/iana_afi.h \ 193 lib/id_alloc.h \ 194 lib/if.h \ 195 lib/if_rmap.h \ 196 lib/imsg.h \ 197 lib/ipaddr.h \ 198 lib/jhash.h \ 199 lib/json.h \ 200 lib/keychain.h \ 201 lib/lib_errors.h \ 202 lib/lib_vty.h \ 203 lib/libfrr.h \ 204 lib/libospf.h \ 205 lib/linklist.h \ 206 lib/log.h \ 207 lib/log_vty.h \ 208 lib/md5.h \ 209 lib/memory.h \ 210 lib/module.h \ 211 lib/monotime.h \ 212 lib/mpls.h \ 213 lib/srv6.h \ 214 lib/network.h \ 215 lib/nexthop.h \ 216 lib/nexthop_group.h \ 217 lib/nexthop_group_private.h \ 218 lib/northbound.h \ 219 lib/northbound_cli.h \ 220 lib/northbound_db.h \ 221 lib/ns.h \ 222 lib/openbsd-queue.h \ 223 lib/openbsd-tree.h \ 224 lib/plist.h \ 225 lib/prefix.h \ 226 lib/printfrr.h \ 227 lib/privs.h \ 228 lib/ptm_lib.h \ 229 lib/pullwr.h \ 230 lib/pw.h \ 231 lib/qobj.h \ 232 lib/queue.h \ 233 lib/ringbuf.h \ 234 lib/routemap.h \ 235 lib/sbuf.h \ 236 lib/seqlock.h \ 237 lib/sha256.h \ 238 lib/sigevent.h \ 239 lib/skiplist.h \ 240 lib/smux.h \ 241 lib/sockopt.h \ 242 lib/sockunion.h \ 243 lib/spf_backoff.h \ 244 lib/srcdest_table.h \ 245 lib/srte.h \ 246 lib/stream.h \ 247 lib/systemd.h \ 248 lib/table.h \ 249 lib/termtable.h \ 250 lib/thread.h \ 251 lib/typerb.h \ 252 lib/typesafe.h \ 253 lib/vector.h \ 254 lib/vlan.h \ 255 lib/vrf.h \ 256 lib/vrf_int.h \ 257 lib/vty.h \ 258 lib/vxlan.h \ 259 lib/wheel.h \ 260 lib/workqueue.h \ 261 lib/yang.h \ 262 lib/yang_translator.h \ 263 lib/yang_wrappers.h \ 264 lib/zassert.h \ 265 lib/zclient.h \ 266 lib/zebra.h \ 267 lib/zlog.h \ 268 lib/zlog_targets.h \ 269 lib/pbr.h \ 270 lib/routing_nb.h \ 271 # end 272 273 274nodist_pkginclude_HEADERS += \ 275 lib/route_types.h \ 276 lib/version.h \ 277 # end 278 279noinst_HEADERS += \ 280 lib/clippy.h \ 281 lib/plist_int.h \ 282 lib/printf/printfcommon.h \ 283 lib/printf/printflocal.h \ 284 #end 285 286# General note about module and module helper library (libfrrsnmp, libfrrzmq) 287# linking: If we're linking libfrr statically into daemons, we *must* remove 288# libfrr from modules because modules will always link it in dynamically and 289# thus 2 copies of libfrr will be loaded... hilarity ensues. 290# 291# Not linking libfrr into modules should generally work fine because the 292# executable refers to libfrr either way and the dynamic linker should make 293# libfrr available to modules. If some OS platform has a dynamic linker that 294# doesn't do that, libfrr needs to be readded to modules, but _only_ _if_ 295# it's not linked into daemons statically. 296 297# 298# SNMP support 299# 300if SNMP 301lib_LTLIBRARIES += lib/libfrrsnmp.la 302endif 303 304lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99 305lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0 306lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS) 307lib_libfrrsnmp_la_SOURCES = \ 308 lib/agentx.c \ 309 lib/snmp.c \ 310 # end 311 312# 313# c-ares support 314# 315if CARES 316lib_LTLIBRARIES += lib/libfrrcares.la 317pkginclude_HEADERS += lib/resolver.h 318endif 319 320lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS) 321lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0 322lib_libfrrcares_la_LIBADD = $(CARES_LIBS) 323lib_libfrrcares_la_SOURCES = \ 324 lib/resolver.c \ 325 #end 326 327# 328# ZeroMQ support 329# 330if ZEROMQ 331lib_LTLIBRARIES += lib/libfrrzmq.la 332pkginclude_HEADERS += lib/frr_zmq.h 333endif 334 335lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS) 336lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0 337lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS) 338lib_libfrrzmq_la_SOURCES = \ 339 lib/frr_zmq.c \ 340 #end 341 342# 343# Tail-f's ConfD support 344# 345if CONFD 346module_LTLIBRARIES += lib/confd.la 347endif 348 349lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS) 350lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic 351lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS) 352lib_confd_la_SOURCES = lib/northbound_confd.c 353 354# 355# Sysrepo support 356# 357if SYSREPO 358module_LTLIBRARIES += lib/sysrepo.la 359endif 360 361lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS) 362lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic 363lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS) 364lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c 365 366# 367# gRPC northbound plugin 368# 369if GRPC 370module_LTLIBRARIES += lib/grpc.la 371endif 372 373lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS) 374lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic 375lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS) 376lib_grpc_la_SOURCES = lib/northbound_grpc.cpp 377 378# 379# CLI utilities 380# 381noinst_PROGRAMS += \ 382 lib/grammar_sandbox \ 383 # end 384 385if BUILD_CLIPPY 386noinst_PROGRAMS += lib/clippy 387else 388if HOSTTOOLS_CLIPPY 389$(CLIPPY): 390 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy 391endif 392endif 393 394lib_grammar_sandbox_SOURCES = \ 395 lib/grammar_sandbox_main.c 396lib_grammar_sandbox_LDADD = \ 397 lib/libfrr.la 398 399lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY 400lib_clippy_CFLAGS = $(PYTHON_CFLAGS) 401lib_clippy_LDADD = $(PYTHON_LIBS) 402lib_clippy_LDFLAGS = -export-dynamic 403lib_clippy_SOURCES = \ 404 lib/clippy.c \ 405 lib/command_graph.c \ 406 lib/command_lex.l \ 407 lib/command_parse.y \ 408 lib/command_py.c \ 409 lib/defun_lex.l \ 410 lib/graph.c \ 411 lib/memory.c \ 412 lib/vector.c \ 413 # end 414 415# (global) clippy rules for all directories 416 417AM_V_CLIPPY = $(am__v_CLIPPY_$(V)) 418am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY)) 419am__v_CLIPPY_0 = @echo " CLIPPY " $@; 420am__v_CLIPPY_1 = 421 422CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py 423 424SUFFIXES += _clippy.c 425.c_clippy.c: 426 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $< 427 428## automake's "ylwrap" is a great piece of GNU software... not. 429.l.c: 430 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $< 431.y.c: 432 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $< 433 434# 435# generated sources & extra foo 436# 437EXTRA_DIST += \ 438 lib/command_lex.h \ 439 lib/command_parse.h \ 440 lib/gitversion.pl \ 441 lib/route_types.pl \ 442 lib/route_types.txt \ 443 # end 444 445BUILT_SOURCES += \ 446 lib/gitversion.h \ 447 lib/route_types.h \ 448 # end 449 450## force route_types.h 451$(lib_clippy_OBJECTS): lib/route_types.h 452$(lib_libfrr_la_OBJECTS): lib/route_types.h 453 454AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@ 455 456lib/command_lex.h: lib/command_lex.c 457 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi 458 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi 459lib/command_lex.lo: lib/command_parse.h 460lib/command_parse.lo: lib/command_lex.h 461lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h 462lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h 463lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h 464lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h 465 466lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl 467 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@ 468DISTCLEANFILES += lib/route_types.h 469 470if GIT_VERSION 471# bit of a trick here to always have up-to-date git stamps without triggering 472# unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always, 473# but if we use that on gitversion.h it'll ripple through the .c file deps. 474# (even if gitversion.h's file timestamp doesn't change, make will think it 475# did, because of .PHONY...) 476 477PHONY_GITVERSION=lib/gitversion.h.tmp 478.SILENT: lib/gitversion.h lib/gitversion.h.tmp 479GITH=lib/gitversion.h 480lib/gitversion.h.tmp: $(top_srcdir)/.git 481 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp 482lib/gitversion.h: lib/gitversion.h.tmp 483 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH} 484 485else 486PHONY_GITVERSION=lib/gitversion.h 487lib/gitversion.h: 488 true 489endif 490.PHONY: $(PHONY_GITVERSION) 491