summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-12-28 19:05:35 -0800
committerJoshua Haberman <joshua@reverberate.org>2009-12-28 19:05:35 -0800
commit2876225d0547ea7833991b9da8a72427e4bc69b9 (patch)
treede2d06a135fdea90d49bf9ddc0c46ffeaed2ad9a /Makefile
parentafe911ea000c2a8c49be900bc21e38d640d4bef4 (diff)
Force -Os for upb_def.o
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
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)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback