CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc
CFLAGS_ALL = $(CFLAGS_C99FSE)
-CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I./src/internal -I./include -I./arch/$(ARCH)
+CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I./arch/$(ARCH) -I./src/internal -I./include
CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS)
CFLAGS_ALL_STATIC = $(CFLAGS_ALL)
CFLAGS_ALL_SHARED = $(CFLAGS_ALL) -fPIC -DSHARED -O3
$(DESTDIR)$(includedir)/%: include/%
install -D -m 644 $< $@
-$(DESTDIR)$(LDSO_PATHNAME): lib/libc.so
- install -d -m 755 $(DESTDIR)$(syslibdir) || true
+$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(syslibdir)
ln -sf $(libdir)/libc.so $@ || true
+$(DESTDIR)$(syslibdir):
+ install -d -m 755 $(DESTDIR)$(syslibdir)
+
.PRECIOUS: $(CRT_LIBS:lib/%=crt/%)
.PHONY: all clean install