blob: b4c4be69571ea2bcde76c1c3ec94505eae8030da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
# Makefile for libgloss/sparc/libsys
# Copyright (c) 1996 Cygnus Support.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# at Cygnus Support, Inc. Cygnus Support, Inc. may not be used to
# endorse or promote products derived from this software without
# specific prior written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
DESTDIR =
VPATH = @srcdir@
srcdir = @srcdir@
objdir = .
srcroot = $(srcdir)/../..
objroot = $(objdir)/../..
prefix = @prefix@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
target_alias = @target_alias@
bindir = @bindir@
libdir = @libdir@
tooldir = $(exec_prefix)/$(target_alias)
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
SHELL = /bin/sh
CC = @CC@
AS = @AS@
AR = @AR@
LD = @LD@
RANLIB = @RANLIB@
# _r.o is for the reentrant syscall stubs.
# The .S_r.o/.c_r.o rules are from host/any.
.SUFFIXES: .c .S .o _r.o
.S_r.o:
$(CC) $(CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS) -DREENT $(INCLUDES) -c $< -o $@
.c_r.o:
$(CC) $(CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS) -DREENT $(INCLUDES) -c $< -o $@
# CFILES_R, SFILES_R, and TEMPLATE_SFILES_R define those system calls that are
# needed by the ANSI C part of newlib when REENTRANT_SYSCALLS_PROVIDED is
# defined.
CFILES = isatty.c
CFILES_R =
SFILES = cerror.S _exit.S
SFILES_R = sbrk.S
# List of files built from template.S (with an '_' suffix).
TEMPLATE_SFILES = chdir_ lstat_
TEMPLATE_SFILES_R = close_ fstat_ getpid_ kill_ \
lseek_ open_ read_ stat_ unlink_ write_
# If newlib defines REENTRANT_SYSCALLS_PROVIDED, then these are used as well.
REENTRANT_OFILES = $(SFILES_R:.S=_r.o) $(TEMPLATE_SFILES_R:_=_r.o) \
$(CFILES_R:.c=_r.o)
OFILES = $(SFILES:.S=.o) $(SFILES_R:.S=.o) \
$(TEMPLATE_SFILES:_=.o) $(TEMPLATE_SFILES_R:_=.o) \
$(CFILES:.c=.o) $(CFILES_R:.c=.o) \
$(REENTRANT_OFILES)
#### Host specific Makefile fragment comes in here.
@host_makefile_frag@
all: libsys.a libsys-crt0.o
libsys.a: $(OFILES)
rm -f $@
$(AR) $(AR_FLAGS) $@ $(OFILES)
install:
$(INSTALL_DATA) libsys-crt0.o $(DESTDIR)$(tooldir)/lib/libsys-crt0.o
$(INSTALL_DATA) libsys.a $(DESTDIR)$(tooldir)/lib/libsys.a
doc:
.PHONY: info install-info clean-info
info:
install-info:
clean-info:
clean mostlyclean:
rm -f *.o *.a *.s stamp-srcs
distclean maintainer-clean realclean: clean
rm -f Makefile config.status
Makefile: Makefile.in config.status @host_makefile_frag_path@
$(SHELL) config.status
config.status: configure
$(SHELL) config.status --recheck
stamp-srcs: Makefile template.S template_r.S
for f in $(TEMPLATE_SFILES:_=) ; \
do \
$(CC) -E -Dfunc=$$f \
$(CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS) $(INCLUDES) \
$(srcdir)/template.S >$$f.S ; \
done
for f in $(TEMPLATE_SFILES_R:_=) ; \
do \
$(CC) -E -Dfunc=$$f \
$(CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS) $(INCLUDES) \
$(srcdir)/template_r.S | sed -e 's/^_/#/' >$$f.S ; \
done
touch stamp-srcs
# Make a dependency for each file built from a template.
$(TEMPLATE_SFILES:_=.S) $(TEMPLATE_SFILES_R:_=.S): stamp-srcs
# To support SunOS broken VPATH (sigh).
_exit.o: _exit.S
cerror.o: cerror.S
chdir.o: chdir.S
close.o: close.S
fstat.o: fstat.S
getpid.o: getpid.S
isatty.o: isatty.c
kill.o: kill.S
libsys-crt0.o: libsys-crt0.S
lseek.o: lseek.S
lstat.o: lstat.S
open.o: open.S
read.o: read.S
sbrk.o: sbrk.S
stat.o: stat.S
write.o: write.S
# Reentrant versions ...
# These are all needed to support the ANSI C library routines.
close_r.o: close.S
fstat_r.o: fstat.S
getpid_r.o: getpid.S
kill_r.o: kill.S
lseek_r.o: lseek.S
open_r.o: open.S
read_r.o: read.S
sbrk_r.o: sbrk.S
stat_r.o: stat.S
unlink_r.o: unlink.S
write_r.o: write.S
|