C
[deliverable/binutils-gdb.git] / ld / Makefile.in
1 #
2 # Makefile for ld version 2
3 #
4 # $Id$
5 #
6
7 srcdir = .
8
9 destdir = /usr/local
10
11 version=`$(srcdir)/../gcc$(subdir)/gcc -dumpversion`
12 prefix = $(destdir)
13 bindir = $(prefix)/bin
14 libdir = $(prefix)/lib
15 libsubdir = $(libdir)/gcc/$(target)/$(version)
16
17 INSTALL = install -c
18 INSTALL_PROGRAM = $(INSTALL)
19 INSTALL_FILE = $(INSTALL)
20
21 BASEDIR = ../..
22 INCLUDE = $(srcdir)/../include
23 INCLUDES = -I. -I$(srcdir) -I$(INCLUDE)
24 DEBUG = -g
25
26 SCRIPTS = ld-gld68k.script ld-gld68k-Ur.script ld-gld68k-r.script \
27 ld-gld.script ld-gld-Ur.script ld-gld-r.script ld-lnk960.script \
28 ld-lnk960-r.script ld-gld960.script \
29 ld-gldm88kbcs.script ld-gldm88kbcs-Ur.script ld-gldm88kbcs-r.script
30
31 PROCESSED_SCRIPTS = ld-gld68k.x ld-gld68k-Ur.x ld-gld68k-r.x ld-gld.x \
32 ld-gld-Ur.x ld-gld-r.x ld-lnk960.x ld-lnk960-r.x ld-gld960.x \
33 ld-gldm88kbcs.x ld-gldm88kbcs-Ur.x ld-gldm88kbcs-r.x
34
35 #### target and host dependent Makefile fragments come in here.
36 ###
37
38 CFLAGS = $(INCLUDES) $(DEBUG) $(HDEFINES) $(TDEFINES) $(CDEFINES)
39 LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
40
41 .SUFFIXES: .y .x .script $(SUFFIXES)
42
43 .y.o:
44 $(YACC) $<
45 mv y.tab.c ldgram.tab.c
46 $(CC) -c $(CFLAGS) ldgram.tab.c
47 mv ldgram.tab.o ldgram.o
48
49 # go directly to ld.new in case this ld isn't capable of
50 # linking native object on this host. It can be renamed on
51 # install.
52 LD_PROG = ld.new
53
54 .script.x:
55 mkscript < $< >$*.x
56
57 # for self hosting
58 GNUTARGET=a.out-sunos-big
59 LDEMULATION=gld
60 BFDLIB=$(srcdir)/../bfd$(subdir)/libbfd.a
61 LIBIBERTY=$(srcdir)/../libiberty$(subdir)/libiberty.a
62
63 OFILES= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o ld-gld68k.o \
64 ld-gldm88kbcs.o \
65 ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ld-vanilla.o ldfile.o
66
67 HEADERS=config.h ldmain.h ldmain.h ldmisc.h ldsym.h ldlang.h ldexp.h \
68 ldlex.h ldwrite.h ldversion.h ld-emul.h ldfile.h ldgram.h ld.h
69
70 MANSOURCES=ld.tex
71
72 LDCSOURCES=ldlang.c ldmain.c ldwrite.c ld-lnk960.c ld-gld.c ld-gld68k.c \
73 ld-gldm88kbcs.c \
74 ld-gld960.c ld-emul.c ldversion.c ldmisc.c ldexp.c ldsym.c ldfile.c ld-vanilla.c
75
76 GENERATED_SOURCES=ldgram.tab.c ldlex.c ldgram.tab.h y.tab.h
77 GENERATED_HEADERS=ldgram.tab.h
78
79 LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l
80
81 BFDSOURCES=../../bfd/common/*.c
82
83 SOURCES= $(LDSOURCES) $(BFDSOURCES)
84 LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
85
86 STAGESTUFF = $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(PROCESSED_SCRIPTS) $(OFILES) $(LD_PROG) mkscript
87
88 all: Makefile $(PROCESSED_SCRIPTS) $(LD_PROG)
89
90 $(PROCESSED_SCRIPTS): mkscript $(SCRIPTS)
91
92
93 #$(BFDLIB): $(BFDSOURCES)
94 # (cd ../bfd; make)
95
96 $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
97 $(CC) $(CFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY)
98
99 # (cd ../bfd; make)
100 # LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-generic-big;./ldok -format a.out-generic-big -o ld /lib/crt0.o $(OFILES) $(BFDLIB) $(LIBIBERTY) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
101 # gld -o ld /lib/crt0.o $(OFILES) $(BFDLIB) $(LIBIBERTY) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
102 # $(CC) -Bstatic -o ld.new $(OFILES) $(BFDLIB) $(LIBIBERTY)
103
104
105 ld1: ld.new
106 $(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
107
108 ld2: ld1
109 $(HOSTING_EMU); ./ld1 -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
110
111 ld3: ld2
112 $(HOSTING_EMU); ./ld2 -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
113
114 ld.dvi:ld.tex
115 tex ld.tex
116
117 mkscript: mkscript.c
118
119 ldgram.o: ldgram.y
120 ldgram.tab.h:ldgram.y
121 cp y.tab.h ldgram.tab.h
122
123 ld-gld.o: $(PROCESSED_SCRIPTS) ld-gld.c
124
125 ldlex.c: ldlex.l ldgram.tab.h
126 ldlex.o: ldlex.c ldgram.tab.h
127
128 ldmain.o: ldmain.c
129 ldversion.o: ldversion.c
130 ldfile.o: ldfile.c
131 ldwrite.o: ldwrite.c
132 ldlang.o: ldlang.c ldgram.tab.h
133
134 ld-gld68k.o: $(PROCESSED_SCRIPTS) ld-gld68k.c
135 ld-gld960.o: $(PROCESSED_SCRIPTS) ld-gld960.c
136 ld-gldm88kbcs.o: $(PROCESSED_SCRIPTS) ld-gldm88kbcs.c
137 ld-emul.o: ld-emul.c
138 ld-vanilla.o: ld-vanilla.c
139 ld-lnk960.o: $(PROCESSED_SCRIPTS) ld-lnk960.c
140 ldexp.o: ldexp.c ldgram.tab.h
141 ldmisc.o: ldmisc.c
142 ldsym.o: ldsym.c
143
144 stage1: force
145 - mkdir stage1
146 - mv -f $(STAGESTUFF) stage1
147 - (cd stage1 ; ln -s $(LD_PROG) ld)
148
149 stage2: force
150 - mkdir stage2
151 - mv -f $(STAGESTUFF) stage2
152 - (cd stage2 ; ln -s $(LD_PROG) ld)
153
154 stage3: force
155 - mkdir stage3
156 - mv -f $(STAGESTUFF) stage3
157 - (cd stage3 ; ln -s $(LD_PROG) ld)
158
159 de-stage1: force
160 - (cd stage1 ; mv -f * ..)
161 - rm ld
162 - rmdir stage1
163
164 de-stage2: force
165 - (cd stage2 ; mv -f * ..)
166 - rm ld
167 - rmdir stage2
168
169 de-stage3: force
170 - (cd stage3 ; mv -f * ..)
171 - rm ld
172 - rmdir stage3
173
174 clean:
175 - rm -f TAGS $(OFILES) $(GENERATED_SOURCES) $(GENERATED_HEADERS)
176 - rm -f ld ld1 ld2 ld3 ld.new mkscript *.o y.output
177
178 lintlog:$(SOURCES) Makefile
179 $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
180 | grep -v "pointer casts may be troublesome" \
181 | grep -v "possible pointer alignment problem" \
182 | grep -v "ignore" \
183 | grep -v "conversion from long may lose accuracy" \
184 | grep -v "warning: constant argument to NOT" \
185 | grep -v "enumeration type clash, operator CAST" \
186 | grep -v "warning: constant in conditional context"\
187 | grep -v "archive\.c"
188
189
190 tags TAGS:$(SOURCES) $(HEADERS)
191 etags -t $(SOURCES) $(HEADERS)
192
193 release:
194 (cd /4/steve/ld; tar cf - $(LDSOURCES) $(HEADERS) $(MANSOURCES)) | tar xf -
195
196 objdump:objdump.c
197
198 install: $(LD_PROG)
199 $(INSTALL_PROGRAM) ld.new $(libsubdir)/ld
200
201 #-----------------------------------------------------------------------------
202 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
203 #
204 # 'VERSION' file must be present and contain a string of the form "x.y"
205 #-----------------------------------------------------------------------------
206
207 ver960.c: FORCE
208 rm -f ver960.c
209 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
210
211
212 # This target should be invoked before building a new release.
213 # 'VERSION' file must be present and contain a string of the form "x.y"
214 #
215 roll:
216 @V=`cat VERSION` ; \
217 MAJ=`sed 's/\..*//' VERSION` ; \
218 MIN=`sed 's/.*\.//' VERSION` ; \
219 V=$$MAJ.`expr $$MIN + 1` ; \
220 rm -f VERSION ; \
221 echo $$V >VERSION ; \
222 echo Version $$V
223
224 # Dummy target to force execution of dependent targets.
225 #
226 force:
227
228 # Target to uncomment host-specific lines in this makefile. Such lines must
229 # have the following string beginning in column 1: #__<hostname>__#
230 # Original Makefile is backed up as 'Makefile.old'.
231 #
232 # Invoke with: make make HOST=xxx
233 #
234 make:
235 -@if test $(HOST)x = x ; then \
236 echo '\aSpecify "make make HOST=???"'; \
237 exit 1; \
238 fi ; \
239 grep -s "^#The next line was generated by 'make make'" Makefile; \
240 if test $$? = 0 ; then \
241 echo "\aMakefile has already been processed with 'make make'";\
242 exit 1; \
243 fi ; \
244 mv -f Makefile Makefile.old; \
245 echo "#The next line was generated by 'make make'" >Makefile ; \
246 echo "HOST=$(HOST)" >>Makefile ; \
247 echo >>Makefile ; \
248 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
249
250 #\f
251
252 Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
253 (cd $(srcdir) ; \
254 ./configure +destdir=$(destdir) \
255 +norecurse \
256 `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
257 $(host) +target=$(target))
258
259 ### Local Variables: ***
260 ### mode:fundamental ***
261 ### page-delimiter: "^#\f" ***
262 ### End: ***
263 ### end of file
This page took 0.034985 seconds and 5 git commands to generate.