mirror of git://git.musl-libc.org/musl
improve Makefile handling of git checkouts with missing lib/ and config.mak
This commit is contained in:
parent
187fe29d5b
commit
a36164c474
12
Makefile
12
Makefile
|
@ -54,6 +54,7 @@ clean:
|
||||||
rm -f include/bits
|
rm -f include/bits
|
||||||
|
|
||||||
include/bits:
|
include/bits:
|
||||||
|
@test "$(ARCH)" || { echo "Please set ARCH in config.mak before running make." ; exit 1 ; }
|
||||||
ln -sf ../arch/$(ARCH)/bits $@
|
ln -sf ../arch/$(ARCH)/bits $@
|
||||||
|
|
||||||
include/bits/alltypes.h.sh: include/bits
|
include/bits/alltypes.h.sh: include/bits
|
||||||
|
@ -73,19 +74,22 @@ include/bits/alltypes.h: include/bits/alltypes.h.sh
|
||||||
%.lo: %.c $(GENH)
|
%.lo: %.c $(GENH)
|
||||||
$(CC) $(CFLAGS) $(INC) $(PIC) -c -o $@ $<
|
$(CC) $(CFLAGS) $(INC) $(PIC) -c -o $@ $<
|
||||||
|
|
||||||
lib/libc.so: $(LOBJS)
|
lib:
|
||||||
|
mkdir -p lib
|
||||||
|
|
||||||
|
lib/libc.so: $(LOBJS) lib
|
||||||
$(CC) $(LDFLAGS) -o $@ $(LOBJS) -lgcc
|
$(CC) $(LDFLAGS) -o $@ $(LOBJS) -lgcc
|
||||||
$(OBJCOPY) --weaken $@
|
$(OBJCOPY) --weaken $@
|
||||||
|
|
||||||
lib/libc.a: $(OBJS)
|
lib/libc.a: $(OBJS) lib
|
||||||
rm -f $@
|
rm -f $@
|
||||||
$(AR) rc $@ $(OBJS)
|
$(AR) rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
$(EMPTY_LIBS):
|
$(EMPTY_LIBS): lib
|
||||||
$(AR) rc $@
|
$(AR) rc $@
|
||||||
|
|
||||||
lib/%.o: crt/%.o
|
lib/%.o: crt/%.o lib
|
||||||
cp $< $@
|
cp $< $@
|
||||||
|
|
||||||
tools/musl-gcc: tools/gen-musl-gcc.sh config.mak
|
tools/musl-gcc: tools/gen-musl-gcc.sh config.mak
|
||||||
|
|
Loading…
Reference in New Issue