diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-08-12 13:47:24 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-08-12 13:47:24 -0700 |
commit | 2282d2489bd8db3cd4ddbe0dd813732bffcf6452 (patch) | |
tree | 814fc94cd8ca4993363fb0ebe45b14e320a7a792 /Makefile | |
parent | 89a6c6d71f87bab63ee17c60f0feb56215f5c116 (diff) |
Refactoring: unify upb_msg.
The cost is that a upb_msg will now always have an overhead
of 2*sizeof(void*). This is comparable to proto2 overhead.
The benefit is that upb_msg is now self-describing, and
read-only algorithms can now operate on a upb_msg regardless
of the memory-management scheme.
Also, upb_array and upb_string now know inherently if they
own their associated memory, and upb_array has a generic
pointer for memory management purposes like upb_msg does.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -2,18 +2,19 @@ # Function to expand a wildcard pattern recursively. rwildcard=$(strip $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)$(filter $(subst *,%,$2),$d))) -.PHONY: all clean test benchmarks benchmark +.PHONY: all clean test benchmarks benchmark descriptorgen CC=gcc CXX=g++ CFLAGS=-std=c99 INCLUDE=-Idescriptor -Isrc -Itests -I. -CPPFLAGS=-O3 -Wall -Wextra -g $(INCLUDE) $(strip $(shell test -f perf-cppflags && cat perf-cppflags)) +CPPFLAGS=-Wall -Wextra -g $(INCLUDE) $(strip $(shell test -f perf-cppflags && cat perf-cppflags)) 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 # 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 \ @@ -23,6 +24,14 @@ HEADERS=$(call rwildcard,,*.h) $(LIBUPB): $(OBJ) ar rcs $(LIBUPB) $(OBJ) +# Regenerating the auto-generated files in descriptor/. +descriptor/descriptor.proto.pb: descriptor/descriptor.proto + # TODO: replace with upbc + protoc descriptor/descriptor.proto -odescriptor/descriptor.proto.pb + +descriptorgen: descriptor/descriptor.proto.pb tools/upbc + ./tools/upbc -i upb_file_descriptor_set -o descriptor/descriptor descriptor/descriptor.proto.pb + # Tests test: tests/tests ./tests/tests |