blob: 7f4deb8af4ae834310843e553543bc09e5a324a9 (
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
#
# Makefile for ld version 2
#
# $Id$
#
srcdir = .
destdir = /usr/local
version=`$(srcdir)/../gcc$(subdir)/gcc -dumpversion`
prefix = $(destdir)
bindir = $(prefix)/bin
libdir = $(prefix)/lib
libsubdir = $(libdir)/gcc/$(target)/$(version)
INSTALL = install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_FILE = $(INSTALL)
BASEDIR = ../..
HOSTDIR = ../$(HOST)/
INCLUDE = $(srcdir)/../include-cygnus
INCLUDES = -I. -I$(srcdir) -I$(INCLUDE)
DEBUG = -g
#__sun3__#EXTRA_DEF=-DHOST_SYS=SUN3_SYS
#__sun4__#EXTRA_DEF=-DHOST_SYS=SUN4_SYS
#__dgux__#EXTRA_DEF=-DHOST_SYS=DGUX_SYS
#### target and host dependent Makefile fragments come in here.
###
CFLAGS = $(INCLUDES) $(EXTRA_DEF) $(DEBUG) $(CDEFINES)
LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
.SUFFIXES: .y .x .script $(SUFFIXES)
.y.o:
$(YACC) $<
mv y.tab.c ldgram.tab.c
$(CC) -c $(CFLAGS) ldgram.tab.c
mv ldgram.tab.o ldgram.o
# go directly to ld.new in case this ld isn't capable of
# linking native object on this host. It can be renamed on
# install.
PROGS = $(HOSTDIR)/ld.new
MKSCRIPT = $(HOSTDIR)/mkscript
.script.x:
mkscript < $< >$*.x
# for self hosting
GNUTARGET=a.out-generic-big
LDEMULATION=gld
BFDLIB=$(srcdir)/../bfd$(subdir)/libbfd.a
OBJS= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o ld-gld68k.o \
ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ld-vanilla.o ldfile.o
HEADERS=config.h ldmain.h ldmain.h ldmisc.h ldsym.h ldlang.h ldexp.h \
ldlex.h ldwrite.h ldversion.h ld-emul.h ldfile.h ldgram.h ld.h
MANSOURCES=ld.tex
LDCSOURCES=ldlang.c ldmain.c ldwrite.c ld-lnk960.c ld-gld.c ld-gld68k.c \
ld-gld960.c ld-emul.c ldversion.c ldmisc.c ldexp.c ldsym.c ldfile.c ld-vanilla.c
GENERATED_SOURCES=ldgram.tab.c ldlex.c ldgram.tab.h y.tab.h
GENERATED_HEADERS=ldgram.tab.h
LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l
BFDSOURCES=../../bfd/common/*.c
SOURCES= $(LDSOURCES) $(BFDSOURCES)
LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
all: Makefile mkscript $(PROGS)
#$(BFDLIB): $(BFDSOURCES)
# (cd ../bfd; make)
$(PROGS): $(OBJS) $(BFDLIB)
# (cd ../bfd; make)
# LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-generic-big;./ldok -format a.out-generic-big -o ld /lib/crt0.o $(OBJS) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
# gld -o ld /lib/crt0.o $(OBJS) $(BFDLIB) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
$(CC) -Bstatic -o ld.new $(OBJS) $(BFDLIB)
ld1: ld.new
$(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) $(OBJS) $(BFDLIB) $(HOSTING_LIBS)
ld2: ld1
$(HOSTING_EMU); ./ld1 -o ld2 $(HOSTING_CRT0) $(OBJS) $(BFDLIB) $(HOSTING_LIBS)
ld3: ld2
$(HOSTING_EMU); ./ld2 -o ld3 $(HOSTING_CRT0) $(OBJS) $(BFDLIB) $(HOSTING_LIBS)
ld.dvi:ld.tex
tex ld.tex
SCRIPTS=ld-gld68k.script ld-gld68k-Ur.script ld-gld68k-r.script ld-gld.script ld-gld-Ur.script ld-gld-r.script ld-lnk960.script ld-lnk960-r.script ld-gld960.script
PROCESSED_SCRIPTS=ld-gld68k.x ld-gld68k-Ur.x ld-gld68k-r.x ld-gld.x ld-gld-Ur.x ld-gld-r.x ld-lnk960.x ld-lnk960-r.x ld-gld960.x
$(MKSCRIPT):mkscript.c $(SCRIPTS)
ldgram.o: ldgram.y
ldgram.tab.h:ldgram.y
cp y.tab.h ldgram.tab.h
ld-gld.o: $(PROCESSED_SCRIPTS) ld-gld.c
ldlex.c: ldlex.l ldgram.tab.h
ldlex.o: ldlex.c ldgram.tab.h
ldmain.o: ldmain.c
ldversion.o: ldversion.c
ldfile.o: ldfile.c
ldwrite.o: ldwrite.c
ldlang.o: ldlang.c ldgram.tab.h
ld-gld68k.o: $(PROCESSED_SCRIPTS) ld-gld68k.c
ld-gld960.o: $(PROCESSED_SCRIPTS) ld-gld960.c
ld-emul.o: ld-emul.c
ld-vanilla.o: ld-vanilla.c
ld-lnk960.o: $(PROCESSED_SCRIPTS) ld-lnk960.c
ldexp.o: ldexp.c ldgram.tab.h
ldmisc.o: ldmisc.c
ldsym.o: ldsym.c
clean:
- rm -f TAGS $(OBJS) $(GENERATED_SOURCES) $(GENERATED_HEADERS)
- rm -f ld ld1 ld2 ld3 ld.new
lintlog:$(SOURCES) Makefile
$(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
| grep -v "pointer casts may be troublesome" \
| grep -v "possible pointer alignment problem" \
| grep -v "ignore" \
| grep -v "conversion from long may lose accuracy" \
| grep -v "warning: constant argument to NOT" \
| grep -v "enumeration type clash, operator CAST" \
| grep -v "warning: constant in conditional context"\
| grep -v "archive\.c"
tags TAGS:$(SOURCES) $(HEADERS)
etags -t $(SOURCES) $(HEADERS)
release:
(cd /4/steve/ld; tar cf - $(LDSOURCES) $(HEADERS) $(MANSOURCES)) | tar xf -
objdump:objdump.c
install: $(PROGS)
$(INSTALL_PROGRAM) ld.new $(libsubdir)/ld
#-----------------------------------------------------------------------------
# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
#
# 'VERSION' file must be present and contain a string of the form "x.y"
#-----------------------------------------------------------------------------
ver960.c: FORCE
rm -f ver960.c
echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
# This target should be invoked before building a new release.
# 'VERSION' file must be present and contain a string of the form "x.y"
#
roll:
@V=`cat VERSION` ; \
MAJ=`sed 's/\..*//' VERSION` ; \
MIN=`sed 's/.*\.//' VERSION` ; \
V=$$MAJ.`expr $$MIN + 1` ; \
rm -f VERSION ; \
echo $$V >VERSION ; \
echo Version $$V
# Dummy target to force execution of dependent targets.
#
.force:
FORCE:
# Target to uncomment host-specific lines in this makefile. Such lines must
# have the following string beginning in column 1: #__<hostname>__#
# Original Makefile is backed up as 'Makefile.old'.
#
# Invoke with: make make HOST=xxx
#
make:
-@if test $(HOST)x = x ; then \
echo 'Specify "make make HOST=???"'; \
exit 1; \
fi ; \
grep -s "^#The next line was generated by 'make make'" Makefile; \
if test $$? = 0 ; then \
echo "Makefile has already been processed with 'make make'";\
exit 1; \
fi ; \
mv -f Makefile Makefile.old; \
echo "#The next line was generated by 'make make'" >Makefile ; \
echo "HOST=$(HOST)" >>Makefile ; \
echo >>Makefile ; \
sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
#
Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
(cd $(srcdir) ; \
./configure +destdir=$(destdir) \
+norecurse \
`if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
$(host) +target=$(target))
### Local Variables: ***
### mode:fundamental ***
### page-delimiter: "^#" ***
### End: ***
### end of file
|