-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile.am
238 lines (210 loc) · 7.28 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# Automake file
ACLOCAL_AMFLAGS = -I m4
# Nonstandard package files for distribution
EXTRA_DIST = \
README.md \
CHANGELOG \
LICENSE
# We define the global AM_CPPFLAGS as everything we compile includes from these
# directories. Adding /opt/local/include for Macs using MacPorts.
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/metadata -I$(top_srcdir)/produce -I$(top_srcdir)/fetch -I$(top_srcdir)/offset -I/opt/local/include
# Build rules for libraries.
lib_LTLIBRARIES = lib/libkafka.la
lib_libkafka_la_SOURCES = \
lib/src/ApiConstants.cc \
lib/src/Client.cc \
lib/src/Connection.cc \
lib/src/Util.cc \
lib/src/Packet.cc \
lib/src/Request.cc \
lib/src/RequestOrResponse.cc \
lib/src/Response.cc \
lib/src/Message.cc \
lib/src/MessageSet.cc \
lib/src/TopicNameBlock.h \
lib/src/metadata/Broker.cc \
lib/src/metadata/MetadataRequest.cc \
lib/src/metadata/MetadataResponse.cc \
lib/src/metadata/PartitionMetadata.cc \
lib/src/metadata/TopicMetadata.cc \
lib/src/produce/ProduceRequest.cc \
lib/src/produce/ProduceMessageSet.cc \
lib/src/produce/ProduceResponse.cc \
lib/src/produce/ProduceResponsePartition.cc \
lib/src/fetch/FetchRequest.cc \
lib/src/fetch/FetchPartition.cc \
lib/src/fetch/FetchResponse.cc \
lib/src/fetch/FetchResponsePartition.cc \
lib/src/offset/OffsetRequest.cc \
lib/src/offset/OffsetPartition.cc \
lib/src/offset/OffsetResponse.cc \
lib/src/offset/OffsetResponsePartition.cc
LIBKAFKA_LIBRARY_VERSION = 0:5:0
lib_libkafka_la_CPPFLAGS = $(AM_CPPFLAGS) $(COVERAGE_CFLAGS)
lib_libkafka_la_LDFLAGS = -version-info $(LIBKAFKA_LIBRARY_VERSION) $(COVERAGE_LDFLAGS)
lib_libkafka_ladir = $(includedir)/libkafka
pkginclude_HEADERS = \
lib/src/ApiConstants.h \
lib/src/Client.h \
lib/src/Connection.h \
lib/src/Debug.h \
lib/src/Packet.h \
lib/src/PacketWriter.h \
lib/src/Request.h \
lib/src/RequestOrResponse.h \
lib/src/Response.h \
lib/src/Message.h \
lib/src/MessageSet.h \
lib/src/TopicNameBlock.h \
lib/src/Util.h \
lib/src/WireFormatter.h \
lib/src/ErrorHandler.h
metadataincludedir = $(includedir)/libkafka/metadata
dist_metadatainclude_HEADERS = \
lib/src/metadata/MetadataRequest.h \
lib/src/metadata/MetadataResponse.h \
lib/src/metadata/Broker.h \
lib/src/metadata/PartitionMetadata.h \
lib/src/metadata/TopicMetadata.h
produceincludedir = $(includedir)/libkafka/produce
dist_produceinclude_HEADERS = \
lib/src/produce/ProduceRequest.h \
lib/src/produce/ProduceMessageSet.h \
lib/src/produce/ProduceResponse.h \
lib/src/produce/ProduceResponsePartition.h
fetchincludedir = $(includedir)/libkafka/fetch
dist_fetchinclude_HEADERS = \
lib/src/fetch/FetchRequest.h \
lib/src/fetch/FetchPartition.h \
lib/src/fetch/FetchResponse.h \
lib/src/fetch/FetchResponsePartition.h
offsetincludedir = $(includedir)/libkafka/offset
dist_offsetinclude_HEADERS = \
lib/src/offset/OffsetRequest.h \
lib/src/offset/OffsetPartition.h \
lib/src/offset/OffsetResponse.h \
lib/src/offset/OffsetResponsePartition.h
# Bulid rules for samples and tests. Automake's naming for some of
# these variables isn't terribly obvious, so this is a brief
# reference:
#
# TESTS -- Programs run automatically by "make check"
# check_PROGRAMS -- Programs built by "make check" but not necessarily run
TESTS=
check_PROGRAMS=
# libkafka unit tests
TESTS += test/libkafka_unit_tests
check_PROGRAMS += test/libkafka_unit_tests
test_libkafka_unit_tests_SOURCES = \
test/src/BaseTest.cc \
test/src/ConnectionTest.cc \
test/src/BrokerTest.cc \
test/src/MetadataRequestTest.cc \
test/src/MetadataResponseTest.cc \
test/src/PartitionMetadataTest.cc \
test/src/TopicMetadataTest.cc \
test/src/PacketTest.cc \
test/src/MessageTest.cc \
test/src/MessageSetTest.cc \
test/src/RequestOrResponseTest.cc \
test/src/RequestTest.cc \
test/src/ResponseTest.cc \
test/src/TopicNameBlockTest.cc \
test/src/ProduceRequestTest.cc \
test/src/ProduceMessageSetTest.cc \
test/src/ProduceResponseTest.cc \
test/src/ProduceResponsePartitionTest.cc \
test/src/FetchRequestTest.cc \
test/src/FetchPartitionTest.cc \
test/src/FetchResponseTest.cc \
test/src/FetchResponsePartitionTest.cc \
test/src/OffsetRequestTest.cc \
test/src/OffsetPartitionTest.cc \
test/src/OffsetResponseTest.cc \
test/src/OffsetResponsePartitionTest.cc \
test/src/ApiConstantsTest.cc \
test/src/ClientTest.cc \
test/src/TestConfig.cc \
test/src/TestConfig.h \
test/src/BaseTest.h
test_libkafka_unit_tests_CPPFLAGS = $(GTEST_CPPFLAGS) -I$(srcdir)/lib/src
test_libkafka_unit_tests_LDFLAGS = $(GTEST_LDFLAGS)
test_libkafka_unit_tests_LDADD = lib/libkafka.la $(GTEST_LIBS) -lz -lsnappy
# Deletes all the files generated by autogen.sh.
MAINTAINERCLEANFILES = \
aclocal.m4 \
configure \
Makefile.in \
config/compile \
config/config.guess \
config/config.h.in \
config/config.h.in~ \
config/config.sub \
config/depcomp \
config/install-sh \
config/ltmain.sh \
config/missing \
config/test-driver \
mkinstalldirs \
stamp.h.in \
m4/ltsugar.m4 \
m4/libtool.m4 \
m4/ltversion.m4 \
m4/lt~obsolete.m4 \
m4/ltoptions.m4 \
lib/src/*gcno lib/src/*/*gcno
APP_NAME=libkafka
# Create a deb package
DEB_DIR=deb
deb: dist
- rm -r $(DEB_DIR)
mkdir -p $(DEB_DIR)
cp $(APP_NAME)-$(VERSION).tar.bz2 $(DEB_DIR)/
tar --directory $(DEB_DIR)/ -xjf $(DEB_DIR)/$(APP_NAME)-$(VERSION).tar.bz2
#cd $(DEB_DIR)/$(APP_NAME)-$(VERSION)/; ./configure --prefix=$(PWD) && make
#echo | dh_make --single --copyright apache2 -e tompkins@adobe.com -f ../$(APP_NAME)-$(VERSION).tar.bz2
#cp CHANGELOG install/deb/control install/deb/copyright $(DEB_DIR)/$(APP_NAME)-$(VERSION)/debian/
#cd $(DEB_DIR)/$(APP_NAME)-$(VERSION)/; rm debian/README.Debian debian/*.ex debian/*.EX; ./configure; dpkg-buildpackage -rfakeroot; mv ../*.deb $(PWD)
#rm -r $(DEB_DIR);
# Create an RPM package
RPM_DIR=rpm
rpm: dist
mkdir -p $(RPM_DIR)/RPMS
mkdir -p $(RPM_DIR)/SRPMS
mkdir -p $(RPM_DIR)/BUILD
mkdir -p $(RPM_DIR)/SOURCES
mkdir -p $(RPM_DIR)/tmp
- rm -r $(RPM_DIR)/BUILD/$(APP_NAME)-root
- rm -r $(RPM_DIR)/RPMS/$(APP_NAME)-*
- rm -r $(RPM_DIR)/SRPMS/$(APP_NAME)-*
- rm -r $(RPM_DIR)/SOURCES/$(APP_NAME)-*
cp $(APP_NAME)-$(VERSION).tar.bz2 $(RPM_DIR)/SOURCES/
rpmbuild -vv --nodeps -bb install/rpm/libkafka.spec
rpm-clean: distclean maintainer-clean
- rm -rf $(RPM_DIR)
- rm -rf $(DEB_DIR)
- rm -rf libkafka-*gz
- rm -rf libkafka-*bz2
- rm -rf libkafka-*zip
# Coverage targets
if HAVE_GCOV
.PHONY: clean-gcda
clean-gcda:
@echo Removing old coverage results
-find -name '*.gcda' -print | xargs -r rm
.PHONY: coverage-html generate-coverage-html clean-coverage-html
#coverage-html: clean-gcda
coverage-html:
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
generate-coverage-html:
@echo Collecting coverage data with lcov
$(LCOV) --gcov-tool $(GCOV) -b . --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
$(LCOV) --remove coverage.info "/usr*" -o coverage.info
$(LCOV) --remove coverage.info "/opt*" -o coverage.info
LANG=C++ $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
clean-coverage-html: clean-gcda
-$(LCOV) --directory $(top_builddir) -z
-rm -rf coverage.info coveragereport
clean-local: clean-coverage-html
endif # HAVE_GCOV