OSDN Git Service

* Makefile.shared: New file.
[pf3gnuchains/pf3gnuchains3x.git] / newlib / libc / stdlib / Makefile.in
index a955fb0..bed8d9e 100644 (file)
@@ -11,6 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
+
 SHELL = @SHELL@
 
 srcdir = @srcdir@
@@ -64,7 +65,9 @@ AS = @AS@
 CC = @CC@
 CPP = @CPP@
 CRT0 = @CRT0@
+DLLTOOL = @DLLTOOL@
 EXEEXT = @EXEEXT@
+LDFLAGS = @LDFLAGS@
 LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@
 LIBC_POSIX_LIB = @LIBC_POSIX_LIB@
 LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@
@@ -72,23 +75,27 @@ LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@
 LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@
 LIBC_SYS_LIB = @LIBC_SYS_LIB@
 LIBC_UNIX_LIB = @LIBC_UNIX_LIB@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
+OBJDUMP = @OBJDUMP@
 PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
 VERSION = @VERSION@
+aext = @aext@
+libm_machine_dir = @libm_machine_dir@
 machine_dir = @machine_dir@
 newlib_basedir = @newlib_basedir@
+oext = @oext@
 sys_dir = @sys_dir@
 
 AUTOMAKE_OPTIONS = cygnus
 
 INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
-noinst_LIBRARIES = lib.a
-
-lib_a_SOURCES = \
+LIB_SOURCES = \
        __adjust.c      \
        __exp10.c       \
        __ten_mu.c      \
@@ -165,11 +172,25 @@ lib_a_SOURCES = \
        wctomb_r.c
 
 
-lib_a_LIBADD = mallocr.o freer.o reallocr.o callocr.o cfreer.o malignr.o \
-       vallocr.o pvallocr.o mallinfor.o mallstatsr.o msizer.o malloptr.o
+# Because of how libtool moves objects around, mallocr must be built last.
+LIBADD_OBJS = freer.$(oext) reallocr.$(oext) callocr.$(oext) cfreer.$(oext) malignr.$(oext) \
+       vallocr.$(oext) pvallocr.$(oext) mallinfor.$(oext) mallstatsr.$(oext) msizer.$(oext) malloptr.$(oext) mallocr.$(oext)
 
 
-MALLOC_COMPILE = $(COMPILE) -DINTERNAL_NEWLIB
+libstdlib_la_LDFLAGS = -Xcompiler -nostdlib
+
+@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = @USE_LIBTOOL_TRUE@libstdlib.la
+@USE_LIBTOOL_TRUE@libstdlib_la_SOURCES = @USE_LIBTOOL_TRUE@$(LIB_SOURCES)
+@USE_LIBTOOL_TRUE@libstdlib_la_LIBADD = @USE_LIBTOOL_TRUE@$(LIBADD_OBJS)
+@USE_LIBTOOL_TRUE@LIB_COMPILE = @USE_LIBTOOL_TRUE@$(LTCOMPILE)
+@USE_LIBTOOL_FALSE@LIB_COMPILE = @USE_LIBTOOL_FALSE@$(CC)
+@USE_LIBTOOL_TRUE@noinst_DATA = @USE_LIBTOOL_TRUE@objectlist.awk.in
+@USE_LIBTOOL_FALSE@noinst_DATA = 
+@USE_LIBTOOL_FALSE@noinst_LIBRARIES = @USE_LIBTOOL_FALSE@lib.a
+@USE_LIBTOOL_FALSE@lib_a_SOURCES = @USE_LIBTOOL_FALSE@$(LIB_SOURCES)
+@USE_LIBTOOL_FALSE@lib_a_LIBADD = @USE_LIBTOOL_FALSE@$(LIBADD_OBJS)
+
+MALLOC_COMPILE = $(LIB_COMPILE) -DINTERNAL_NEWLIB
 
 CHEWOUT_FILES = \
        abort.def       \
@@ -222,26 +243,57 @@ LIBRARIES =  $(noinst_LIBRARIES)
 
 DEFS = @DEFS@ -I. -I$(srcdir) 
 CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
-lib_a_DEPENDENCIES =  mallocr.o freer.o reallocr.o callocr.o cfreer.o \
-malignr.o vallocr.o pvallocr.o mallinfor.o mallstatsr.o msizer.o \
-malloptr.o
-lib_a_OBJECTS =  __adjust.o __exp10.o __ten_mu.o abort.o abs.o assert.o \
-atexit.o atof.o atoff.o atoi.o atol.o bsearch.o calloc.o div.o \
-drand48.o dtoa.o dtoastub.o ecvtbuf.o efgcvt.o environ.o envlock.o \
-eprintf.o erand48.o exit.o getenv.o getenv_r.o getopt.o jrand48.o \
-labs.o lcong48.o ldiv.o ldtoa.o lrand48.o malign.o malloc.o mblen.o \
-mblen_r.o mbstowcs.o mbstowcs_r.o mbtowc.o mbtowc_r.o mlock.o mprec.o \
-mrand48.o msize.o mstats.o mtrim.o nrand48.o putenv.o putenv_r.o \
-qsort.o rand.o rand48.o rand_r.o realloc.o seed48.o setenv.o setenv_r.o \
-srand48.o strdup.o strdup_r.o strtod.o strtol.o strtoll.o strtoll_r.o \
-strtoul.o strtoull.o strtoull_r.o system.o valloc.o wcstombs.o \
-wcstombs_r.o wctomb.o wctomb_r.o
+@USE_LIBTOOL_FALSE@lib_a_DEPENDENCIES =  freer.$(oext) reallocr.$(oext) \
+@USE_LIBTOOL_FALSE@callocr.$(oext) cfreer.$(oext) malignr.$(oext) \
+@USE_LIBTOOL_FALSE@vallocr.$(oext) pvallocr.$(oext) mallinfor.$(oext) \
+@USE_LIBTOOL_FALSE@mallstatsr.$(oext) msizer.$(oext) malloptr.$(oext) \
+@USE_LIBTOOL_FALSE@mallocr.$(oext)
+@USE_LIBTOOL_FALSE@lib_a_OBJECTS =  __adjust.o __exp10.o __ten_mu.o \
+@USE_LIBTOOL_FALSE@abort.o abs.o assert.o atexit.o atof.o atoff.o \
+@USE_LIBTOOL_FALSE@atoi.o atol.o bsearch.o calloc.o div.o drand48.o \
+@USE_LIBTOOL_FALSE@dtoa.o dtoastub.o ecvtbuf.o efgcvt.o environ.o \
+@USE_LIBTOOL_FALSE@envlock.o eprintf.o erand48.o exit.o getenv.o \
+@USE_LIBTOOL_FALSE@getenv_r.o getopt.o jrand48.o labs.o lcong48.o \
+@USE_LIBTOOL_FALSE@ldiv.o ldtoa.o lrand48.o malign.o malloc.o mblen.o \
+@USE_LIBTOOL_FALSE@mblen_r.o mbstowcs.o mbstowcs_r.o mbtowc.o \
+@USE_LIBTOOL_FALSE@mbtowc_r.o mlock.o mprec.o mrand48.o msize.o \
+@USE_LIBTOOL_FALSE@mstats.o mtrim.o nrand48.o putenv.o putenv_r.o \
+@USE_LIBTOOL_FALSE@qsort.o rand.o rand48.o rand_r.o realloc.o seed48.o \
+@USE_LIBTOOL_FALSE@setenv.o setenv_r.o srand48.o strdup.o strdup_r.o \
+@USE_LIBTOOL_FALSE@strtod.o strtol.o strtoll.o strtoll_r.o strtoul.o \
+@USE_LIBTOOL_FALSE@strtoull.o strtoull_r.o system.o valloc.o wcstombs.o \
+@USE_LIBTOOL_FALSE@wcstombs_r.o wctomb.o wctomb_r.o
+LTLIBRARIES =  $(noinst_LTLIBRARIES)
+
+@USE_LIBTOOL_TRUE@libstdlib_la_DEPENDENCIES =  freer.$(oext) \
+@USE_LIBTOOL_TRUE@reallocr.$(oext) callocr.$(oext) cfreer.$(oext) \
+@USE_LIBTOOL_TRUE@malignr.$(oext) vallocr.$(oext) pvallocr.$(oext) \
+@USE_LIBTOOL_TRUE@mallinfor.$(oext) mallstatsr.$(oext) msizer.$(oext) \
+@USE_LIBTOOL_TRUE@malloptr.$(oext) mallocr.$(oext)
+@USE_LIBTOOL_TRUE@libstdlib_la_OBJECTS =  __adjust.lo __exp10.lo \
+@USE_LIBTOOL_TRUE@__ten_mu.lo abort.lo abs.lo assert.lo atexit.lo \
+@USE_LIBTOOL_TRUE@atof.lo atoff.lo atoi.lo atol.lo bsearch.lo calloc.lo \
+@USE_LIBTOOL_TRUE@div.lo drand48.lo dtoa.lo dtoastub.lo ecvtbuf.lo \
+@USE_LIBTOOL_TRUE@efgcvt.lo environ.lo envlock.lo eprintf.lo erand48.lo \
+@USE_LIBTOOL_TRUE@exit.lo getenv.lo getenv_r.lo getopt.lo jrand48.lo \
+@USE_LIBTOOL_TRUE@labs.lo lcong48.lo ldiv.lo ldtoa.lo lrand48.lo \
+@USE_LIBTOOL_TRUE@malign.lo malloc.lo mblen.lo mblen_r.lo mbstowcs.lo \
+@USE_LIBTOOL_TRUE@mbstowcs_r.lo mbtowc.lo mbtowc_r.lo mlock.lo mprec.lo \
+@USE_LIBTOOL_TRUE@mrand48.lo msize.lo mstats.lo mtrim.lo nrand48.lo \
+@USE_LIBTOOL_TRUE@putenv.lo putenv_r.lo qsort.lo rand.lo rand48.lo \
+@USE_LIBTOOL_TRUE@rand_r.lo realloc.lo seed48.lo setenv.lo setenv_r.lo \
+@USE_LIBTOOL_TRUE@srand48.lo strdup.lo strdup_r.lo strtod.lo strtol.lo \
+@USE_LIBTOOL_TRUE@strtoll.lo strtoll_r.lo strtoul.lo strtoull.lo \
+@USE_LIBTOOL_TRUE@strtoull_r.lo system.lo valloc.lo wcstombs.lo \
+@USE_LIBTOOL_TRUE@wcstombs_r.lo wctomb.lo wctomb_r.lo
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DATA =  $(noinst_DATA)
+
 DIST_COMMON =  Makefile.am Makefile.in
 
 
@@ -249,13 +301,13 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
 TAR = gtar
 GZIP_ENV = --best
-SOURCES = $(lib_a_SOURCES)
-OBJECTS = $(lib_a_OBJECTS)
+SOURCES = $(lib_a_SOURCES) $(libstdlib_la_SOURCES)
+OBJECTS = $(lib_a_OBJECTS) $(libstdlib_la_OBJECTS)
 
 all: all-redirect
 .SUFFIXES:
-.SUFFIXES: .S .c .def .o .s
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+.SUFFIXES: .S .c .def .lo .o .s
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(srcdir)/../../Makefile.shared
        cd $(top_srcdir) && $(AUTOMAKE) --cygnus stdlib/Makefile
 
 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
@@ -291,11 +343,42 @@ distclean-compile:
 
 maintainer-clean-compile:
 
+.c.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
 lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES)
        -rm -f lib.a
        $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
        $(RANLIB) lib.a
 
+mostlyclean-noinstLTLIBRARIES:
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+
+distclean-noinstLTLIBRARIES:
+
+maintainer-clean-noinstLTLIBRARIES:
+
+libstdlib.la: $(libstdlib_la_OBJECTS) $(libstdlib_la_DEPENDENCIES)
+       $(LINK)  $(libstdlib_la_LDFLAGS) $(libstdlib_la_OBJECTS) $(libstdlib_la_LIBADD) $(LIBS)
+
 tags: TAGS
 
 ID: $(HEADERS) $(SOURCES) $(LISP)
@@ -361,7 +444,7 @@ install-am: all-am
 install: install-am
 uninstall-am:
 uninstall: uninstall-am
-all-am: Makefile $(LIBRARIES)
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA)
 all-redirect: all-am
 install-strip:
        $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
@@ -379,23 +462,29 @@ distclean-generic:
 
 maintainer-clean-generic:
 mostlyclean-am:  mostlyclean-noinstLIBRARIES mostlyclean-compile \
+               mostlyclean-libtool mostlyclean-noinstLTLIBRARIES \
                mostlyclean-tags mostlyclean-generic
 
 mostlyclean: mostlyclean-am
 
-clean-am:  clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
+clean-am:  clean-noinstLIBRARIES clean-compile clean-libtool \
+               clean-noinstLTLIBRARIES clean-tags clean-generic \
                mostlyclean-am
 
 clean: clean-am
 
 distclean-am:  distclean-noinstLIBRARIES distclean-compile \
+               distclean-libtool distclean-noinstLTLIBRARIES \
                distclean-tags distclean-generic clean-am
+       -rm -f libtool
 
 distclean: distclean-am
 
 maintainer-clean-am:  maintainer-clean-noinstLIBRARIES \
