provide declarations for strtod_l and family
[musl] / Makefile
index 6a86211..9206ca0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,7 @@ TOOL_LIBS = lib/musl-gcc.specs
 ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS)
 ALL_TOOLS = tools/musl-gcc
 
-LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH).so.1
+LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1
 
 -include config.mak
 
@@ -73,19 +73,35 @@ include/bits:
        @test "$(ARCH)" || { echo "Please set ARCH in config.mak before running make." ; exit 1 ; }
        ln -sf ../arch/$(ARCH)/bits $@
 
-include/bits/alltypes.h.sh: include/bits
+include/bits/alltypes.h.in: include/bits
 
-include/bits/alltypes.h: include/bits/alltypes.h.sh
-       sh $< > $@
+include/bits/alltypes.h: include/bits/alltypes.h.in include/alltypes.h.in tools/mkalltypes.sed
+       sed -f tools/mkalltypes.sed include/bits/alltypes.h.in include/alltypes.h.in > $@
 
 src/ldso/dynlink.lo: arch/$(ARCH)/reloc.h
 
+crt/crt1.o crt/Scrt1.o: $(wildcard arch/$(ARCH)/crt_arch.h)
+
+crt/Scrt1.o: CFLAGS += -fPIC
+
+OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=src/%))
+$(OPTIMIZE_SRCS:%.c=%.o) $(OPTIMIZE_SRCS:%.c=%.lo): CFLAGS += -O3
+
+MEMOPS_SRCS = src/string/memcpy.c src/string/memmove.c src/string/memcmp.c src/string/memset.c
+$(MEMOPS_SRCS:%.c=%.o) $(MEMOPS_SRCS:%.c=%.lo): CFLAGS += $(CFLAGS_MEMOPS)
+
+%.o: $(ARCH)$(ASMSUBARCH)/%.s
+       $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $<
+
 %.o: $(ARCH)/%.s
        $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $<
 
 %.o: %.c $(GENH) $(IMPH)
        $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $<
 
+%.lo: $(ARCH)$(ASMSUBARCH)/%.s
+       $(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $<
+
 %.lo: $(ARCH)/%.s
        $(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $<