forked from confluentinc/librdkafka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (83 loc) · 3.39 KB
/
Makefile
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
EXAMPLES ?= rdkafka_example rdkafka_performance rdkafka_example_cpp \
rdkafka_consumer_example rdkafka_consumer_example_cpp \
kafkatest_verifiable_client rdkafka_simple_producer \
rdkafka_idempotent_producer
all: $(EXAMPLES)
include ../mklove/Makefile.base
CFLAGS += -I../src
CXXFLAGS += -I../src-cpp
# librdkafka must be compiled with -gstrict-dwarf, but rdkafka_example must not,
# due to some clang bug on OSX 10.9
CPPFLAGS := $(subst strict-dwarf,,$(CPPFLAGS))
rdkafka_example: ../src/librdkafka.a rdkafka_example.c
$(CC) $(CPPFLAGS) $(CFLAGS) rdkafka_example.c -o $@ $(LDFLAGS) \
../src/librdkafka.a $(LIBS)
@echo "# $@ is ready"
@echo "#"
@echo "# Run producer (write messages on stdin)"
@echo "./$@ -P -t <topic> -p <partition>"
@echo ""
@echo "# or consumer"
@echo "./$@ -C -t <topic> -p <partition>"
@echo ""
@echo "#"
@echo "# More usage options:"
@echo "./$@ -h"
rdkafka_simple_producer: ../src/librdkafka.a rdkafka_simple_producer.c
$(CC) $(CPPFLAGS) $(CFLAGS) $@.c -o $@ $(LDFLAGS) \
../src/librdkafka.a $(LIBS)
rdkafka_idempotent_producer: ../src/librdkafka.a rdkafka_idempotent_producer.c
$(CC) $(CPPFLAGS) $(CFLAGS) $@.c -o $@ $(LDFLAGS) \
../src/librdkafka.a $(LIBS)
rdkafka_consumer_example: ../src/librdkafka.a rdkafka_consumer_example.c
$(CC) $(CPPFLAGS) $(CFLAGS) rdkafka_consumer_example.c -o $@ $(LDFLAGS) \
../src/librdkafka.a $(LIBS)
@echo "# $@ is ready"
@echo "#"
@echo "./$@ <topic[:part]> <topic2[:part]> .."
@echo ""
@echo "#"
@echo "# More usage options:"
@echo "./$@ -h"
rdkafka_performance: ../src/librdkafka.a rdkafka_performance.c
$(CC) $(CPPFLAGS) $(CFLAGS) rdkafka_performance.c -o $@ $(LDFLAGS) \
../src/librdkafka.a $(LIBS)
@echo "# $@ is ready"
@echo "#"
@echo "# Run producer"
@echo "./$@ -P -t <topic> -p <partition> -s <msgsize>"
@echo ""
@echo "# or consumer"
@echo "./$@ -C -t <topic> -p <partition>"
@echo ""
@echo "#"
@echo "# More usage options:"
@echo "./$@ -h"
rdkafka_example_cpp: ../src-cpp/librdkafka++.a ../src/librdkafka.a rdkafka_example.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) rdkafka_example.cpp -o $@ $(LDFLAGS) \
../src-cpp/librdkafka++.a ../src/librdkafka.a $(LIBS) -lstdc++
kafkatest_verifiable_client: ../src-cpp/librdkafka++.a ../src/librdkafka.a kafkatest_verifiable_client.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) kafkatest_verifiable_client.cpp -o $@ $(LDFLAGS) \
../src-cpp/librdkafka++.a ../src/librdkafka.a $(LIBS) -lstdc++
rdkafka_consumer_example_cpp: ../src-cpp/librdkafka++.a ../src/librdkafka.a rdkafka_consumer_example.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) rdkafka_consumer_example.cpp -o $@ $(LDFLAGS) \
../src-cpp/librdkafka++.a ../src/librdkafka.a $(LIBS) -lstdc++
rdkafka_consume_batch: ../src-cpp/librdkafka++.a ../src/librdkafka.a rdkafka_consume_batch.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) rdkafka_consume_batch.cpp -o $@ $(LDFLAGS) \
../src-cpp/librdkafka++.a ../src/librdkafka.a $(LIBS) -lstdc++
rdkafka_zookeeper_example: ../src/librdkafka.a rdkafka_zookeeper_example.c
$(CC) $(CPPFLAGS) $(CFLAGS) -I/usr/include/zookeeper rdkafka_zookeeper_example.c -o $@ $(LDFLAGS) \
../src/librdkafka.a $(LIBS) -lzookeeper_mt -ljansson
@echo "# $@ is ready"
@echo "#"
@echo "# Run producer (write messages on stdin)"
@echo "./$@ -P -t <topic> -p <partition>"
@echo ""
@echo "# or consumer"
@echo "./$@ -C -t <topic> -p <partition>"
@echo ""
@echo "#"
@echo "# More usage options:"
@echo "./$@ -h"
clean:
rm -f $(EXAMPLES)