X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=Makefile;h=72b640a4020c12f2992625242f339e89629b6834;hp=15ab4fc4309f41983a01af0d7fb71648db1c3913;hb=58f430c1e0255c0b28aed1e9bf3d892c18c06631;hpb=3c870263c5a14b77628f83c06852a6f340b2443f diff --git a/Makefile b/Makefile index 15ab4fc4..72b640a4 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ GENH = include/bits/alltypes.h CFLAGS = -Os -nostdinc -ffreestanding -std=c99 -D_XOPEN_SOURCE=700 -pipe LDFLAGS = -nostdlib -shared -fPIC -Wl,-e,_start -Wl,-Bsymbolic-functions -INC = -I./include -I./src/internal -I./arch/$(ARCH) +INC = -I./src/internal -I./include -I./arch/$(ARCH) PIC = -fPIC -O3 AR = $(CROSS_COMPILE)ar RANLIB = $(CROSS_COMPILE)ranlib @@ -36,7 +36,8 @@ EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a) CRT_LIBS = lib/crt1.o lib/crti.o lib/crtn.o STATIC_LIBS = lib/libc.a $(EMPTY_LIBS) SHARED_LIBS = lib/libc.so -ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) +TOOL_LIBS = lib/musl-gcc.specs +ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(TOOL_LIBS) ALL_TOOLS = tools/musl-gcc LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH).so.1 @@ -93,8 +94,11 @@ $(EMPTY_LIBS): lib/%.o: crt/%.o cp $< $@ -tools/musl-gcc: tools/gen-musl-gcc.sh config.mak - sh $< "$(prefix)" "$(LDSO_PATHNAME)" > $@ || { rm -f $@ ; exit 1 ; } +lib/musl-gcc.specs: tools/musl-gcc.specs.sh config.mak + sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@ + +tools/musl-gcc: config.mak + printf '#!/bin/sh\nexec gcc "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@ chmod +x $@ $(DESTDIR)$(bindir)/%: tools/% @@ -110,7 +114,7 @@ $(DESTDIR)$(includedir)/%: include/% install -D -m 644 $< $@ $(DESTDIR)$(LDSO_PATHNAME): lib/libc.so - install -d -m 755 $(DESTDIR)$(syslibdir) + install -d -m 755 $(DESTDIR)$(syslibdir) || true ln -sf $(libdir)/libc.so $@ || true .PRECIOUS: $(CRT_LIBS:lib/%=crt/%)