summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-12-06 15:52:40 -0800
committerJoshua Haberman <joshua@reverberate.org>2010-12-06 15:52:40 -0800
commitb471ca6b81b88dc23aae6a53345d94d9a2714a7c (patch)
tree87626d9f55bc234be7308e58ae9e3add87768d62 /Makefile
parent2a7f51f3fd534b3e9e098c522cffbb96e1551474 (diff)
The last major revision to the upb_stream protocol.
Sources and sinks communicate by means of a upb_handlers object, which encapsulates a set of handler callbacks and will possibly offer richer semantics in the future like giving specific fields different callbacks. The upb_handlers protocol supports delegation, so sets of handlers can be written in reusable ways. For example, if a set of handlers is written to handle a specific .proto type, those handlers can be used whether that type is at the top level or whether it is a sub-message of a higher-level type. Delegation allows the streaming protocol to properly compose.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 25 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 131b3c0..5c6598c 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ CXX=g++
CFLAGS=-std=c99
INCLUDE=-Idescriptor -Icore -Itests -Istream -I.
CPPFLAGS=-Wall -Wextra -g $(INCLUDE) $(strip $(shell test -f perf-cppflags && cat perf-cppflags))
-LDLIBS=-lpthread
+LDLIBS=-lpthread core/libupb.a
ifeq ($(shell uname), Darwin)
CPPFLAGS += -I/usr/include/lua5.1
LDFLAGS += -L/usr/local/lib -llua
@@ -47,16 +47,27 @@ clean:
rm -rf $(LIBUPB) $(LIBUPB_PIC)
rm -rf $(call rwildcard,,*.o) $(call rwildcard,,*.lo) $(call rwildcard,,*.gc*)
rm -rf benchmark/google_messages.proto.pb benchmark/google_messages.pb.* benchmarks/b.* benchmarks/*.pb*
- rm -rf tests/tests tests/t.* tests/test_table
+ rm -rf $(TESTS) tests/t.*
rm -rf descriptor/descriptor.pb
rm -rf tools/upbc deps
cd lang_ext/python && python setup.py clean --all
+-include deps
+deps: gen-deps.sh Makefile $(call rwildcard,,*.c) $(call rwildcard,,*.h)
+ @./gen-deps.sh $(SRC)
+
# The core library (core/libupb.a)
-SRC=core/upb.c stream/upb_decoder.c core/upb_table.c core/upb_def.c core/upb_string.c \
- core/upb_stream.c stream/upb_stdio.c stream/upb_strstream.c stream/upb_textprinter.c \
- core/upb_msg.c \
- descriptor/descriptor.c
+SRC=core/upb.c \
+ core/upb_table.c \
+ core/upb_string.c \
+ descriptor/descriptor.c \
+# core/upb_def.c \
+# core/upb_msg.c \
+# stream/upb_decoder.c \
+# stream/upb_stdio.c \
+# stream/upb_strstream.c \
+# stream/upb_textprinter.c
+
$(SRC): perf-cppflags
# Parts of core that are yet to be converted.
OTHERSRC=src/upb_encoder.c src/upb_text.c
@@ -101,15 +112,16 @@ tests/test.proto.pb: tests/test.proto
TESTS=tests/test_string \
tests/test_table \
- tests/test_def \
- tests/test_decoder \
- tests/t.test_vs_proto2.googlemessage1 \
- tests/t.test_vs_proto2.googlemessage2 \
- tests/test.proto.pb
+ tests/test_stream \
+# tests/test_def \
+# tests/test_decoder \
+# tests/t.test_vs_proto2.googlemessage1 \
+# tests/t.test_vs_proto2.googlemessage2 \
+# tests/test.proto.pb
tests: $(TESTS)
OTHER_TESTS=tests/tests \
-$(TESTS): core/libupb.a
+$(TESTS): $(LIBUPB)
VALGRIND=valgrind --leak-check=full --error-exitcode=1
#VALGRIND=
@@ -118,7 +130,7 @@ test: tests
@set -e # Abort on error.
# Needs to be rewritten to separate the benchmark.
# valgrind --error-exitcode=1 ./tests/test_table
- @for test in tests/*; do \
+ @for test in $(TESTS); do \
if [ -x ./$$test ] ; then \
echo !!! $(VALGRIND) ./$$test; \
$(VALGRIND) ./$$test || exit 1; \
@@ -247,6 +259,3 @@ benchmarks/b.parsetostruct_googlemessage2.proto2_compiled: \
-DMESSAGE_HFILE=\"google_messages.pb.h\" \
benchmarks/google_messages.pb.cc -lprotobuf -lpthread
--include deps
-deps: gen-deps.sh Makefile $(call rwildcard,,*.c) $(call rwildcard,,*.h)
- @./gen-deps.sh $(SRC)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback