From cfd67dda4967d2246ab1a9d852ad466a9b2a1a18 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 16 Aug 2009 00:21:17 -0700 Subject: Various fixes. --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 73e5b65..2d2c6f8 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,17 @@ +# +# Summary of compiler flags you may want to use: +# +# * -DNDEBUG: makes binary smaller and faster by removing sanity checks. +# * -O3: optimize for maximum speed +# * -fomit-frame-pointer: makes code smaller and faster by freeing up a reg. +# +# Threading: +# * -DUPB_USE_PTHREADS: configures upb to use pthreads r/w lock. +# * -DUPB_THREAD_UNSAFE: remove all thread-safety. +# * -pthread: required on GCC to enable pthreads (but what does it do?) +# +# Other: +# * -DUPB_UNALIGNED_READS_OK: makes code smaller, but not standard compliant # Function to expand a wildcard pattern recursively. rwildcard=$(strip $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)$(filter $(subst *,%,$2),$d))) @@ -8,13 +22,14 @@ CXX=g++ CFLAGS=-std=c99 INCLUDE=-Idescriptor -Isrc -Itests -I. CPPFLAGS=-Wall -Wextra -g $(INCLUDE) $(strip $(shell test -f perf-cppflags && cat perf-cppflags)) +LDLIBS=-lpthread LIBUPB=src/libupb.a ALL=deps $(OBJ) $(LIBUPB) tests/test_table tests/tests tools/upbc all: $(ALL) clean: - rm -f $(call rwildcard,,*.o) $(ALL) benchmark/google_messages.proto.pb benchmark/google_messages.pb.* benchmarks/b.* benchmarks/*.pb* - rm -f descriptor/descriptor.proto.pb + rm -rf $(call rwildcard,,*.o) $(ALL) benchmark/google_messages.proto.pb benchmark/google_messages.pb.* benchmarks/b.* benchmarks/*.pb* + rm -rf descriptor/descriptor.proto.pb # The core library (src/libupb.a) OBJ=src/upb_parse.o src/upb_table.o src/upb_msg.o src/upb_enum.o src/upb_context.o \ -- cgit v1.2.3