blob: ac7a3230daacc1af54290adc118310b05cf576dc [file] [log] [blame]
Avneesh Sachdev07e5b642016-04-04 10:54:55 -07001#
2# Automake fragment intended to be shared by Makefile.am files in the
3# tree.
4#
5
6if HAVE_PROTOBUF
7
8# Uncomment to use an non-system version of libprotobuf-c.
9#
10# Q_PROTOBUF_C_CLIENT_INCLUDES = -I$(top_srcdir)/third-party/protobuf-c/src
11# Q_PROTOBUF_C_CLIENT_LDOPTS = $(top_builddir)/third-party/protobuf-c/src/libprotobuf-c.la
12
13Q_PROTOBUF_C_CLIENT_INCLUDES=
14Q_PROTOBUF_C_CLIENT_LDOPTS=-lprotobuf-c
15
16Q_PROTOC=protoc
17Q_PROTOC_C=protoc-c
18
19Q_PROTOBUF_CFILES = $(filter %.pb-c.c,$(SOURCES))
20
21Q_PROTOBUF_SRCS = $(Q_PROTOBUF_CFILES) $(Q_PROTOBUF_HFILES)
22
23# Rules
24%.pb.h: %.proto
25 $(Q_PROTOC) $(PROTOBUF_INCLUDES) --cpp_out=$(top_srcdir) $(top_srcdir)/$(PROTOBUF_PACKAGE)/$^
26
27%.pb-c.c %.pb-c.h: %.proto
28 $(Q_PROTOC_C) $(PROTOBUF_INCLUDES) --c_out=$(top_srcdir) $(top_srcdir)/$(PROTOBUF_PACKAGE)/$^
29
30#
31# Information about how to link to various libraries.
32#
33Q_QUAGGA_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libquagga_pb.la $(Q_PROTOBUF_C_CLIENT_LDOPTS)
34
35Q_FPM_PB_CLIENT_LDOPTS = $(top_srcdir)/fpm/libfpm_pb.la $(Q_QUAGGA_PB_CLIENT_LDOPTS)
36
37endif # HAVE_PROTOBUF
38
39Q_CLEANFILES = $(Q_PROTOBUF_SRCS)
40
41Q_BUILT_SRCS = $(Q_PROTOBUF_SRCS)