Commit | Line | Data |
---|---|---|
ce4d59e2 | 1 | # Makefile for the GNU linker ld (version 2) |
3a9149a7 | 2 | # Copyright (C) 1989-1993 Free Software Foundation, Inc. |
ce4d59e2 SC |
3 | |
4 | # This file is part of GNU ld.. | |
5 | ||
6 | # This program is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2 of the License, or | |
9 | # (at your option) any later version. | |
10 | # | |
11 | # This program is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with this program; if not, write to the Free Software | |
18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | ||
eb02fd64 RP |
20 | |
21 | srcdir = . | |
3a9149a7 | 22 | objdir = . |
eb02fd64 | 23 | |
e06ba18d PB |
24 | prefix = /usr/local |
25 | ||
0bb95ac8 | 26 | program_transform_name = |
12fa72d4 SC |
27 | exec_prefix = $(prefix) |
28 | bindir = $(exec_prefix)/bin | |
29 | libdir = $(exec_prefix)/lib | |
034351e3 | 30 | tooldir = $(exec_prefix)/$(target_alias) |
e06ba18d | 31 | datadir = $(prefix)/lib |
12fa72d4 | 32 | mandir = $(prefix)/man |
e06ba18d PB |
33 | man1dir = $(mandir)/man1 |
34 | man2dir = $(mandir)/man2 | |
35 | man3dir = $(mandir)/man3 | |
36 | man4dir = $(mandir)/man4 | |
37 | man5dir = $(mandir)/man5 | |
38 | man6dir = $(mandir)/man6 | |
39 | man7dir = $(mandir)/man7 | |
40 | man8dir = $(mandir)/man8 | |
41 | man9dir = $(mandir)/man9 | |
12fa72d4 | 42 | infodir = $(prefix)/info |
e06ba18d PB |
43 | includedir = $(prefix)/include |
44 | docdir = $(datadir)/doc | |
173a0c3d | 45 | # We put the scripts in the directory $(scriptdir)/ldscripts. |
559d7baf RP |
46 | # We can't put the scripts in $(datadir) because the SEARCH_DIR |
47 | # directives need to be different for native and cross linkers. | |
173a0c3d | 48 | scriptdir = $(tooldir)/lib |
e06ba18d | 49 | |
2cbe4c5f HS |
50 | gcclibdir = $(libdir)/gcc/$(target_alias) |
51 | ||
e06ba18d PB |
52 | SHELL = /bin/sh |
53 | ||
e0d005f2 | 54 | INSTALL = `cd $(srcdir); pwd`/../install.sh -c |
e06ba18d PB |
55 | INSTALL_PROGRAM = $(INSTALL) |
56 | INSTALL_DATA = $(INSTALL) | |
5ebaf24b | 57 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' |
c97b9003 DZ |
58 | INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 |
59 | ||
e06ba18d PB |
60 | AR = ar |
61 | AR_FLAGS = qv | |
77b19d3d | 62 | CFLAGS = -g |
e06ba18d | 63 | MAKEINFO = makeinfo |
2412a768 | 64 | TEXI2DVI = texi2dvi |
e06ba18d | 65 | RANLIB = ranlib |
2412a768 | 66 | CC_FOR_BUILD=$(CC) |
bf3acf44 | 67 | BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi` |
2df68136 | 68 | LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi` |
8c32cf6e | 69 | |
12fa72d4 | 70 | #version=/`./../gcc/gcc -dumpversion` |
092df318 | 71 | version= |
8c32cf6e | 72 | |
ee17cac9 PB |
73 | # Seach path to override the default search path for -lfoo libraries. |
74 | # If LIB_PATH is empty, the ones in the script (if any) are left alone. | |
917bffa7 PB |
75 | # (The default is usually /lib:usr/lib:/usr/local/lib, unless building |
76 | # a cross-linker, in which case the default is empty. See genscripts.sh.) | |
ee17cac9 PB |
77 | # Otherwise, they are replaced with the ones given in LIB_PATH, |
78 | # which may have the form: LIB_PATH=/lib:/usr/local/lib | |
79 | LIB_PATH = | |
80 | ||
d17eb3db ILT |
81 | # Additional libraries which are used when ld is built native. This |
82 | # is set by some host makefile fragments. | |
83 | NATIVE_LIB_DIRS = | |
84 | ||
959eba20 JO |
85 | BASEDIR = $(srcdir)/.. |
86 | BFDDIR = $(BASEDIR)/bfd | |
87 | INCDIR = $(BASEDIR)/include | |
88 | INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) | |
2ee11735 | 89 | |
2412a768 RP |
90 | # What version of the manual to build |
91 | DOCVER = gen | |
92 | ||
8073190b | 93 | # Where to find texinfo.tex to format docn with TeX |
d17eb3db | 94 | TEXIDIR = $(srcdir)/../texinfo |
8d317d2a | 95 | |
959eba20 JO |
96 | # Where to find other docs needed to format with TeX |
97 | TEXINPUTS = $(TEXIDIR):$(BFDDIR)/doc:$(srcdir) | |
98 | ||
10a69a37 | 99 | # Whether to get roff to put indexing entries on stderr |
954ac2ea RP |
100 | TEXI2OPT = |
101 | # You neeed this to generate ld-index.ms (or .mm or .me) | |
102 | # TEXI2OPT = -i | |
8073190b | 103 | |
e06ba18d PB |
104 | TEXI2ROFF=texi2roff |
105 | ||
8073190b RP |
106 | # Which roff program to use to generate index for texi2roff'd doc |
107 | ROFF = groff | |
108 | ||
5cdea2ac SC |
109 | #stuff for self hosting (can be overridden in config file). |
110 | HOSTING_CRT0=/lib/crt0.o | |
8ddef552 DM |
111 | HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc |
112 | HOSTING_EMU=-m $(EMUL) | |
5cdea2ac | 113 | |
3a9149a7 JW |
114 | CXX = `if [ -f ../gcc/xgcc ] ; then \ |
115 | echo ../gcc/xgcc -B../gcc/; \ | |
116 | else echo gcc; \ | |
117 | fi` | |
118 | CXXFLAGS = -fgnu-linker | |
119 | ||
8a6665ae JW |
120 | # FIX_ME: using ../gcc/xgcc breaks the cdtest. |
121 | CXX= g++ | |
122 | ||
3a9149a7 JW |
123 | # Setup the testing framework, if you have one |
124 | RUNTEST = runtest | |
125 | RUNTEST_FLAGS = | |
126 | RUNTEST_CC = `if [ -f ../gcc/xgcc ] ; then \ | |
127 | echo ../gcc/xgcc -B../gcc/; \ | |
128 | else echo gcc; \ | |
129 | fi` | |
130 | RUNTEST_CFLAGS = $(CFLAGS) | |
131 | RUNTEST_CXX = `if [ -f ../gcc/xgcc ] ; then \ | |
132 | echo ../gcc/xgcc -B../gcc/; \ | |
133 | else echo gcc; \ | |
134 | fi` | |
108f145b | 135 | # FIX_ME: using ../gcc/xgcc breaks the cdtest. |
d17eb3db | 136 | RUNTEST_CXX = $(CXX) |
3a9149a7 | 137 | RUNTEST_CXXFLAGS = $(CXXFLAGS) |
c97b9003 | 138 | |
58bf66f9 KR |
139 | all: |
140 | ||
7e5c1057 | 141 | ### Host, target, and site specific Makefile fragments come in here. |
63545898 | 142 | #### |
2ee11735 | 143 | |
2ee11735 RP |
144 | LINTFLAGS = $(INCLUDES) $(EXTRA_DEF) |
145 | ||
565c93e9 DM |
146 | # The .cc suffix is used by `make check'. |
147 | ||
148 | .SUFFIXES: .y $(SUFFIXES) .cc | |
149 | ||
173a0c3d DM |
150 | # Suppress smart makes who think they know how to automake Yacc files |
151 | .y.c: | |
152 | ||
565c93e9 | 153 | .cc.o: |
3a9149a7 | 154 | $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(CFLAGS) $< |
565c93e9 | 155 | |
77b19d3d | 156 | .c.o: |
8ddef552 | 157 | $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS) $< |
c97b9003 | 158 | |
eb02fd64 RP |
159 | # go directly to ld.new in case this ld isn't capable of |
160 | # linking native object on this host. It can be renamed on | |
161 | # install. | |
e7921bd4 | 162 | LD_PROG = ld.new |
f78e2569 | 163 | |
eb02fd64 | 164 | # for self hosting |
959eba20 JO |
165 | BFDLIB = ../bfd/libbfd.a |
166 | LIBIBERTY = ../libiberty/libiberty.a | |
eb02fd64 | 167 | |
0750b974 | 168 | ALL_EMULATIONS=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \ |
63545898 | 169 | em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o em_hp3hpux.o \ |
4ab3a31f | 170 | em_h8300.o em_h8300h.o em_ebmon29k.o em_sun4.o em_gld960.o \ |
3c1af24d | 171 | em_m68kcoff.o em_st2000.o em_sa29200.o em_i386mach.o \ |
e637dcf0 | 172 | em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o em_i386bsd.o \ |
8ddef552 | 173 | em_mipsbig.o em_mipsbsd.o em_mipsidt.o em_vax.o em_h8500.o \ |
d17eb3db | 174 | em_hppaosf.o em_mipsidtl.o em_sh.o em_elf_i386.o em_alpha.o \ |
7b95fe96 | 175 | em_i386lynx.o em_m68klynx.o em_sparclynx.o \ |
58bf66f9 | 176 | $(OTHER_EMULATIONS) |
7e5c1057 | 177 | |
959eba20 JO |
178 | # This is now set by configure.in. |
179 | #EMULATION_OFILES=${ALL_EMULATIONS} | |
7e5c1057 | 180 | |
119afd7b | 181 | OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \ |
7e5c1057 | 182 | ldwarn.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldsym.o \ |
fc60e4f7 | 183 | ldfile.o relax.o lderror.o ${EMULATION_OFILES} |
eb02fd64 | 184 | |
ce4d59e2 SC |
185 | HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \ |
186 | ldsym.h ldctor.h ldlang.h ldexp.h \ | |
239d28f3 | 187 | ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h |
eb02fd64 RP |
188 | |
189 | MANSOURCES=ld.tex | |
190 | ||
119afd7b | 191 | LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \ |
63545898 | 192 | em_gld.c em_sun3.c em_go32.c em_m88k.c em_ebmon29k.c em_hppaosf.c \ |
2e2bf962 | 193 | ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \ |
fc60e4f7 | 194 | relax.c lderror.c |
eb02fd64 | 195 | |
ab57b174 | 196 | GENERATED_SOURCES=ldgram.c ldlex.c em_*.c ldemul-list.h |
7e5c1057 | 197 | GENERATED_HEADERS=ldgram.h ldemul-list.h |
eb02fd64 | 198 | |
cc964c6f | 199 | LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h |
eb02fd64 | 200 | |
2ee11735 | 201 | BFDSOURCES=../../bfd/common/*.c |
eb02fd64 RP |
202 | |
203 | SOURCES= $(LDSOURCES) $(BFDSOURCES) | |
204 | LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES) | |
205 | ||
959eba20 | 206 | STAGESTUFF = *.o ldscripts/* $(GENERATED_SOURCES) $(GENERATED_HEADERS) |
2ee11735 | 207 | |
42b5c739 | 208 | all: $(LD_PROG) |
e06ba18d PB |
209 | |
210 | info: ld.info | |
2ee11735 | 211 | |
173a0c3d | 212 | ldgram.h ldgram.c: ldgram.y |
5ff21fa5 | 213 | $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y |
31e54f5d RP |
214 | mv -f y.tab.c ldgram.c |
215 | mv -f y.tab.h ldgram.h | |
cc964c6f | 216 | |
a6152e39 | 217 | # EMUL is the name of a file in the emulparams subdir, without the .sh. |
42b5c739 ILT |
218 | DEF_EMUL = ` if [ -z "$(EMUL)" ] ; then \ |
219 | echo "you must set a default emulation" 1>&2 ; \ | |
220 | exit 1 ; \ | |
221 | else \ | |
222 | echo -DDEFAULT_EMULATION='"$(EMUL)"' ; \ | |
223 | fi` | |
42b5c739 | 224 | |
959eba20 JO |
225 | ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
226 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
227 | $(INCDIR)/fopen-same.h config.h ld.h \ | |
228 | ldmain.h ldmisc.h ldwrite.h ./ldgram.h \ | |
229 | ldsym.h ldlang.h ldemul.h ldlex.h \ | |
230 | ldfile.h ldindr.h ldwarn.h ldctor.h \ | |
231 | lderror.h | |
ff76a7db | 232 | $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(DEF_EMUL) -DSCRIPTDIR='"$(scriptdir)"' $(CFLAGS) $< |
7e5c1057 | 233 | |
820c446c | 234 | ldemul-list.h: Makefile |
7e5c1057 PB |
235 | (echo "/* This file is automatically generated. DO NOT EDIT! */";\ |
236 | for f in `echo " " ${EMULATION_OFILES} "" \ | |
ab57b174 | 237 | | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \ |
7e5c1057 PB |
238 | echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \ |
239 | done;\ | |
240 | echo "";\ | |
241 | echo "#define EMULATION_LIST \\";\ | |
242 | for f in `echo " " ${EMULATION_OFILES} "" \ | |
ab57b174 | 243 | | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \ |
7e5c1057 PB |
244 | echo " &ld_$${f}_emulation, \\"; \ |
245 | done;\ | |
246 | echo " 0") >ldemul-list.h | |
247 | ||
42b5c739 | 248 | ldlex.c: ldlex.l ldgram.h |
5ff21fa5 PB |
249 | $(LEX) -I -Cem $(srcdir)/ldlex.l |
250 | mv lex.yy.c ldlex.c | |
19b03b7a | 251 | |
ab57b174 | 252 | # These all start with em_ so 'make clean' can find them. |
c61b4184 | 253 | |
d17eb3db | 254 | GENSCRIPTS=$(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL} "$(NATIVE_LIB_DIRS)" |
8ddef552 | 255 | GEN_DEPENDS=$(srcdir)/genscripts.sh |
7e5c1057 | 256 | |
8ddef552 DM |
257 | em_sun4.c: $(srcdir)/emulparams/sun4.sh \ |
258 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 259 | ${GENSCRIPTS} sun4 |
8ddef552 DM |
260 | em_sun3.c: $(srcdir)/emulparams/sun3.sh \ |
261 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 262 | ${GENSCRIPTS} sun3 |
8ddef552 DM |
263 | em_go32.c: $(srcdir)/emulparams/go32.sh \ |
264 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 265 | ${GENSCRIPTS} go32 |
8ddef552 DM |
266 | em_news.c: $(srcdir)/emulparams/news.sh \ |
267 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 268 | ${GENSCRIPTS} news |
8ddef552 DM |
269 | em_vax.c: $(srcdir)/emulparams/vax.sh \ |
270 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 271 | ${GENSCRIPTS} vax |
8ddef552 DM |
272 | em_hp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \ |
273 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 274 | ${GENSCRIPTS} hp300bsd |
8ddef552 DM |
275 | em_hp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \ |
276 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 277 | ${GENSCRIPTS} hp3hpux |
8ddef552 DM |
278 | em_hppaosf.c: $(srcdir)/emulparams/hppaosf.sh \ |
279 | $(srcdir)/emultempl/hppaosf.em $(srcdir)/scripttempl/hppaosf.sc ${GEN_DEPENDS} | |
a6152e39 | 280 | ${GENSCRIPTS} hppaosf |
8ddef552 DM |
281 | em_i386aout.c: $(srcdir)/emulparams/i386aout.sh \ |
282 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 283 | ${GENSCRIPTS} i386aout |
3c1af24d KR |
284 | em_i386mach.c: $(srcdir)/emulparams/i386mach.sh \ |
285 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
286 | ${GENSCRIPTS} i386mach | |
8ddef552 DM |
287 | em_ebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \ |
288 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS} | |
a6152e39 | 289 | ${GENSCRIPTS} ebmon29k |
8ddef552 DM |
290 | em_sa29200.c: $(srcdir)/emulparams/sa29200.sh \ |
291 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS} | |
a6152e39 | 292 | ${GENSCRIPTS} sa29200 |
8ddef552 DM |
293 | em_a29k.c: $(srcdir)/emulparams/a29k.sh \ |
294 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS} | |
a6152e39 | 295 | ${GENSCRIPTS} a29k |
8ddef552 | 296 | em_m88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \ |
d301e438 | 297 | $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS} |
a6152e39 | 298 | ${GENSCRIPTS} m88kbcs |
8ddef552 DM |
299 | em_h8300.c: $(srcdir)/emulparams/h8300.sh \ |
300 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS} | |
a6152e39 | 301 | ${GENSCRIPTS} h8300 |
4ab3a31f DE |
302 | em_h8300h.c: $(srcdir)/emulparams/h8300h.sh \ |
303 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS} | |
a6152e39 | 304 | ${GENSCRIPTS} h8300h |
8ddef552 DM |
305 | em_h8500.c: $(srcdir)/emulparams/h8500.sh \ |
306 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS} | |
a6152e39 | 307 | ${GENSCRIPTS} h8500 |
8ddef552 DM |
308 | em_sh.c: $(srcdir)/emulparams/sh.sh \ |
309 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} | |
a6152e39 | 310 | ${GENSCRIPTS} sh |
8ddef552 DM |
311 | em_st2000.c: $(srcdir)/emulparams/st2000.sh \ |
312 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS} | |
a6152e39 | 313 | ${GENSCRIPTS} st2000 |
8ddef552 DM |
314 | em_z8ksim.c: $(srcdir)/emulparams/z8ksim.sh \ |
315 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8ksim.sc ${GEN_DEPENDS} | |
a6152e39 | 316 | ${GENSCRIPTS} z8ksim |
8ddef552 DM |
317 | em_vanilla.c: $(srcdir)/emulparams/vanilla.sh \ |
318 | $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS} | |
a6152e39 | 319 | ${GENSCRIPTS} vanilla |
8ddef552 DM |
320 | em_lnk960.c: $(srcdir)/emulparams/lnk960.sh \ |
321 | $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} | |
a6152e39 | 322 | ${GENSCRIPTS} lnk960 |
8ddef552 DM |
323 | em_gld960.c: $(srcdir)/emulparams/gld960.sh \ |
324 | $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} | |
a6152e39 | 325 | ${GENSCRIPTS} gld960 |
8ddef552 DM |
326 | em_m68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \ |
327 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS} | |
a6152e39 | 328 | ${GENSCRIPTS} m68kcoff |
d17eb3db ILT |
329 | em_m68klynx.c: $(srcdir)/emulparams/m68klynx.sh \ |
330 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS} | |
331 | ${GENSCRIPTS} m68klynx | |
8ddef552 DM |
332 | em_i386coff.c: $(srcdir)/emulparams/i386coff.sh \ |
333 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS} | |
a6152e39 | 334 | ${GENSCRIPTS} i386coff |
d17eb3db ILT |
335 | em_i386lynx.c: $(srcdir)/emulparams/i386lynx.sh \ |
336 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS} | |
337 | ${GENSCRIPTS} i386lynx | |
7b95fe96 SS |
338 | em_sparclynx.c: $(srcdir)/emulparams/sparclynx.sh \ |
339 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS} | |
340 | ${GENSCRIPTS} sparclynx | |
8ddef552 DM |
341 | em_mipslit.c: $(srcdir)/emulparams/mipslit.sh \ |
342 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} | |
a6152e39 | 343 | ${GENSCRIPTS} mipslit |
8ddef552 DM |
344 | em_i386bsd.c: $(srcdir)/emulparams/i386bsd.sh \ |
345 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 346 | ${GENSCRIPTS} i386bsd |
8ddef552 DM |
347 | em_mipsbig.c: $(srcdir)/emulparams/mipsbig.sh \ |
348 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} | |
a6152e39 | 349 | ${GENSCRIPTS} mipsbig |
8ddef552 DM |
350 | em_mipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \ |
351 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
a6152e39 | 352 | ${GENSCRIPTS} mipsbsd |
8ddef552 DM |
353 | em_mipsidt.c: $(srcdir)/emulparams/mipsidt.sh \ |
354 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} | |
a6152e39 | 355 | ${GENSCRIPTS} mipsidt |
8ddef552 DM |
356 | em_mipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \ |
357 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} | |
a6152e39 | 358 | ${GENSCRIPTS} mipsidtl |
d17eb3db ILT |
359 | em_elf_i386.c: $(srcdir)/emulparams/elf_i386.sh \ |
360 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} | |
361 | ${GENSCRIPTS} elf_i386 | |
362 | em_elf32mipb.c: $(srcdir)/emulparams/elf32mipb.sh \ | |
363 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} | |
364 | ${GENSCRIPTS} elf32mipb | |
365 | em_alpha.c: $(srcdir)/emulparams/alpha.sh \ | |
366 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS} | |
367 | ${GENSCRIPTS} alpha | |
eb02fd64 | 368 | |
e77463a1 | 369 | $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY) |
d17eb3db ILT |
370 | $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES) |
371 | ||
372 | # The generated emulation files mostly have the same dependencies. | |
373 | $(EMULATION_OFILES): ../bfd/bfd.h ../bfd/sysdep.h ld.h ldemul.h \ | |
374 | ldfile.h ldmisc.h config.h | |
959eba20 JO |
375 | |
376 | # This list of dependencies was generated by doing a make with gcc -MM | |
377 | # saving the output in a file and removing the gcc commands | |
378 | # changing "../../devo/ld/../bfd" to "$(BFDDIR)" | |
379 | # removing "../../devo/ld/" | |
380 | # changing "../include" to "$(INCDIR)" | |
381 | ||
382 | ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \ | |
383 | ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h $(INCDIR)/fopen-same.h \ | |
384 | ld.h ldexp.h ldver.h ldlang.h \ | |
385 | ldemul.h ldfile.h ldmisc.h mri.h | |
386 | ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/obstack.h ./ldgram.h | |
387 | lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
388 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
389 | $(INCDIR)/fopen-same.h ldlex.h ld.h \ | |
390 | ldexp.h ./ldgram.h ldmisc.h | |
391 | ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
392 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
393 | $(INCDIR)/fopen-same.h ld.h ldmain.h \ | |
394 | ldsym.h ./ldgram.h ldwarn.h ldlang.h \ | |
395 | ldexp.h ldemul.h ldlex.h ldmisc.h \ | |
396 | ldindr.h ldctor.h | |
397 | mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
398 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
399 | $(INCDIR)/fopen-same.h ld.h ldlang.h \ | |
400 | mri.h ./ldgram.h ldexp.h | |
401 | ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
402 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
403 | $(INCDIR)/fopen-same.h ld.h ldlang.h \ | |
404 | ldsym.h ldmisc.h ldexp.h ./ldgram.h | |
405 | ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
406 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
407 | $(INCDIR)/fopen-same.h config.h ld.h \ | |
408 | ldmain.h ldmisc.h ldwrite.h ./ldgram.h \ | |
409 | ldsym.h ldlang.h ldemul.h ldlex.h \ | |
410 | ldfile.h ldindr.h ldwarn.h ldctor.h \ | |
411 | lderror.h | |
412 | ldindr.o: ldindr.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
413 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
414 | $(INCDIR)/fopen-same.h ld.h ldsym.h \ | |
415 | ldmisc.h | |
416 | ldwarn.o: ldwarn.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
417 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
418 | $(INCDIR)/fopen-same.h ldsym.h ldwarn.h \ | |
419 | ldmisc.h | |
420 | ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
421 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
422 | $(INCDIR)/fopen-same.h ldlang.h ld.h \ | |
423 | ldwrite.h ldmisc.h ldsym.h ./ldgram.h \ | |
424 | relax.h | |
425 | ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
426 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
427 | $(INCDIR)/fopen-same.h ld.h ldmain.h \ | |
428 | ldmisc.h ldexp.h ./ldgram.h ldsym.h \ | |
429 | ldlang.h | |
430 | ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
431 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
432 | $(INCDIR)/fopen-same.h config.h ld.h \ | |
433 | ldemul.h ldmisc.h ./ldemul-list.h | |
434 | ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
435 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
436 | $(INCDIR)/fopen-same.h ldver.h ldemul.h | |
437 | ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
438 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
439 | $(INCDIR)/fopen-same.h ld.h ldmisc.h \ | |
440 | ldlang.h ldlex.h | |
441 | ldsym.o: ldsym.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
442 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
443 | $(INCDIR)/fopen-same.h ld.h ldsym.h \ | |
444 | ldmisc.h ldlang.h | |
445 | ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
446 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
447 | $(INCDIR)/fopen-same.h ldmisc.h ldlang.h \ | |
448 | ldfile.h | |
449 | relax.o: relax.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
450 | $(INCDIR)/obstack.h $(BFDDIR)/seclet.h $(INCDIR)/coff/internal.h \ | |
451 | ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h $(INCDIR)/fopen-same.h \ | |
452 | ldlang.h ld.h ldwrite.h ldmisc.h \ | |
453 | ldsym.h ./ldgram.h relax.h | |
454 | lderror.o: lderror.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ | |
455 | $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \ | |
456 | $(INCDIR)/fopen-same.h $(BFDDIR)/seclet.h ld.h \ | |
457 | ldmisc.h | |
8ddef552 | 458 | |
3a9149a7 JW |
459 | # CYGNUS LOCAL targets. |
460 | # These targets are for the dejagnu testsuites. The file site.exp | |
461 | # contains global variables that all the testsuites will use. | |
462 | # There is a current debate as to how and where to generate test | |
463 | # outputs. Rob feels each test should be built in $(objdir) with | |
464 | # a unique name. Cassidy feels that we should create a directory | |
465 | # called $(objdir)/tmpdir and do the work there. This way, there | |
466 | # is no potential conflict with existing objects, ie: as there | |
467 | # was in the past with loop.o and flow.o, and, there is no chance | |
468 | # of filling /tmp, which would cause other problems. Lastly, this | |
469 | # allow retention of the testcase name making debugging easier. | |
470 | # | |
471 | testdir = $(objdir)/tmpdir | |
472 | ||
d301e438 | 473 | site.exp: ./config.status Makefile |
3a9149a7 | 474 | @if [ -d $(testdir) ]; then true; else mkdir $(testdir); fi |
d301e438 | 475 | @echo "Making a new config file..." |
3a9149a7 | 476 | @rm -f ./tmp? |
d301e438 | 477 | @touch site.exp |
3a9149a7 | 478 | @mv site.exp site.bak |
d301e438 JW |
479 | @echo "## variables are automatically generated by make ##" > ./tmp0 |
480 | @echo "# Do not edit here. If you wish to override these" >> ./tmp0 | |
481 | @echo "# values, add them to the last section" >> ./tmp0 | |
3a9149a7 JW |
482 | @echo "# HOST AND TARGET INFO" >> ./tmp0 |
483 | @echo "set host_os $(host_os)" >> ./tmp0 | |
484 | @echo "set host_alias $(host_alias)" >> ./tmp0 | |
485 | @echo "set host_cpu $(host_cpu)" >> ./tmp0 | |
486 | @echo "set host_vendor $(host_vendor)" >> ./tmp0 | |
487 | @echo "set target_os $(target_os)" >> ./tmp0 | |
488 | @echo "set target_alias $(target_alias)" >> ./tmp0 | |
489 | @echo "set target_cpu $(target_cpu)" >> ./tmp0 | |
490 | @echo "set target_vendor $(target_vendor)" >> ./tmp0 | |
491 | @echo "set host_triplet $(host_canonical)" >> ./tmp0 | |
492 | @echo "set target_triplet $(target_canonical)" >> ./tmp0 | |
493 | @echo "# DIRECTORY INFO" >> ./tmp0 | |
d301e438 | 494 | @echo "set objdir `pwd`" >> ./tmp0 |
3a9149a7 | 495 | @echo "set tmpdir `cd $(testdir); pwd`" >> ./tmp0 |
d301e438 JW |
496 | @echo "" >> ./tmp0 |
497 | @echo "# LD DEPENDANCIES" >> ./tmp0 | |
3a9149a7 JW |
498 | @echo "set OFILES \"$(OFILES)\"" >> ./tmp0 |
499 | @echo "set BFDLIB \"$(BFDLIB)\"" >> ./tmp0 | |
500 | @echo "set LIBIBERTY \"$(LIBIBERTY)\"" >> ./tmp0 | |
501 | @echo "set HOSTING_EMU \"$(HOSTING_EMU)\"" >> ./tmp0 | |
502 | @echo "set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> ./tmp0 | |
503 | @echo "set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> ./tmp0 | |
d301e438 JW |
504 | @echo "" >> ./tmp0 |
505 | @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0 | |
506 | @cat ./tmp0 > site.exp | |
507 | @cat site.bak | sed \ | |
508 | -e '1,/^## Variables generated by.*##/ d' >> site.exp | |
509 | -@rm -f ./tmp? | |
8ddef552 | 510 | |
959eba20 | 511 | check: ld.new site.exp |
3a9149a7 JW |
512 | $(RUNTEST) --tool ld \ |
513 | --srcdir $(srcdir)/testsuite $(RUNTEST_FLAGS) \ | |
514 | CC="$(RUNTEST_CC)" CFLAGS="$(RUNTEST_CFLAGS)" \ | |
515 | CXX="$(RUNTEST_CXX)" CXXFLAGS="$(RUNTEST_CXXFLAGS)" | |
d301e438 | 516 | |
8ddef552 | 517 | installcheck: |
e7921bd4 | 518 | |
7e5c1057 | 519 | # Rules for testing by relinking ld itself. |
eb02fd64 | 520 | |
7e5c1057 | 521 | ld-partial.o: ld.new |
a04f1d00 | 522 | ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES) |
7e5c1057 | 523 | ld1: ld-partial.o |
a04f1d00 | 524 | ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 525 | |
7e5c1057 | 526 | ld1-full: ld.new |
a04f1d00 | 527 | ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 528 | |
d20fb445 | 529 | ld2: ld1 |
a04f1d00 | 530 | ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
60048a2c | 531 | |
eb02fd64 | 532 | ld3: ld2 |
a04f1d00 | 533 | ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 534 | |
d20fb445 SC |
535 | bootstrap: ld3 |
536 | cmp ld2 ld3 | |
537 | ||
8ddef552 DM |
538 | # A test program for C++ constructors and destructors. |
539 | ||
ef868186 | 540 | cdtest: cdtest-main.o cdtest-func.o cdtest-foo.o ld.new |
a04f1d00 | 541 | ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \ |
917bffa7 PB |
542 | cdtest-main.o cdtest-func.o cdtest-foo.o $(HOSTING_LIBS) |
543 | ||
544 | check-cdtest: cdtest $(srcdir)/cdtest.exp | |
545 | ./cdtest >cdtest.out | |
546 | diff $(srcdir)/cdtest.exp cdtest.out | |
d301e438 | 547 | # END OF CHECK TARGETS |
917bffa7 | 548 | |
8073190b | 549 | # DOCUMENTATION TARGETS |
2412a768 RP |
550 | # Manual configuration file; not usually attached to normal configuration, |
551 | # because almost all configs use "gen" version of manual. | |
552 | # Set DOCVER above to change. | |
553 | configdoc.texi: ${DOCVER}-doc.texi | |
034351e3 PB |
554 | ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \ |
555 | ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \ | |
556 | cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi | |
2412a768 | 557 | |
8073190b | 558 | # TeX output |
2412a768 | 559 | dvi: ld.dvi |
4ecfad79 KR |
560 | ld.dvi: $(srcdir)/ld.texinfo $(srcdir)/configdoc.texi $(BFDDIR)/doc/bfdsumm.texi |
561 | $(TEXI2DVI) -I$(BFDDIR)/doc $(srcdir)/ld.texinfo | |
2412a768 | 562 | |
4b91c519 | 563 | ldint.dvi: $(srcdir)/ldint.texinfo |
2412a768 | 564 | $(TEXI2DVI) $(srcdir)/ldint.texinfo |
8d317d2a | 565 | |
8073190b | 566 | # info file for online browsing |
4ecfad79 | 567 | ld.info: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi |
959eba20 | 568 | $(MAKEINFO) -I$(BFDDIR)/doc -o ld.info $(srcdir)/ld.texinfo |
eb02fd64 | 569 | |
4b91c519 PB |
570 | ldint.info: $(srcdir)/ldint.texinfo |
571 | $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo | |
572 | ||
954ac2ea | 573 | #separate targets for "ms", "me", and "mm" forms of roff doc |
e06ba18d PB |
574 | # Try to use a recent texi2roff. v2 was put on prep in jan91. |
575 | # If you want an index, see texi2roff doc for postprocessing | |
576 | # and add -i to texi2roff invocations below. | |
577 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
578 | # correspondint -e lines when later texi2roff's are current) | |
579 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. | |
580 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
581 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
582 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
583 | ||
9c7810d6 | 584 | ld.ms: $(srcdir)/ld.texinfo |
8073190b RP |
585 | sed -e '/\\input texinfo/d' \ |
586 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
e06ba18d PB |
587 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
588 | -e '/^@c/d' \ | |
589 | -e 's/{.*,,/{/' \ | |
590 | -e 's/@ / /g' \ | |
591 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
592 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
9c7810d6 | 593 | $(srcdir)/ld.texinfo | \ |
e06ba18d PB |
594 | $(TEXI2ROFF) $(TEXI2OPT) -ms | \ |
595 | sed -e 's/---/\\(em/g' \ | |
596 | >>ld.ms | |
8073190b RP |
597 | |
598 | # index for roff output | |
599 | ld-index.ms: ld.ms | |
600 | $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \ | |
601 | sed -e '/: warning:/d' | \ | |
602 | texi2index >ld-index.ms | |
603 | ||
954ac2ea | 604 | # roff output (-mm) |
9c7810d6 | 605 | ld.mm: $(srcdir)/ld.texinfo |
954ac2ea RP |
606 | sed -e '/\\input texinfo/d' \ |
607 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
e06ba18d PB |
608 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
609 | -e '/^@c/d' \ | |
9c7810d6 RP |
610 | -e 's/{.*,,/{/' \ |
611 | -e '/@noindent/d' \ | |
e06ba18d PB |
612 | -e 's/@ / /g' \ |
613 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
614 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
9c7810d6 | 615 | $(srcdir)/ld.texinfo | \ |
e06ba18d | 616 | $(TEXI2ROFF) $(TEXI2OPT) -mm | \ |
9c7810d6 RP |
617 | sed -e 's/---/\\(em/g' \ |
618 | >ld.mm | |
954ac2ea RP |
619 | |
620 | # index for roff output | |
621 | ld-index.mm: ld.mm | |
622 | $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \ | |
623 | sed -e '/: warning:/d' | \ | |
624 | texi2index >ld-index.mm | |
625 | ||
626 | # roff output (-me) | |
9c7810d6 | 627 | ld.me: $(srcdir)/ld.texinfo |
954ac2ea RP |
628 | sed -e '/\\input texinfo/d' \ |
629 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
e06ba18d PB |
630 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
631 | -e '/^@c/d' \ | |
632 | -e 's/{.*,,/{/' \ | |
633 | -e 's/@ / /g' \ | |
634 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
635 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
9c7810d6 | 636 | $(srcdir)/ld.texinfo | \ |
e06ba18d PB |
637 | $(TEXI2ROFF) $(TEXI2OPT) -me | \ |
638 | sed -e 's/---/\\(em/g' \ | |
639 | >>ld.me | |
954ac2ea RP |
640 | |
641 | # index for roff output | |
642 | ld-index.me: ld.me | |
643 | $(ROFF) -me ld.me 2>&1 1>/dev/null | \ | |
644 | sed -e '/: warning:/d' | \ | |
645 | texi2index >ld-index.me | |
646 | ||
e7921bd4 | 647 | stage1: force |
e06ba18d | 648 | -mkdir stage1 |
ab57b174 | 649 | -mv -f $(STAGESTUFF) $(LD_PROG) stage1 |
e06ba18d | 650 | -(cd stage1 ; ln -s $(LD_PROG) ld) |
f78e2569 | 651 | |
e7921bd4 | 652 | stage2: force |
e06ba18d | 653 | -mkdir stage2 |
ab57b174 | 654 | -mv -f $(STAGESTUFF) $(LD_PROG) stage2 |
e06ba18d | 655 | -(cd stage2 ; ln -s $(LD_PROG) ld) |
f78e2569 | 656 | |
e7921bd4 | 657 | stage3: force |
e06ba18d | 658 | -mkdir stage3 |
ab57b174 | 659 | -mv -f $(STAGESTUFF) $(LD_PROG) stage3 |
e06ba18d | 660 | -(cd stage3 ; ln -s $(LD_PROG) ld) |
eb02fd64 | 661 | |
e46cdcdd RP |
662 | against=stage2 |
663 | ||
664 | comparison: force | |
ab57b174 | 665 | for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done |
e46cdcdd | 666 | |
e7921bd4 | 667 | de-stage1: force |
e06ba18d PB |
668 | -(cd stage1 ; mv -f * ..) |
669 | -rm ld | |
670 | -rmdir stage1 | |
e7921bd4 RP |
671 | |
672 | de-stage2: force | |
e06ba18d PB |
673 | -(cd stage2 ; mv -f * ..) |
674 | -rm ld | |
675 | -rmdir stage2 | |
e7921bd4 RP |
676 | |
677 | de-stage3: force | |
e06ba18d PB |
678 | -(cd stage3 ; mv -f * ..) |
679 | -rm ld | |
680 | -rmdir stage3 | |
e7921bd4 | 681 | |
ab57b174 | 682 | # Stuff that should be included in a distribution: |
63545898 | 683 | LDDISTSTUFF=ldgram.c ldgram.h ldlex.c |
ab57b174 ILT |
684 | diststuff: $(LDDISTSTUFF) |
685 | ||
686 | mostlyclean: | |
687 | -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp] | |
917bffa7 | 688 | -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out |
ab57b174 ILT |
689 | clean: mostlyclean |
690 | -rm -f $(LD_PROG) | |
3c1af24d KR |
691 | distclean: |
692 | -rm -fr Makefile config.status TAGS sysdep.h ldscripts site.exp \ | |
693 | $(STAGESTUFF) ld.?? ld.??s ld.toc ld.aux ld.log ldlex.[qp] \ | |
694 | $(LD_PROG) ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out | |
695 | realclean: clean distclean | |
ab57b174 | 696 | -rm -f $(LDDISTSTUFF) |
eb02fd64 RP |
697 | |
698 | lintlog:$(SOURCES) Makefile | |
2ee11735 | 699 | $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \ |
eb02fd64 RP |
700 | | grep -v "pointer casts may be troublesome" \ |
701 | | grep -v "possible pointer alignment problem" \ | |
702 | | grep -v "ignore" \ | |
703 | | grep -v "conversion from long may lose accuracy" \ | |
704 | | grep -v "warning: constant argument to NOT" \ | |
705 | | grep -v "enumeration type clash, operator CAST" \ | |
706 | | grep -v "warning: constant in conditional context"\ | |
707 | | grep -v "archive\.c" | |
708 | ||
709 | ||
cbb5c2d1 DM |
710 | TAGS: |
711 | etags -t $(srcdir)/*.[chly] *.[chly] | |
eb02fd64 | 712 | |
eb02fd64 | 713 | |
12fa72d4 | 714 | .PHONY: install |
91b3a2b6 | 715 | install: |
8ddef552 DM |
716 | $(INSTALL_XFORM) ld.new $(bindir)/ld |
717 | $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1 | |
173a0c3d DM |
718 | for f in ldscripts/*; do \ |
719 | $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \ | |
d360d135 | 720 | done |
9cd039e7 | 721 | -n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \ |
56409445 ILT |
722 | rm -f $(tooldir)/bin/ld; \ |
723 | ln $(bindir)/$$n $(tooldir)/bin/ld \ | |
e357065c | 724 | || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld |
e06ba18d | 725 | |
91b3a2b6 | 726 | install-info: |
afe3aa73 | 727 | for i in ld.info* ; do \ |
e06ba18d | 728 | $(INSTALL_DATA) $$i $(infodir)/$$i ; \ |
afe3aa73 RP |
729 | done |
730 | ||
12fa72d4 SC |
731 | clean-info: |
732 | -rm -rf *.info* | |
733 | ||
eb02fd64 RP |
734 | #----------------------------------------------------------------------------- |
735 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
736 | # | |
737 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
738 | #----------------------------------------------------------------------------- | |
739 | ||
740 | ver960.c: FORCE | |
741 | rm -f ver960.c | |
742 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
743 | ||
744 | ||
745 | # This target should be invoked before building a new release. | |
746 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
747 | # | |
748 | roll: | |
749 | @V=`cat VERSION` ; \ | |
750 | MAJ=`sed 's/\..*//' VERSION` ; \ | |
751 | MIN=`sed 's/.*\.//' VERSION` ; \ | |
752 | V=$$MAJ.`expr $$MIN + 1` ; \ | |
753 | rm -f VERSION ; \ | |
754 | echo $$V >VERSION ; \ | |
755 | echo Version $$V | |
756 | ||
239d28f3 | 757 | |
e1e5fbfc | 758 | dep: $(LDSOURCES) |
239d28f3 SC |
759 | mkdep $(CFLAGS) $? |
760 | ||
eb02fd64 RP |
761 | # Dummy target to force execution of dependent targets. |
762 | # | |
e7921bd4 | 763 | force: |
eb02fd64 RP |
764 | |
765 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
766 | # have the following string beginning in column 1: #__<hostname>__# | |
767 | # Original Makefile is backed up as 'Makefile.old'. | |
768 | # | |
769 | # Invoke with: make make HOST=xxx | |
770 | # | |
771 | make: | |
772 | -@if test $(HOST)x = x ; then \ | |
773 | echo '\aSpecify "make make HOST=???"'; \ | |
774 | exit 1; \ | |
775 | fi ; \ | |
776 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
777 | if test $$? = 0 ; then \ | |
778 | echo "\aMakefile has already been processed with 'make make'";\ | |
779 | exit 1; \ | |
780 | fi ; \ | |
781 | mv -f Makefile Makefile.old; \ | |
782 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
783 | echo "HOST=$(HOST)" >>Makefile ; \ | |
784 | echo >>Makefile ; \ | |
785 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
786 | ||
787 | #\f | |
788 | ||
f1eb48b6 | 789 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 790 | $(SHELL) ./config.status |
eb02fd64 | 791 | |
eb02fd64 | 792 | ### mode:fundamental *** |
e06ba18d | 793 | ### Local Variables: *** |
eb02fd64 RP |
794 | ### page-delimiter: "^#\f" *** |
795 | ### End: *** | |
796 | ### end of file | |
239d28f3 SC |
797 | |
798 | ||
799 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |