summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2018-03-07 16:30:21 -0800
committerJosh Haberman <jhaberman@gmail.com>2018-03-07 16:30:21 -0800
commitcea737028f7d34e6415c0de5d34587245624db2b (patch)
tree981332e74e56a8d025c6402de0f515b6ca2bd6eb /Makefile
parent6edcf6a82a1d49d784302c152735e4bdba6d643e (diff)
Added google/protobuf/descriptor.upb.* to core.
This is in preparation for making upb_def capable of parsing binary descriptors directly. We leave upb/descriptor/descriptor.upbdefs.* in place for now, because upb/descriptor/reader.* still depends on it. Also removed a bit of cruft from the codegen.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 11 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index ba95469..30a6dc1 100644
--- a/Makefile
+++ b/Makefile
@@ -141,13 +141,14 @@ clean: clean_leave_profile clean_lua
.SECONDEXPANSION:
to_srcs = $(subst .,_,$(1)_SRCS)
pc = %
-make_objs = $$(patsubst upb/$$(pc).c,obj/upb/$$(pc).$(1),$$($$(call to_srcs,$$*)))
-make_objs_cc = $$(patsubst upb/$$(pc).cc,obj/upb/$$(pc).$(1),$$($$(call to_srcs,$$*)))
+make_objs = $$(patsubst $$(pc).c,obj/$$(pc).$(1),$$($$(call to_srcs,$$*)))
+make_objs_cc = $$(patsubst $$(pc).cc,obj/$$(pc).$(1),$$($$(call to_srcs,$$*)))
# Core libraries (ie. not bindings). ###############################################################
upb_SRCS = \
+ google/protobuf/descriptor.upb.c \
upb/decode.c \
upb/def.c \
upb/encode.c \
@@ -230,19 +231,19 @@ $(UPB_LIBS): lib/lib%.a: $(call make_objs,o)
$(Q) mkdir -p lib && $(AR) rcs $@ $^
-obj/upb/%.o: upb/%.c | $$(@D)/.
+obj/%.o: %.c | $$(@D)/.
$(E) CC $<
$(Q) $(CC) $(OPT) $(CSTD) $(WARNFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
-obj/upb/%.o: upb/%.cc | $$(@D)/.
+obj/%.o: %.cc | $$(@D)/.
$(E) CXX $<
$(Q) $(CXX) $(OPT) $(CXXSTD) $(WARNFLAGS_CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
-obj/upb/%.lo: upb/%.c | $$(@D)/.
+obj/%.lo: %.c | $$(@D)/.
$(E) 'CC -fPIC' $<
$(Q) $(CC) $(OPT) $(CSTD) $(WARNFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< -fPIC
-obj/upb/%.lo: upb/%.cc | $$(@D)/.
+obj/%.lo: %.cc | $$(@D)/.
$(E) CXX -fPIC $<
$(Q) $(CXX) $(OPT) $(CXXSTD) $(WARNFLAGS_CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< -fPIC
@@ -263,8 +264,12 @@ genfiles: tools/upbc
@# TODO: replace protoc with upbc when upb can parse .proto files
$(E) PROTOC upb/descriptor/descriptor.proto
$(Q) protoc upb/descriptor/descriptor.proto -oupb/descriptor/descriptor.pb
+ $(E) PROTOC google/protobuf/descriptor.proto
+ $(Q) protoc google/protobuf/descriptor.proto -ogoogle/protobuf/descriptor.pb
$(E) UPBC upb/descriptor/descriptor.pb
$(Q) ./tools/upbc --generate-upbdefs upb/descriptor/descriptor.pb
+ $(E) UPBC google/protobuf/descriptor.pb
+ $(Q) ./tools/upbc google/protobuf/descriptor.pb
$(E) PROTOC tests/json/test.proto
$(Q) protoc tests/json/test.proto -otests/json/test.proto.pb
$(E) UPBC tests/json/test.proto.pb
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback