diff options
Diffstat (limited to 'newlib/Makefile.am')
-rw-r--r-- | newlib/Makefile.am | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/newlib/Makefile.am b/newlib/Makefile.am index 20ab1633b..e43b2e3d8 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -77,19 +77,25 @@ toollibdir = $(tooldir)/lib$(MULTISUBDIR) AR_FLAGS = rc +noinst_DATA = stmp-targ-include + if USE_LIBTOOL toollib_LTLIBRARIES = libm.la \ libc.la else toollib_LIBRARIES = libm.a \ libc.a +if HAVE_MULTISUBDIR +BUILD_MULTISUBDIR = $(builddir)$(MULTISUBDIR) +if HAVE_CRT0 +noinst_DATA += $(BUILD_MULTISUBDIR)/$(CRT0) +endif +noinst_DATA += $(BUILD_MULTISUBDIR)/libc.a $(BUILD_MULTISUBDIR)/libm.a +endif endif - -noinst_DATA = stmp-targ-include toollib_DATA = $(CRT0) $(CRT1) - # The functions ldexp, frexp and modf are traditionally supplied in # both libc.a and libm.a. We build them in libm.a and copy them over, # along with some required supporting routines. @@ -171,23 +177,40 @@ libc/libc.a: ; @true libm.a: libm/libm.a rm -f $@ - ln libm/libm.a $@ >/dev/null 2>/dev/null || cp libm/libm.a $@ + ln $< $@ >/dev/null 2>/dev/null || cp $< $@ libm/libm.a: ; @true endif # USE_LIBTOOL +if HAVE_MULTISUBDIR +$(BUILD_MULTISUBDIR): + $(MKDIR_P) $@ + +$(BUILD_MULTISUBDIR)/crt0.o: $(CRT0_DIR)$(CRT0) $(BUILD_MULTISUBDIR) + rm -f $@ + ln $< $@ >/dev/null 2>/dev/null || cp $< $@ + +$(BUILD_MULTISUBDIR)/libc.a: libc.a $(BUILD_MULTISUBDIR) + rm -f $@ $(BUILD_MULTISUBDIR)/libg.a + ln $< $@ >/dev/null 2>/dev/null || cp $< $@ + ln libg.a $(BUILD_MULTISUBDIR)/libg.a >/dev/null 2>/dev/null || \ + cp libg.a $(BUILD_MULTISUBDIR)/libg.a + +$(BUILD_MULTISUBDIR)/libm.a: libm.a $(BUILD_MULTISUBDIR) + rm -f $@ + ln $< $@ >/dev/null 2>/dev/null || cp $< $@ +endif + crt0.o: $(CRT0_DIR)$(CRT0) rm -f $@ - ln $(CRT0_DIR)$(CRT0) $@ >/dev/null 2>/dev/null \ - || cp $(CRT0_DIR)$(CRT0) $@ + ln $< $@ >/dev/null 2>/dev/null || cp $< $@ $(CRT0_DIR)$(CRT0): ; @true crt1.o: $(CRT1_DIR)$(CRT1) rm -f $@ - ln $< $@ >/dev/null 2>/dev/null \ - || cp $< $@ + ln $< $@ >/dev/null 2>/dev/null || cp $< $@ $(CRT1_DIR)$(CRT1): ; @true |