1 ## Process this file with automake to generate Makefile.in
3 AUTOMAKE_OPTIONS = cygnus
5 INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
7 AM_CCASFLAGS = $(INCLUDES)
9 noinst_LIBRARIES = lib.a
11 # _r.o is for the reentrant syscall stubs.
16 $(COMPILE) -DREENT -c $< -o $@
19 $(COMPILE) -DREENT -c $< -o $@
21 # We no longer copy files out of /lib/libc.a. This is kept around until
22 # most of them have replacements.
25 # Ovfork.o _sigvec.o abort.o access.o chown.o creat.o \
26 # errlst.o getdents.o getdtablesize.o getpid.o \
27 # getrusage.o gettimeofday.o ieee_globals.o ioctl.o isatty.o \
28 # kill.o popen.o sbrk.o sigblock.o sigpause.o sigsetmask.o \
29 # sigtramp.o sigvec.o sleep.o setitimer.o start_float.o \
30 # time.o times.o utime.o utimes.o wait3.o
33 # These files are from Sun's libc.a but must be renamed because they
34 # conflict with other library .o's. They are renamed to xxxS.o.
35 # div.o is used by times.o. errno.o conflicts with libc/errno/errno.o.
36 #COPYRENAMEOFILES = divS.o errnoS.o
39 #COPYOMFILES = ieee_flags.o
42 # CFILES_R, SFILES_R, and TEMPLATE_SFILES_R define those system calls that are
43 # needed by the ANSI C part of newlib (and thus we must provide namespace
44 # clean versions of them because we define REENTRANT_SYSCALLS_PROVIDED).
46 CFILES = _main.c ieee.c \
47 closedir.c opendir.c readdir.c rewinddir.c scandir.c seekdir.c \
49 creat.c isatty.c utime2.c
53 SFILES = cerror.S crt0.S dup2.S execve.S _exit.S sigsetjmp.S utime.S
55 SFILES_R = sbrk.S wait.S
57 # List of files built from template.S (with an '_' suffix).
59 TEMPLATE_SFILES = access_ chdir_ chmod_ chown_ dup_ fcntl_ \
60 lstat_ mkdir_ pipe_ rmdir_ times_ umask_ utimes_
62 TEMPLATE_SFILES_R = close_ fork_ fstat_ getpid_ gettimeofday_ kill_ \
63 link_ lseek_ open_ read_ stat_ times_ unlink_ wait4_ write_
65 OFILES = $(COPYOFILES) $(COPYRENAMEOFILES) $(COPYOMFILES) \
66 $(SFILES:.S=.o) $(SFILES_R:.S=.o) $(SFILES_R:.S=_r.o) \
67 $(TEMPLATE_SFILES:_=.o) $(TEMPLATE_SFILES_R:_=.o) $(TEMPLATE_SFILES_R:_=_r.o) \
68 $(CFILES:.c=.o) $(CFILES_R:.c=.o) $(CFILES_R:.c=_r.o)
70 lib_a_SOURCES = $(SFILES) $(SFILES_R) $(CFILES) $(CFILES_R)
71 lib_a_LIBADD = $(COPYOFILES) $(COPYRENAMEOFILES) $(COPYOMFILES) \
73 $(TEMPLATE_SFILES:_=.o) $(TEMPLATE_SFILES_R:_=.o) \
74 $(TEMPLATE_SFILES_R:_=_r.o) \
78 $(AR) x /lib/libc.a $(COPYOFILES)
81 $(AR) x /lib/libc.a $(COPYRENAMEOFILES:S.o=.o)
82 for f in $(COPYRENAMEOFILES); do mv `basename $$f S.o`.o $$f; done
85 $(AR) x /lib/libm.a $(COPYOMFILES)
87 stamp-srcs: Makefile template.S template_r.S
88 for f in $(TEMPLATE_SFILES:_=); do \
89 $(COMPILE) -E -Dfunc=$$f $(srcdir)/template.S >$$f.S; \
91 for f in $(TEMPLATE_SFILES_R:_=); do \
92 $(COMPILE) -E -Dfunc=$$f $(srcdir)/template_r.S | sed -e 's/^_/#/' >$$f.S; \
96 # Make a dependency for each file built from a template.
98 $(TEMPLATE_SFILES:_=.S) $(TEMPLATE_SFILES_R:_=.S): stamp-srcs
106 gettimeofday_r.o: gettimeofday.S
120 ACLOCAL_AMFLAGS = -I ../../..
121 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host