diff --git a/Makefile b/Makefile index a8c47cbf18..6b0df54b92 100644 --- a/Makefile +++ b/Makefile @@ -27,9 +27,9 @@ rwildcard=$(strip $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)$(filter $ CC=gcc CXX=g++ CFLAGS=-std=c99 -INCLUDE=-Idescriptor -Icore -Itests -Istream -I. +INCLUDE=-Idescriptor -Isrc -Itests -I. CPPFLAGS=-Wall -Wextra -Wno-missing-field-initializers -g $(INCLUDE) $(strip $(shell test -f perf-cppflags && cat perf-cppflags)) -LDLIBS=-lpthread core/libupb.a +LDLIBS=-lpthread src/libupb.a ifeq ($(shell uname), Darwin) CPPFLAGS += -I/usr/include/lua5.1 LDFLAGS += -L/usr/local/lib -llua @@ -38,14 +38,14 @@ else LDFLAGS += $(strip $(shell pkg-config --silence-errors --libs lua || pkg-config --libs lua5.1)) endif -LIBUPB=core/libupb.a -LIBUPB_PIC=core/libupb_pic.a -LIBUPB_SHARED=core/libupb.so +LIBUPB=src/libupb.a +LIBUPB_PIC=src/libupb_pic.a +LIBUPB_SHARED=src/libupb.so ALL=deps $(OBJ) $(LIBUPB) $(LIBUPB_PIC) all: $(ALL) clean: rm -rf $(LIBUPB) $(LIBUPB_PIC) - rm -rf $(call rwildcard,,*.o) $(call rwildcard,,*.lo) $(call rwildcard,,*.gc*) + rm -rf $(call rwildcard,,*.o) $(call rwildcard,,*.lo) $(call rwildcard,,*.gcno) $(call rwildcard,,*.dSYM) rm -rf benchmark/google_messages.proto.pb benchmark/google_messages.pb.* benchmarks/b.* benchmarks/*.pb* rm -rf $(TESTS) tests/t.* rm -rf descriptor/descriptor.pb @@ -59,20 +59,20 @@ deps: gen-deps.sh Makefile $(call rwildcard,,*.c) $(call rwildcard,,*.h) # The core library -- the absolute minimum you must compile in to successfully # bootstrap. CORE= \ - core/upb.c \ - core/upb_table.c \ - core/upb_string.c \ - core/upb_def.c \ + src/upb.c \ + src/upb_table.c \ + src/upb_string.c \ + src/upb_def.c \ descriptor/descriptor.c # Common encoders/decoders and upb_msg -- you're almost certain to want these. STREAM= \ - stream/upb_decoder.c \ - stream/upb_stdio.c \ - stream/upb_textprinter.c \ - stream/upb_strstream.c \ - core/upb_msg.c \ - core/upb_glue.c \ + src/upb_decoder.c \ + src/upb_stdio.c \ + src/upb_textprinter.c \ + src/upb_strstream.c \ + src/upb_msg.c \ + src/upb_glue.c \ SRC=$(CORE) $(STREAM) @@ -81,13 +81,13 @@ $(SRC): perf-cppflags OTHERSRC=src/upb_encoder.c src/upb_text.c # Override the optimization level for upb_def.o, because it is not in the # critical path but gets very large when -O3 is used. -core/upb_def.o: core/upb_def.c +src/upb_def.o: src/upb_def.c $(CC) $(CFLAGS) $(CPPFLAGS) -Os -c -o $@ $< -core/upb_def.lo: core/upb_def.c +src/upb_def.lo: src/upb_def.c $(CC) $(CFLAGS) $(CPPFLAGS) -Os -c -o $@ $< -fPIC lang_ext/lua/upb.so: lang_ext/lua/upb.lo - $(CC) $(CFLAGS) $(CPPFLAGS) -shared -o $@ $< core/libupb_pic.a + $(CC) $(CFLAGS) $(CPPFLAGS) -shared -o $@ $< src/libupb_pic.a STATICOBJ=$(patsubst %.c,%.o,$(SRC)) @@ -171,10 +171,10 @@ tests/test_table: tests/test_table.cc # Includes which is a deprecated header. $(CXX) $(CXXFLAGS) $(CPPFLAGS) -Wno-deprecated -o $@ $< $(LIBUPB) -tests/tests: core/libupb.a +tests/tests: src/libupb.a # Tools -tools/upbc: core/libupb.a +tools/upbc: src/libupb.a # Benchmarks #UPB_BENCHMARKS=benchmarks/b.parsetostruct_googlemessage1.upb_table \ diff --git a/core/upb.c b/src/upb.c similarity index 100% rename from core/upb.c rename to src/upb.c diff --git a/core/upb.h b/src/upb.h similarity index 100% rename from core/upb.h rename to src/upb.h diff --git a/core/upb_atomic.h b/src/upb_atomic.h similarity index 100% rename from core/upb_atomic.h rename to src/upb_atomic.h diff --git a/stream/upb_decoder.c b/src/upb_decoder.c similarity index 100% rename from stream/upb_decoder.c rename to src/upb_decoder.c diff --git a/stream/upb_decoder.h b/src/upb_decoder.h similarity index 100% rename from stream/upb_decoder.h rename to src/upb_decoder.h diff --git a/core/upb_def.c b/src/upb_def.c similarity index 100% rename from core/upb_def.c rename to src/upb_def.c diff --git a/core/upb_def.h b/src/upb_def.h similarity index 100% rename from core/upb_def.h rename to src/upb_def.h diff --git a/stream/upb_encoder.c b/src/upb_encoder.c similarity index 100% rename from stream/upb_encoder.c rename to src/upb_encoder.c diff --git a/stream/upb_encoder.h b/src/upb_encoder.h similarity index 100% rename from stream/upb_encoder.h rename to src/upb_encoder.h diff --git a/core/upb_glue.c b/src/upb_glue.c similarity index 100% rename from core/upb_glue.c rename to src/upb_glue.c diff --git a/core/upb_glue.h b/src/upb_glue.h similarity index 100% rename from core/upb_glue.h rename to src/upb_glue.h diff --git a/core/upb_msg.c b/src/upb_msg.c similarity index 100% rename from core/upb_msg.c rename to src/upb_msg.c diff --git a/core/upb_msg.h b/src/upb_msg.h similarity index 100% rename from core/upb_msg.h rename to src/upb_msg.h diff --git a/stream/upb_stdio.c b/src/upb_stdio.c similarity index 100% rename from stream/upb_stdio.c rename to src/upb_stdio.c diff --git a/stream/upb_stdio.h b/src/upb_stdio.h similarity index 100% rename from stream/upb_stdio.h rename to src/upb_stdio.h diff --git a/core/upb_stream.h b/src/upb_stream.h similarity index 100% rename from core/upb_stream.h rename to src/upb_stream.h diff --git a/core/upb_stream_vtbl.h b/src/upb_stream_vtbl.h similarity index 100% rename from core/upb_stream_vtbl.h rename to src/upb_stream_vtbl.h diff --git a/core/upb_string.c b/src/upb_string.c similarity index 100% rename from core/upb_string.c rename to src/upb_string.c diff --git a/core/upb_string.h b/src/upb_string.h similarity index 100% rename from core/upb_string.h rename to src/upb_string.h diff --git a/stream/upb_strstream.c b/src/upb_strstream.c similarity index 100% rename from stream/upb_strstream.c rename to src/upb_strstream.c diff --git a/stream/upb_strstream.h b/src/upb_strstream.h similarity index 100% rename from stream/upb_strstream.h rename to src/upb_strstream.h diff --git a/core/upb_table.c b/src/upb_table.c similarity index 100% rename from core/upb_table.c rename to src/upb_table.c diff --git a/core/upb_table.h b/src/upb_table.h similarity index 100% rename from core/upb_table.h rename to src/upb_table.h diff --git a/stream/upb_textprinter.c b/src/upb_textprinter.c similarity index 100% rename from stream/upb_textprinter.c rename to src/upb_textprinter.c diff --git a/stream/upb_textprinter.h b/src/upb_textprinter.h similarity index 100% rename from stream/upb_textprinter.h rename to src/upb_textprinter.h