From 2876225d0547ea7833991b9da8a72427e4bc69b9 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Mon, 28 Dec 2009 19:05:35 -0800 Subject: Force -Os for upb_def.o --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f8e75aa..d7b67a1 100644 --- a/Makefile +++ b/Makefile @@ -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) -- cgit v1.2.3