-               maintainer-clean-compile maintainer-clean-tags \
-               maintainer-clean-generic distclean-am
+               maintainer-clean-compile maintainer-clean-libtool \
+               maintainer-clean-noinstLTLIBRARIES \
+               maintainer-clean-tags maintainer-clean-generic \
+               distclean-am
        @echo "This command is intended for maintainers to use;"
        @echo "it deletes files that may require special tools to rebuild."
 
@@ -404,7 +493,10 @@ maintainer-clean: maintainer-clean-am
 .PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
 clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
 mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile tags mostlyclean-tags distclean-tags \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool mostlyclean-noinstLTLIBRARIES \
+distclean-noinstLTLIBRARIES clean-noinstLTLIBRARIES \
+maintainer-clean-noinstLTLIBRARIES tags mostlyclean-tags distclean-tags \
 clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
 check-am installcheck-am installcheck install-info-am install-info \
 install-exec-am install-exec install-data-am install-data install-am \
@@ -413,40 +505,47 @@ mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
-mallocr.o: mallocr.c
+objectlist.awk.in: $(noinst_LTLIBRARIES)
+       -rm -f objectlist.awk.in
+       for i in `ls *.lo` ; \
+       do \
+         echo $$i `pwd`/$$i >> objectlist.awk.in ; \
+       done
+
+mallocr.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/mallocr.c -o $@
 
-freer.o: mallocr.c
+freer.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_FREE -c $(srcdir)/mallocr.c -o $@
 
-reallocr.o: mallocr.c
+reallocr.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/mallocr.c -o $@
 
-callocr.o: mallocr.c
+callocr.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/mallocr.c -o $@
 
-cfreer.o: mallocr.c
+cfreer.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_CFREE -c $(srcdir)/mallocr.c -o $@
 
-malignr.o: mallocr.c
+malignr.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/mallocr.c -o $@
 
-vallocr.o: mallocr.c
+vallocr.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/mallocr.c -o $@
 
-pvallocr.o: mallocr.c
+pvallocr.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/mallocr.c -o $@
 
-mallinfor.o: mallocr.c
+mallinfor.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/mallocr.c -o $@
 
-mallstatsr.o: mallocr.c
+mallstatsr.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/mallocr.c -o $@
 
-msizer.o: mallocr.c
+msizer.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/mallocr.c -o $@
 
-malloptr.o: mallocr.c
+malloptr.$(oext): mallocr.c
        $(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/mallocr.c -o $@
 
 .c.def:
@@ -456,25 +555,25 @@ malloptr.o: mallocr.c
 doc: $(CHEWOUT_FILES)
        cat $(srcdir)/stdlib.tex >> $(TARGETDOC)
 
-dtoa.o: dtoa.c mprec.h
-ldtoa.o: ldtoa.c mprec.h
-ecvtbuf.o: ecvtbuf.c mprec.h
-mbtowc_r.o: mbtowc_r.c mbctype.h
-       $(COMPILE) -c -fshort-enums $(srcdir)/mbtowc_r.c -o $@
-
-mprec.o: mprec.c mprec.h
-strtod.o: strtod.c mprec.h
-wctomb_r.o: wctomb_r.c mbctype.h
-drand48.o: drand48.c rand48.h
-erand48.o: erand48.c rand48.h
-jrand48.o: jrand48.c rand48.h
-lcong48.o: lcong48.c rand48.h
-lrand48.o: lrand48.c rand48.h
-mrand48.o: mrand48.c rand48.h
-nrand48.o: nrand48.c rand48.h
-rand48.o: rand48.c rand48.h
-seed48.o: seed48.c rand48.h
-srand48.o: srand48.c rand48.h
+dtoa.$(oext): dtoa.c mprec.h
+ldtoa.$(oext): ldtoa.c mprec.h
+ecvtbuf.$(oext): ecvtbuf.c mprec.h
+mbtowc_r.$(oext): mbtowc_r.c mbctype.h
+       $(LIB_COMPILE) -c -fshort-enums $(srcdir)/mbtowc_r.c -o $@
+
+mprec.$(oext): mprec.c mprec.h
+strtod.$(oext): strtod.c mprec.h
+wctomb_r.$(oext): wctomb_r.c mbctype.h
+drand48.$(oext): drand48.c rand48.h
+erand48.$(oext): erand48.c rand48.h
+jrand48.$(oext): jrand48.c rand48.h
+lcong48.$(oext): lcong48.c rand48.h
+lrand48.$(oext): lrand48.c rand48.h
+mrand48.$(oext): mrand48.c rand48.h
+nrand48.$(oext): nrand48.c rand48.h
+rand48.$(oext): rand48.c rand48.h
+seed48.$(oext): seed48.c rand48.h
+srand48.$(oext): srand48.c rand48.h
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.