enhance build process to allow selective -O3 optimization
[musl] / Makefile
index b9b7807..2cd2342 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -80,6 +80,9 @@ include/bits/alltypes.h: include/bits/alltypes.h.in include/alltypes.h.in tools/
 
 src/ldso/dynlink.lo: arch/$(ARCH)/reloc.h
 
+OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=src/%))
+$(OPTIMIZE_SRCS:%.c=%.o) $(OPTIMIZE_SRCS:%.c=%.lo): CFLAGS += -O3
+
 %.o: $(ARCH)/%.s
        $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $<