diff options
-rw-r--r-- | Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -48,11 +48,17 @@ clean: # The core library (src/libupb.a) SRC=src/upb.c src/upb_parse.c src/upb_table.c src/upb_def.c src/upb_data.c \ descriptor/descriptor.c - #src/upb_serialize.c descriptor/descriptor.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. +src/upb_def.o: src/upb_def.c + $(CC) $(CFLAGS) $(CPPFLAGS) -Os -c -o $@ $< +src/upb_def.lo: src/upb_def.c + $(CC) $(CFLAGS) $(CPPFLAGS) -Os -c -o $@ $< -fPIC + STATICOBJ=$(patsubst %.c,%.o,$(SRC)) SHAREDOBJ=$(patsubst %.c,%.lo,$(SRC)) # building shared objects is like building static ones, except -fPIC is added. -%.lo : %.c ; $(CC) -fPIC $(CPPFLAGS) $(CFLAGS) -c -o $@ $< +%.lo : %.c ; $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< -fPIC $(LIBUPB): $(STATICOBJ) ar rcs $(LIBUPB) $(STATICOBJ) $(LIBUPB_PIC): $(SHAREDOBJ) |