|
|
@ -85,7 +85,7 @@ dep: |
|
|
|
|
|
|
|
|
|
|
|
clean_leave_profile: |
|
|
|
clean_leave_profile: |
|
|
|
@rm -rf obj lib
|
|
|
|
@rm -rf obj lib
|
|
|
|
@rm -f tests/*.pb* tests/google_message?.h
|
|
|
|
@rm -f tests/google_message?.h
|
|
|
|
@rm -f $(TESTS) tests/testmain.o tests/t.*
|
|
|
|
@rm -f $(TESTS) tests/testmain.o tests/t.*
|
|
|
|
@rm -f upb/descriptor.pb
|
|
|
|
@rm -f upb/descriptor.pb
|
|
|
|
@rm -rf tools/upbc deps
|
|
|
|
@rm -rf tools/upbc deps
|
|
|
@ -115,8 +115,8 @@ clean: clean_leave_profile |
|
|
|
.SECONDEXPANSION: |
|
|
|
.SECONDEXPANSION: |
|
|
|
to_srcs = $(subst .,_,$(1)_SRCS)
|
|
|
|
to_srcs = $(subst .,_,$(1)_SRCS)
|
|
|
|
pc = %
|
|
|
|
pc = %
|
|
|
|
make_objs = $$(patsubst upb/$$(pc).c,obj/$$(pc).$(1),$$($$(call to_srcs,$$*)))
|
|
|
|
make_objs = $$(patsubst upb/$$(pc).c,obj/upb/$$(pc).$(1),$$($$(call to_srcs,$$*)))
|
|
|
|
make_objs_cc = $$(patsubst upb/$$(pc).cc,obj/$$(pc).$(1),$$($$(call to_srcs,$$*)))
|
|
|
|
make_objs_cc = $$(patsubst upb/$$(pc).cc,obj/upb/$$(pc).$(1),$$($$(call to_srcs,$$*)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Core libraries (ie. not bindings). ###############################################################
|
|
|
|
# Core libraries (ie. not bindings). ###############################################################
|
|
|
@ -146,8 +146,7 @@ upb_pb_SRCS = \ |
|
|
|
# If Lua is present we can use DynASM to regenerate the .h file.
|
|
|
|
# If Lua is present we can use DynASM to regenerate the .h file.
|
|
|
|
ifdef USE_JIT |
|
|
|
ifdef USE_JIT |
|
|
|
upb_pb_SRCS += upb/pb/compile_decoder_x64.c
|
|
|
|
upb_pb_SRCS += upb/pb/compile_decoder_x64.c
|
|
|
|
obj/pb/compile_decoder_x64.o obj/pb/compile_decoder_x64.lo: upb/pb/compile_decoder_x64.h |
|
|
|
obj/upb/pb/compile_decoder_x64.o obj/upb/pb/compile_decoder_x64.lo: upb/pb/compile_decoder_x64.h |
|
|
|
obj/pb/compile_decoder_x64.o: CFLAGS=-std=gnu99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
upb/pb/compile_decoder_x64.h: upb/pb/compile_decoder_x64.dasc |
|
|
|
upb/pb/compile_decoder_x64.h: upb/pb/compile_decoder_x64.dasc |
|
|
|
$(E) DYNASM $<
|
|
|
|
$(E) DYNASM $<
|
|
|
@ -168,11 +167,11 @@ ifeq (, $(findstring -O, $(USER_CPPFLAGS))) |
|
|
|
OPT = -O3
|
|
|
|
OPT = -O3
|
|
|
|
lib/libupb.a : OPT = -Os |
|
|
|
lib/libupb.a : OPT = -Os |
|
|
|
lib/libupb.descriptor.a : OPT = -Os |
|
|
|
lib/libupb.descriptor.a : OPT = -Os |
|
|
|
obj/pb/compile_decoder.o : OPT = -Os |
|
|
|
obj/upb/pb/compile_decoder.o : OPT = -Os |
|
|
|
obj/pb/compile_decoder_64.o : OPT = -Os |
|
|
|
obj/upb/pb/compile_decoder_64.o : OPT = -Os |
|
|
|
|
|
|
|
|
|
|
|
ifdef USE_JIT |
|
|
|
ifdef USE_JIT |
|
|
|
obj/pb/compile_decoder_x64.o: OPT=-Os |
|
|
|
obj/upb/pb/compile_decoder_x64.o: OPT=-Os |
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
endif |
|
|
|
endif |
|
|
@ -186,19 +185,19 @@ $(UPB_LIBS): lib/lib%.a: $(call make_objs,o) |
|
|
|
$(Q) mkdir -p lib && ar rcs $@ $^
|
|
|
|
$(Q) mkdir -p lib && ar rcs $@ $^
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
obj/%.o: upb/%.c | $$(@D)/. |
|
|
|
obj/upb/%.o: upb/%.c | $$(@D)/. |
|
|
|
$(E) CC $<
|
|
|
|
$(E) CC $<
|
|
|
|
$(Q) $(CC) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
|
|
|
$(Q) $(CC) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
|
|
|
|
obj/%.o: upb/%.cc | $$(@D)/. |
|
|
|
obj/upb/%.o: upb/%.cc | $$(@D)/. |
|
|
|
$(E) CXX $<
|
|
|
|
$(E) CXX $<
|
|
|
|
$(Q) $(CXX) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
$(Q) $(CXX) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
|
|
|
|
obj/%.lo: upb/%.c | $$(@D)/. |
|
|
|
obj/upb/%.lo: upb/%.c | $$(@D)/. |
|
|
|
$(E) 'CC -fPIC' $<
|
|
|
|
$(E) 'CC -fPIC' $<
|
|
|
|
$(Q) $(CC) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< -fPIC
|
|
|
|
$(Q) $(CC) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< -fPIC
|
|
|
|
|
|
|
|
|
|
|
|
obj/%.lo: upb/%.cc | $$(@D)/. |
|
|
|
obj/upb/%.lo: upb/%.cc | $$(@D)/. |
|
|
|
$(E) CXX $<
|
|
|
|
$(E) CXX $<
|
|
|
|
$(Q) $(CXX) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< -fPIC
|
|
|
|
$(Q) $(CXX) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< -fPIC
|
|
|
|
|
|
|
|
|
|
|
@ -315,7 +314,7 @@ clean_googlepb: |
|
|
|
googlepb: default $(GOOGLEPB_LIB) |
|
|
|
googlepb: default $(GOOGLEPB_LIB) |
|
|
|
googlepbtests: googlepb $(GOOGLEPB_TESTS) |
|
|
|
googlepbtests: googlepb $(GOOGLEPB_TESTS) |
|
|
|
|
|
|
|
|
|
|
|
lib/libupb.bindings.googlepb.a: $(upb_bindings_googlepb_SRCS:upb/%.cc=obj/%.o) |
|
|
|
lib/libupb.bindings.googlepb.a: $(upb_bindings_googlepb_SRCS:upb/%.cc=obj/upb/%.o) |
|
|
|
$(E) AR $@
|
|
|
|
$(E) AR $@
|
|
|
|
$(Q) mkdir -p lib && ar rcs $@ $^
|
|
|
|
$(Q) mkdir -p lib && ar rcs $@ $^
|
|
|
|
|
|
|
|
|
|
|
|