From c0a50de92300080a1cf11bf4ff0ec3b2d6240c10 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Tue, 21 Aug 2018 14:47:50 -0700 Subject: Removed a bunch of obsolete code. A lot of this code was experimental or temporarily useful, but is no longer needed. --- Makefile | 123 --------------------------------------------------------------- 1 file changed, 123 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 30a6dc1..1bf5a39 100644 --- a/Makefile +++ b/Makefile @@ -384,83 +384,6 @@ tests/conformance_upb: tests/conformance_upb.c lib/libupb.a obj/conformance_prot $(CC) -o tests/conformance_upb tests/conformance_upb.c -Iobj -I. $(CPPFLAGS) $(CFLAGS) obj/conformance.upb.c obj/google/protobuf/*.upb.c lib/libupb.a -# Google protobuf binding ###################################################### - -upb_bindings_googlepb_SRCS = \ - upb/bindings/googlepb/bridge.cc \ - upb/bindings/googlepb/proto2.cc \ - -GOOGLEPB_TESTS = \ - tests/bindings/googlepb/test_vs_proto2.googlemessage1 \ - tests/bindings/googlepb/test_vs_proto2.googlemessage2 \ - -GOOGLEPB_LIB=lib/libupb.bindings.googlepb.a - -.PHONY: googlepb clean_googlepb googlepbtest - -clean: clean_googlepb -clean_googlepb: - @rm -f tests/bindings/googlepb/test_vs_proto2.googlemessage* - @rm -f tests/googlemessage?.h - @rm -f $(GOOGLEPB_LIB) - -googlepb: default $(GOOGLEPB_LIB) -googlepbtests: googlepb $(GOOGLEPB_TESTS) - -lib/libupb.bindings.googlepb.a: $(upb_bindings_googlepb_SRCS:upb/%.cc=obj/upb/%.o) - $(E) AR $@ - $(Q) mkdir -p lib && $(AR) rcs $@ $^ - -# Generate C++ with Google's protobuf compiler, to test and benchmark against. -tests/google_messages.proto.pb: tests/google_messages.proto - @# TODO: replace with upbc. - protoc tests/google_messages.proto -otests/google_messages.proto.pb -tests/google_messages.pb.cc: tests/google_messages.proto - protoc tests/google_messages.proto --cpp_out=. - -tests/google_message1.h: - $(E) XXD tests/google_message1.dat - $(Q) xxd -i < tests/google_message1.dat > tests/google_message1.h - -tests/google_message2.h: - $(E) XXD tests/google_message2.dat - $(Q) xxd -i < tests/google_message2.dat > tests/google_message2.h - -GOOGLEPB_TEST_LIBS = \ - lib/libupb.bindings.googlepb.a \ - lib/libupb.pb.a \ - lib/libupb.descriptor.a \ - lib/libupb.a \ - $(EXTRA_LIBS) - -GOOGLEPB_TEST_DEPS = \ - tests/bindings/googlepb/test_vs_proto2.cc \ - tests/google_messages.proto.pb \ - tests/google_messages.pb.cc \ - tests/testmain.o \ - $(GOOGLEPB_TEST_LIBS) - -tests/bindings/googlepb/test_vs_proto2.googlemessage1: $(GOOGLEPB_TEST_DEPS) \ - tests/google_message1.h \ - tests/google_message2.h - $(E) CXX $< '(benchmarks::SpeedMessage1)' - $(Q) $(CXX) $(OPT) $(WARNFLAGS_CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< \ - -DMESSAGE_CIDENT="benchmarks::SpeedMessage1" \ - -DMESSAGE_DATA_IDENT=message1_data \ - tests/google_messages.pb.cc tests/testmain.o -lprotobuf -lpthread \ - $(GOOGLEPB_TEST_LIBS) - -tests/bindings/googlepb/test_vs_proto2.googlemessage2: $(GOOGLEPB_TEST_DEPS) \ - tests/google_message1.h \ - tests/google_message2.h - $(E) CXX $< '(benchmarks::SpeedMessage2)' - $(Q) $(CXX) $(OPT) $(WARNFLAGS_CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< \ - -DMESSAGE_CIDENT="benchmarks::SpeedMessage2" \ - -DMESSAGE_DATA_IDENT=message2_data \ - tests/google_messages.pb.cc tests/testmain.o -lprotobuf -lpthread \ - $(GOOGLEPB_TEST_LIBS) - - # Lua extension ################################################################## ifeq ($(shell uname), Darwin) @@ -514,49 +437,3 @@ upb/bindings/lua/upb/table_c.so: upb/bindings/lua/upb/table.c lib/libupb_pic.a upb/bindings/lua/upb/pb_c.so: upb/bindings/lua/upb/pb.c $(LUA_LIB_DEPS) $(E) CC upb/bindings/lua/upb/pb.c $(Q) $(CC) $(OPT) $(CSTD) $(WARNFLAGS) $(CPPFLAGS) $(CFLAGS) -fpic -shared -o $@ $^ $(LUA_LDFLAGS) - - -# Python extension ############################################################# - -PYTHON=python -PYTHONEXT=bindings/python/build/install/lib/python/upb/__init__.so -python: $(PYTHONEXT) -$(PYTHONEXT): $(LIBUPB_PIC) bindings/python/upb.c - $(E) PYTHON bindings/python/upb.c - $(Q) cd bindings/python && $(PYTHON) setup.py build --debug install --home=build/install - -pythontest: $(PYTHONEXT) - cd bindings/python && cp test.py build/install/lib/python && valgrind $(PYTHON) ./build/install/lib/python/test.py - -# Ruby extension ############################################################### - -RUBY=ruby -RUBYEXT=upb/bindings/ruby/upb.so -ruby: $(RUBYEXT) - -# We pass our important flags to Ruby, but leave the warning flags out. -# Some uses of the Ruby/C API trigger the warnings we normally use, so -# we let Ruby decide the set of warning options to use. -upb/bindings/ruby/Makefile: upb/bindings/ruby/extconf.rb lib/libupb_pic.a lib/libupb.pb_pic.a lib/libupb.descriptor_pic.a - $(E) RUBY upb/bindings/ruby/extconf.rb - $(Q) cd upb/bindings/ruby && ruby extconf.rb "$(OPT) $(CPPFLAGS) $(CFLAGS)" -$(RUBYEXT): upb/bindings/ruby/upb.c upb/bindings/ruby/Makefile - $(E) CC upb/bindings/ruby/upb.c - $(Q) cd upb/bindings/ruby && make - -rubytest: $(RUBYEXT) upb/descriptor/descriptor.pb - RUBYLIB="upb/bindings/ruby" ruby tests/bindings/ruby/upb.rb - -# Amalgamated source (upb.c/upb.h) ############################################ - -AMALGAMATE_SRCS=$(upb_SRCS) $(upb_descriptor_SRCS) $(upb_pb_SRCS) $(upb_json_SRCS) - -amalgamate: upb.c upb.h - -upb.c upb.h: $(AMALGAMATE_SRCS) - $(E) AMALGAMATE $@ - $(Q) ./tools/amalgamate.py "" "" $^ - -amalgamated: upb.c upb.h - $(E) CC upb.c - $(Q) $(CC) -o upb.o -c upb.c $(WARNFLAGS) -- cgit v1.2.3 From 6155ed8b499c10bdd1f38bcb25866218bc388b7c Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Tue, 21 Aug 2018 15:01:07 -0700 Subject: Re-add amalgamation rules and remove google protobuf from Travis. --- .travis.yml | 1 - Makefile | 14 ++++++++++++++ travis.sh | 16 ++-------------- 3 files changed, 16 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/.travis.yml b/.travis.yml index 053b130..56ab91c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ env: - UPB_TRAVIS_BUILD=bare - UPB_TRAVIS_BUILD=barejit - UPB_TRAVIS_BUILD=core32 - - UPB_TRAVIS_BUILD=withprotobuf - UPB_TRAVIS_BUILD=lua - UPB_TRAVIS_BUILD=ndebug - UPB_TRAVIS_BUILD=coverage diff --git a/Makefile b/Makefile index 1bf5a39..f78c950 100644 --- a/Makefile +++ b/Makefile @@ -437,3 +437,17 @@ upb/bindings/lua/upb/table_c.so: upb/bindings/lua/upb/table.c lib/libupb_pic.a upb/bindings/lua/upb/pb_c.so: upb/bindings/lua/upb/pb.c $(LUA_LIB_DEPS) $(E) CC upb/bindings/lua/upb/pb.c $(Q) $(CC) $(OPT) $(CSTD) $(WARNFLAGS) $(CPPFLAGS) $(CFLAGS) -fpic -shared -o $@ $^ $(LUA_LDFLAGS) + +# Amalgamated source (upb.c/upb.h) ############################################ + +AMALGAMATE_SRCS=$(upb_SRCS) $(upb_descriptor_SRCS) $(upb_pb_SRCS) $(upb_json_SRCS) + +amalgamate: upb.c upb.h + +upb.c upb.h: $(AMALGAMATE_SRCS) + $(E) AMALGAMATE $@ + $(Q) ./tools/amalgamate.py "" "" $^ + +amalgamated: upb.c upb.h + $(E) CC upb.c + $(Q) $(CC) -o upb.o -c upb.c $(WARNFLAGS) diff --git a/travis.sh b/travis.sh index 413015a..e8323df 100755 --- a/travis.sh +++ b/travis.sh @@ -23,17 +23,6 @@ barejit_script() { make test } -# Build with Google protobuf support and tests (with JIT). -withprotobuf_install() { - sudo apt-get update -qq - sudo apt-get install libprotobuf-dev - install_protoc -} -withprotobuf_script() { - make -j12 tests googlepbtests WITH_JIT=yes - make test -} - # Build with strict warnings. warnings_install() { : @@ -103,7 +92,7 @@ ndebug_install() { ndebug_script() { # Override of USER_CPPFLAGS removes -UNDEBUG. export USER_CPPFLAGS="`pkg-config lua5.2 --cflags` -g -fomit-frame-pointer" - make -j12 tests googlepbtests testlua WITH_JIT=yes + make -j12 tests testlua WITH_JIT=yes make test } @@ -127,7 +116,7 @@ coverage_install() { } coverage_script() { export USER_CPPFLAGS="--coverage -O0 `pkg-config lua5.2 --cflags`" - make -j12 tests googlepbtests testlua WITH_JIT=yes + make -j12 tests testlua WITH_JIT=yes make test } coverage_after_success() { @@ -152,7 +141,6 @@ if [ "$1" == "local" ]; then run_config "bare" run_config "barejit" run_config "core32" - run_config "withprotobuf" run_config "lua" run_config "ndebug" run_config "genfiles" -- cgit v1.2.3