forked from protobuf-c/protobuf-c
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
224 lines (183 loc) · 5.9 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
bin_PROGRAMS =
check_PROGRAMS =
noinst_PROGRAMS =
lib_LTLIBRARIES =
nobase_include_HEADERS =
pkgconfig_DATA =
BUILT_SOURCES =
TESTS =
CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
EXTRA_DIST += LICENSE
EXTRA_DIST += README.md
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I${top_srcdir}/protobuf-c \
-I${top_builddir} \
-I${top_srcdir}
AM_CFLAGS = ${my_CFLAGS}
AM_LDFLAGS =
# code coverage
AM_CFLAGS += ${CODE_COVERAGE_CFLAGS}
AM_LDFLAGS += ${CODE_COVERAGE_LDFLAGS}
CODE_COVERAGE_LCOV_OPTIONS = --no-external
CODE_COVERAGE_IGNORE_PATTERN = "$(abs_top_builddir)/t/*"
@CODE_COVERAGE_RULES@
#
# libprotobuf-c
#
LIBPROTOBUF_C_CURRENT=1
LIBPROTOBUF_C_REVISION=0
LIBPROTOBUF_C_AGE=0
lib_LTLIBRARIES += \
protobuf-c/libprotobuf-c.la
nobase_include_HEADERS += \
protobuf-c/protobuf-c.h
protobuf_c_libprotobuf_c_la_SOURCES = \
protobuf-c/protobuf-c.c \
protobuf-c/protobuf-c.h
protobuf_c_libprotobuf_c_la_LDFLAGS = $(AM_LDFLAGS) \
-version-info $(LIBPROTOBUF_C_CURRENT):$(LIBPROTOBUF_C_REVISION):$(LIBPROTOBUF_C_AGE) \
-no-undefined
if HAVE_LD_VERSION_SCRIPT
protobuf_c_libprotobuf_c_la_LDFLAGS += \
-Wl,--version-script=$(top_srcdir)/protobuf-c/libprotobuf-c.sym
else
protobuf_c_libprotobuf_c_la_LDFLAGS += \
-export-symbols-regex "^(protobuf_c_[a-z].*)"
endif
EXTRA_DIST += protobuf-c/libprotobuf-c.sym
pkgconfig_DATA += protobuf-c/libprotobuf-c.pc
CLEANFILES += protobuf-c/libprotobuf-c.pc
EXTRA_DIST += protobuf-c/libprotobuf-c.pc.in
#
# protoc-c
#
if BUILD_COMPILER
bin_PROGRAMS += protoc-c/protoc-c
protoc_c_protoc_c_SOURCES = \
protoc-c/c_bytes_field.cc \
protoc-c/c_bytes_field.h \
protoc-c/c_enum.cc \
protoc-c/c_enum.h \
protoc-c/c_enum_field.cc \
protoc-c/c_enum_field.h \
protoc-c/c_extension.cc \
protoc-c/c_extension.h \
protoc-c/c_field.cc \
protoc-c/c_field.h \
protoc-c/c_file.cc \
protoc-c/c_file.h \
protoc-c/c_generator.cc \
protoc-c/c_generator.h \
protoc-c/c_helpers.cc \
protoc-c/c_helpers.h \
protoc-c/c_message.cc \
protoc-c/c_message.h \
protoc-c/c_message_field.cc \
protoc-c/c_message_field.h \
protoc-c/c_primitive_field.cc \
protoc-c/c_primitive_field.h \
protoc-c/c_service.cc \
protoc-c/c_service.h \
protoc-c/c_string_field.cc \
protoc-c/c_string_field.h \
protoc-c/main.cc
protoc_c_protoc_c_CXXFLAGS = \
$(AM_CXXFLAGS) \
$(protobuf_CFLAGS)
protoc_c_protoc_c_LDADD = \
$(protobuf_LIBS) \
-lprotoc
#
# protobuf-c tests
#
if CROSS_COMPILING
#
# skip tests on cross-compiling
#
else
LOG_COMPILER = $(VALGRIND)
check_PROGRAMS += \
t/generated-code/test-generated-code \
t/generated-code2/test-generated-code2 \
t/version/version
TESTS += \
t/generated-code/test-generated-code \
t/generated-code2/test-generated-code2 \
t/version/version
t_generated_code_test_generated_code_SOURCES = \
t/generated-code/test-generated-code.c \
t/test.pb-c.c
t_generated_code_test_generated_code_LDADD = \
protobuf-c/libprotobuf-c.la
t_generated_code2_test_generated_code2_SOURCES = \
t/generated-code2/test-generated-code2.c \
t/test-full.pb-c.c \
t/test-optimized.pb-c.c
t_generated_code2_test_generated_code2_LDADD = \
protobuf-c/libprotobuf-c.la
noinst_PROGRAMS += \
t/generated-code2/cxx-generate-packed-data
t_generated_code2_cxx_generate_packed_data_SOURCES = \
t/generated-code2/cxx-generate-packed-data.cc \
t/test-full.pb.cc
$(t_generated_code2_cxx_generate_packed_data_OBJECTS): t/test-full.pb.h
t_generated_code2_cxx_generate_packed_data_CXXFLAGS = \
$(AM_CXXFLAGS) \
$(protobuf_CFLAGS)
t_generated_code2_cxx_generate_packed_data_LDADD = \
$(protobuf_LIBS)
t/test.pb-c.c t/test.pb-c.h: $(top_builddir)/protoc-c/protoc-c$(EXEEXT) $(top_srcdir)/t/test.proto
$(AM_V_GEN)$(top_builddir)/protoc-c/protoc-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/test.proto
t/test-optimized.pb-c.c t/test-optimized.pb-c.h: $(top_builddir)/protoc-c/protoc-c$(EXEEXT) $(top_srcdir)/t/test-optimized.proto
$(AM_V_GEN)$(top_builddir)/protoc-c/protoc-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/test-optimized.proto
t/test-full.pb-c.c t/test-full.pb-c.h: $(top_builddir)/protoc-c/protoc-c$(EXEEXT) $(top_srcdir)/t/test-full.proto
$(AM_V_GEN)$(top_builddir)/protoc-c/protoc-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/test-full.proto
t/test-full.pb.cc t/test-full.pb.h: @PROTOC@ $(top_srcdir)/t/test-full.proto
$(AM_V_GEN)@PROTOC@ -I$(top_srcdir) --cpp_out=$(top_builddir) $(top_srcdir)/t/test-full.proto
t/generated-code2/test-full-cxx-output.inc: t/generated-code2/cxx-generate-packed-data$(EXEEXT)
$(AM_V_GEN)$(top_builddir)/t/generated-code2/cxx-generate-packed-data$(EXEEXT) > $(top_builddir)/t/generated-code2/test-full-cxx-output.inc
BUILT_SOURCES += \
t/test.pb-c.c t/test.pb-c.h \
t/test-full.pb-c.c t/test-full.pb-c.h \
t/test-optimized.pb-c.c t/test-optimized.pb-c.h \
t/test-full.pb.cc t/test-full.pb.h \
t/generated-code2/test-full-cxx-output.inc
t_version_version_SOURCES = \
t/version/version.c
t_version_version_LDADD = \
protobuf-c/libprotobuf-c.la
endif # CROSS_COMPILING
endif # BUILD_COMPILER
EXTRA_DIST += \
t/test.proto \
t/test-full.proto \
t/test-optimized.proto \
t/generated-code2/common-test-arrays.h
#
#
#
CLEANFILES += $(BUILT_SOURCES)
dist-hook:
rm -vf `find $(top_distdir) -name '*.pb-c.[ch]' -o -name '*.pb.cc' -o -name '*.pb.h'`
install-data-hook:
$(MKDIR_P) $(DESTDIR)$(includedir)/google/protobuf-c
cd $(DESTDIR)$(includedir)/google/protobuf-c && rm -vf protobuf-c.h
cd $(DESTDIR)$(includedir)/google/protobuf-c && $(LN_S) ../../protobuf-c/protobuf-c.h protobuf-c.h
#
# documentation
#
if HAVE_DOXYGEN
stamp-html: $(DOXYGEN_INPUT_FILES) $(top_builddir)/Doxyfile $(top_srcdir)/DoxygenLayout.xml $(include_HEADERS) $(nobase_include_HEADERS)
$(AM_V_GEN) $(DOXYGEN)
@touch $@
html-local: stamp-html
clean-local:
rm -rf $(top_builddir)/html $(top_builddir)/stamp-html
endif
EXTRA_DIST += Doxyfile.in
EXTRA_DIST += DoxygenLayout.xml
EXTRA_DIST += build-cmake/CMakeLists.txt