summaryrefslogtreecommitdiffstats
path: root/common.am
blob: 0ccc4c9fd153984c578b0788de20c217f5df11e0 (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
#
# Automake fragment intended to be shared by Makefile.am files in the
# tree.
#

AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
am__v_CLIPPY_0 = @echo "  CLIPPY  " $@;
am__v_CLIPPY_1 =

SUFFIXES = _clippy.c
.c_clippy.c:
	$(AM_V_at)$(MAKE) -C $(top_builddir)/$(CLIPPYDIR) clippy
	$(AM_V_CLIPPY)$(top_builddir)/$(CLIPPYDIR)/clippy $(top_srcdir)/python/clidef.py $< > $@.tmp
	@{ test -f $@ && diff $@.tmp $@ >/dev/null 2>/dev/null; } && rm $@.tmp || mv $@.tmp $@

if HAVE_PROTOBUF

# Uncomment to use an non-system version of libprotobuf-c.
#
# Q_PROTOBUF_C_CLIENT_INCLUDES = -I$(top_srcdir)/third-party/protobuf-c/src
# Q_PROTOBUF_C_CLIENT_LDOPTS = $(top_builddir)/third-party/protobuf-c/src/libprotobuf-c.la

Q_PROTOBUF_C_CLIENT_INCLUDES=
Q_PROTOBUF_C_CLIENT_LDOPTS=-lprotobuf-c

Q_PROTOC=protoc
Q_PROTOC_C=protoc-c

Q_PROTOBUF_CFILES = $(filter %.pb-c.c,$(SOURCES))

Q_PROTOBUF_SRCS = $(Q_PROTOBUF_CFILES) $(Q_PROTOBUF_HFILES)

# Rules
%.pb.h: %.proto
	$(Q_PROTOC) $(PROTOBUF_INCLUDES) --cpp_out=$(top_srcdir) $(top_srcdir)/$(PROTOBUF_PACKAGE)/$^

%.pb-c.c %.pb-c.h: %.proto
	$(Q_PROTOC_C) $(PROTOBUF_INCLUDES) --c_out=$(top_srcdir) $(top_srcdir)/$(PROTOBUF_PACKAGE)/$^

#
# Information about how to link to various libraries.
#
Q_FRR_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libfrr_pb.la $(Q_PROTOBUF_C_CLIENT_LDOPTS)

Q_FPM_PB_CLIENT_LDOPTS = $(top_srcdir)/fpm/libfrrfpm_pb.la $(Q_FRR_PB_CLIENT_LDOPTS)

endif  # HAVE_PROTOBUF

Q_CLEANFILES = $(Q_PROTOBUF_SRCS)

Q_BUILT_SRCS = $(Q_PROTOBUF_SRCS)