Commit | Line | Data |
---|---|---|
fecd2382 | 1 | # Makefile for GNU Assembler |
7b9f3d46 | 2 | # Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 1997 |
011d16ac | 3 | # Free Software Foundation, Inc. |
fecd2382 | 4 | |
7420b02b | 5 | # This file is part of GNU GAS. |
fecd2382 | 6 | |
7420b02b JL |
7 | # GNU GAS is free software; you can redistribute it and/or modify |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation; either version 2, or (at your option) | |
10 | # any later version. | |
fecd2382 | 11 | |
7420b02b JL |
12 | # GNU GAS is distributed in the hope that it will be useful, |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
fecd2382 | 16 | |
7420b02b | 17 | # You should have received a copy of the GNU General Public License |
7b9f3d46 ILT |
18 | # along with GNU GAS; see the file COPYING. If not, write to the Free |
19 | # Software Foundation, 59 Temple Place - Suite 330, Boston, MA | |
20 | # 02111-1307, USA. | |
fecd2382 | 21 | |
fecd2382 RP |
22 | # The targets for external use include: |
23 | # all, doc, proto, install, uninstall, includes, TAGS, | |
daa7e184 | 24 | # clean, mostlyclean, distclean, realclean, stage1, stage2, stage3, stage4. |
fecd2382 RP |
25 | |
26 | # Variables that exist for you to override. | |
27 | # See below for how to change them for certain systems. | |
28 | ||
b11fb939 KR |
29 | VPATH = @srcdir@ |
30 | srcdir = @srcdir@ | |
7420b02b | 31 | srcroot = $(srcdir)/.. |
1058238c | 32 | |
fa156ffe | 33 | target_alias = @target_alias@ |
1bc37618 | 34 | prefix = @prefix@ |
1058238c | 35 | |
fa156ffe | 36 | program_transform_name = @program_transform_name@ |
1bc37618 | 37 | exec_prefix = @exec_prefix@ |
1c94de4d JM |
38 | bindir = @bindir@ |
39 | libdir = @libdir@ | |
b63defaa | 40 | tooldir = $(exec_prefix)/$(target_alias) |
787c6bfe | 41 | |
1c94de4d JM |
42 | datadir = @datadir@ |
43 | mandir = @mandir@ | |
1058238c RP |
44 | man1dir = $(mandir)/man1 |
45 | man2dir = $(mandir)/man2 | |
46 | man3dir = $(mandir)/man3 | |
47 | man4dir = $(mandir)/man4 | |
48 | man5dir = $(mandir)/man5 | |
49 | man6dir = $(mandir)/man6 | |
50 | man7dir = $(mandir)/man7 | |
51 | man8dir = $(mandir)/man8 | |
52 | man9dir = $(mandir)/man9 | |
1c94de4d JM |
53 | infodir = @infodir@ |
54 | includedir = @includedir@ | |
1058238c | 55 | |
8ee90d35 | 56 | VERSION=cygnus-2.7.1 |
c97b9003 | 57 | |
fecd2382 | 58 | SHELL = /bin/sh |
1058238c | 59 | |
7420b02b | 60 | INSTALL = $${srcroot}/install.sh -c |
1c94de4d JM |
61 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
62 | INSTALL_DATA = @INSTALL_DATA@ | |
011d16ac | 63 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' |
c97b9003 | 64 | INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1 |
fecd2382 | 65 | |
7b9f3d46 | 66 | DISTSTUFF= make-gas.com m68k-parse.c itbl-parse.c itbl-lex.c |
6d60424f | 67 | |
1058238c RP |
68 | AR = ar |
69 | AR_FLAGS = qv | |
a1c7c0f3 ILT |
70 | BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi` |
71 | BISONFLAGS = | |
7b9f3d46 ILT |
72 | LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi` |
73 | LEXFLAGS = | |
1058238c | 74 | MAKEINFO = makeinfo |
c97b9003 | 75 | TEXI2DVI = texi2dvi |
fecd2382 | 76 | RANLIB = ranlib |
b11fb939 | 77 | CC = @CC@ |
011d16ac | 78 | HLDFLAGS = @HLDFLAGS@ |
8ee90d35 | 79 | HLDENV = @HLDENV@ |
1c94de4d | 80 | RPATH_ENVVAR = @RPATH_ENVVAR@ |
efec4a28 DP |
81 | CFLAGS = -g |
82 | LDFLAGS = | |
4b857710 | 83 | |
7420b02b JL |
84 | MAKEOVERRIDES= |
85 | ||
5f757edc ILT |
86 | EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \ |
87 | echo $${rootme}/../expect/expect ; \ | |
88 | else echo expect ; fi` | |
89 | ||
4b857710 ILT |
90 | FLAGS_TO_PASS = \ |
91 | "prefix=$(prefix)" \ | |
92 | "exec_prefix=$(exec_prefix)" \ | |
93 | "tooldir=$(tooldir)" \ | |
94 | "AR=$(AR)" \ | |
95 | "AR_FLAGS=$(AR_FLAGS)" \ | |
96 | "CC=$(CC)" \ | |
97 | "CFLAGS=$(CFLAGS)" \ | |
98 | "RANLIB=$(RANLIB)" \ | |
99 | "LOADLIBES=$(LOADLIBES)" \ | |
100 | "LDFLAGS=$(LDFLAGS)" \ | |
101 | "BISON=$(BISON)" \ | |
102 | "LEX=$(LEX)" \ | |
103 | "MAKEINFO=$(MAKEINFO)" \ | |
104 | "INSTALL=$(INSTALL)" \ | |
105 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
106 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" | |
fecd2382 | 107 | |
011d16ac ILT |
108 | RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \ |
109 | echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \ | |
833c46e1 KR |
110 | fi` |
111 | RUNTESTFLAGS= | |
c97b9003 | 112 | |
efec4a28 DP |
113 | # use @target_cpu_type@ for refering to configured target name |
114 | IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h itbl-cpu.h | |
115 | IT_SRCS=itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c | |
116 | IT_DEPS=$(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h | |
117 | IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o | |
118 | ||
fecd2382 RP |
119 | # Lists of files for various purposes. |
120 | ||
121 | REAL_SOURCES = \ | |
122 | $(srcdir)/app.c \ | |
123 | $(srcdir)/as.c \ | |
124 | $(srcdir)/atof-generic.c \ | |
125 | $(srcdir)/bignum-copy.c \ | |
126 | $(srcdir)/cond.c \ | |
127 | $(srcdir)/expr.c \ | |
5d53038b | 128 | $(srcdir)/flonum-konst.c \ |
fecd2382 RP |
129 | $(srcdir)/flonum-copy.c \ |
130 | $(srcdir)/flonum-mult.c \ | |
131 | $(srcdir)/frags.c \ | |
132 | $(srcdir)/hash.c \ | |
fecd2382 RP |
133 | $(srcdir)/input-file.c \ |
134 | $(srcdir)/input-scrub.c \ | |
efec4a28 | 135 | $(srcdir)/itbl-ops.c \ |
dffc8b9e | 136 | $(srcdir)/literal.c \ |
fecd2382 RP |
137 | $(srcdir)/messages.c \ |
138 | $(srcdir)/output-file.c \ | |
139 | $(srcdir)/read.c \ | |
fecd2382 RP |
140 | $(srcdir)/subsegs.c \ |
141 | $(srcdir)/symbols.c \ | |
fecd2382 | 142 | $(srcdir)/write.c \ |
3340f7e5 | 143 | $(srcdir)/listing.c \ |
9cc8106c | 144 | $(srcdir)/ecoff.c \ |
b63defaa | 145 | $(srcdir)/stabs.c |
fecd2382 RP |
146 | |
147 | # in an expedient order | |
148 | LINKED_SOURCES = \ | |
149 | targ-cpu.c \ | |
150 | obj-format.c \ | |
151 | atof-targ.c | |
152 | ||
153 | SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES) | |
154 | ||
155 | REAL_HEADERS = \ | |
156 | $(srcdir)/as.h \ | |
157 | $(srcdir)/bignum.h \ | |
158 | $(srcdir)/expr.h \ | |
159 | $(srcdir)/flonum.h \ | |
160 | $(srcdir)/frags.h \ | |
161 | $(srcdir)/hash.h \ | |
162 | $(srcdir)/input-file.h \ | |
efec4a28 | 163 | $(srcdir)/itbl-ops.h \ |
542e1629 | 164 | $(srcdir)/listing.h \ |
fecd2382 RP |
165 | $(srcdir)/tc.h \ |
166 | $(srcdir)/obj.h \ | |
167 | $(srcdir)/read.h \ | |
fecd2382 RP |
168 | $(srcdir)/struc-symbol.h \ |
169 | $(srcdir)/subsegs.h \ | |
170 | $(srcdir)/symbols.h \ | |
9cc8106c ILT |
171 | $(srcdir)/write.h \ |
172 | $(srcdir)/ecoff.h | |
fecd2382 RP |
173 | |
174 | LINKED_HEADERS = \ | |
fecd2382 RP |
175 | targ-env.h \ |
176 | targ-cpu.h \ | |
177 | obj-format.h \ | |
efec4a28 DP |
178 | atof-targ.h \ |
179 | itbl-cpu.h | |
fecd2382 RP |
180 | |
181 | HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS) | |
182 | ||
7e047ac2 ILT |
183 | TE_OBJS= |
184 | ||
b11fb939 | 185 | # @target_frag@ |
b3cd8555 | 186 | |
fecd2382 RP |
187 | OBJS = \ |
188 | targ-cpu.o \ | |
189 | obj-format.o \ | |
190 | atof-targ.o \ | |
191 | app.o \ | |
192 | as.o \ | |
193 | atof-generic.o \ | |
194 | bignum-copy.o \ | |
195 | cond.o \ | |
196 | expr.o \ | |
5d53038b | 197 | flonum-konst.o \ |
fecd2382 RP |
198 | flonum-copy.o \ |
199 | flonum-mult.o \ | |
200 | frags.o \ | |
201 | hash.o \ | |
fecd2382 RP |
202 | input-file.o \ |
203 | input-scrub.o \ | |
dffc8b9e | 204 | literal.o \ |
fecd2382 RP |
205 | messages.o \ |
206 | output-file.o \ | |
207 | read.o \ | |
fecd2382 RP |
208 | subsegs.o \ |
209 | symbols.o \ | |
fecd2382 | 210 | write.o \ |
3340f7e5 | 211 | listing.o \ |
9cc8106c | 212 | ecoff.o \ |
c751ad19 | 213 | stabs.o \ |
7e047ac2 ILT |
214 | sb.o \ |
215 | macro.o \ | |
816a827b | 216 | @extra_objects@ \ |
b3cd8555 | 217 | $(TE_OBJS) |
f6b67e4c | 218 | |
7e047ac2 ILT |
219 | GASPOBJS = \ |
220 | gasp.o \ | |
221 | macro.o \ | |
222 | sb.o \ | |
223 | hash.o | |
224 | ||
1df6e266 | 225 | all: .gdbinit as.new gasp.new |
7420b02b JL |
226 | @srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
227 | (cd doc ; $(MAKE) $(FLAGS_TO_PASS) all) | |
79a54a5b | 228 | |
7420b02b JL |
229 | dvi info install-info clean-info: |
230 | @srcroot=`cd $(srcroot); pwd`; export srcroot; \ | |
231 | (cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@) | |
fecd2382 | 232 | |
c20c7506 JL |
233 | make-gas.com: stamp-mk.com |
234 | stamp-mk.com: vmsconf.sh Makefile | |
816a827b | 235 | sh $(srcdir)/vmsconf.sh $(OBJS) > new-make.com |
c20c7506 JL |
236 | $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com |
237 | touch stamp-mk.com | |
238 | ||
fecd2382 RP |
239 | # Now figure out from those variables how to compile and link. |
240 | ||
241 | # This is the variable actually used when we compile. | |
6ded6615 | 242 | ALL_CFLAGS = -D_GNU_SOURCE $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES) |
fecd2382 | 243 | |
fecd2382 RP |
244 | # How to link with both our special library facilities |
245 | # and the system's installed libraries. | |
f6b67e4c | 246 | |
011d16ac | 247 | LIBDEPS = @OPCODES_DEP@ @BFDDEP@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a |
b11fb939 | 248 | LIBS = @OPCODES_LIB@ @BFDLIB@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a |
fecd2382 RP |
249 | |
250 | # Specify the directories to be searched for header files. | |
251 | # Both . and srcdir are used, in that order, | |
252 | # so that tm.h and config.h will be found in the compilation | |
253 | # subdirectory rather than in the source directory. | |
816a827b | 254 | INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(srcdir)/../include -I$(srcdir)/.. -I$(srcdir)/../bfd |
fecd2382 RP |
255 | |
256 | # Always use -I$(srcdir)/config when compiling. | |
257 | .c.o: | |
258 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $< | |
259 | ||
260 | # This tells GNU make version 3 not to export all the variables | |
261 | # defined in this file into the environment. | |
262 | .NOEXPORT: | |
542e1629 | 263 | |
fecd2382 | 264 | # Files to be copied away after each stage in building. |
c20c7506 | 265 | STAGESTUFF = *.o as.new gasp.new |
fecd2382 | 266 | |
b11fb939 | 267 | $(OBJS): @ALL_OBJ_DEPS@ |
c92d9ee9 | 268 | |
011d16ac | 269 | as.new: $(OBJS) $(LIBDEPS) |
8ee90d35 | 270 | $(HLDENV) $(CC) $(HLDFLAGS) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES) |
fecd2382 | 271 | |
84951544 KR |
272 | $(OBJS): config.h as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \ |
273 | struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \ | |
efec4a28 | 274 | listing.h bignum.h $(IT_HDRS) $(srcdir)/../include/libiberty.h |
b11fb939 | 275 | |
138b11d8 ILT |
276 | gasp.new: $(GASPOBJS) ../libiberty/libiberty.a |
277 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gasp.new $(GASPOBJS) ../libiberty/libiberty.a $(LOADLIBES) | |
a5a4b5ac | 278 | |
c97b9003 DZ |
279 | installcheck: |
280 | @echo No installcheck target is available yet for the GNU assembler. | |
281 | ||
5f757edc ILT |
282 | site.exp: ./Makefile |
283 | @echo "Making a new config file..." | |
284 | -@rm -f ./tmp? | |
285 | @touch site.exp | |
286 | -@mv site.exp site.bak | |
287 | @echo "## these variables are automatically generated by make ##" > ./tmp0 | |
288 | @echo "# Do not edit here. If you wish to override these values," >> ./tmp0 | |
289 | @echo "# do so in the last section." >> ./tmp0 | |
290 | @echo set host_os @host_os@ >> ./tmp0 | |
291 | @echo set host_alias @host_alias@ >> ./tmp0 | |
292 | @echo set host_cpu @host_cpu@ >> ./tmp0 | |
293 | @echo set host_vendor @host_vendor@ >> ./tmp0 | |
294 | @echo set target_os @target_os@ >> ./tmp0 | |
295 | @echo set target_alias @target_alias@ >> ./tmp0 | |
296 | @echo set target_cpu @target_cpu@ >> ./tmp0 | |
297 | @echo set target_vendor @target_vendor@ >> ./tmp0 | |
298 | @echo set host_triplet @host@ >> ./tmp0 | |
299 | @echo set target_triplet @target@ >> ./tmp0 | |
300 | @echo set target_canonical @target@ >> ./tmp0 | |
b1986513 | 301 | @echo set srcdir ${srcdir}/testsuite >> ./tmp0 |
5f757edc ILT |
302 | @echo set exec_prefix ${exec_prefix} >> ./tmp0 |
303 | @echo set objdir `pwd` >> ./tmp0 | |
304 | @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0 | |
305 | @sed -e '1,/^## All variables above are.*##/ d' < site.bak >> ./tmp0 | |
306 | @mv -f ./tmp0 site.exp | |
307 | ||
308 | check: site.exp | |
309 | if [ -d testsuite ]; then \ | |
310 | true; \ | |
311 | else \ | |
312 | mkdir testsuite; \ | |
313 | fi | |
314 | rm -f testsuite/site.exp | |
315 | cp site.exp testsuite/site.exp | |
316 | rootme=`pwd`; export rootme; \ | |
317 | srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \ | |
1c94de4d JM |
318 | $(RPATH_ENVVAR)=$$rootme/../bfd:$$rootme/../opcodes:$$$(RPATH_ENVVAR); \ |
319 | export $(RPATH_ENVVAR); \ | |
5f757edc ILT |
320 | cd testsuite; \ |
321 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
322 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
323 | TCL_LIBRARY=$${srcdir}/../tcl/library ; \ | |
324 | export TCL_LIBRARY ; fi ; \ | |
325 | $(RUNTEST) --tool gas --srcdir $${srcdir}/testsuite $(RUNTESTFLAGS) | |
787c6bfe | 326 | |
b11fb939 | 327 | config.status: configure |
8ee90d35 | 328 | $(SHELL) config.status --recheck |
b11fb939 | 329 | |
fc00f451 | 330 | config.h: config-stamp ; @true |
b11fb939 | 331 | config-stamp: Makefile conf |
fc00f451 | 332 | -rm -f config.new config-stamp |
1e84ff7e KR |
333 | echo '/* config.h. Generated automatically by make. */' > config.new |
334 | echo '#ifndef GAS_VERSION' >> config.new | |
b11fb939 KR |
335 | echo '#define GAS_VERSION "$(VERSION)"' >> config.new |
336 | echo '' >> config.new | |
337 | cat conf >> config.new | |
338 | echo '#endif /* GAS_VERSION */' >> config.new | |
fc00f451 KR |
339 | $(srcdir)/../move-if-change config.new config.h |
340 | touch config-stamp | |
341 | ||
fecd2382 RP |
342 | # Compiling object files from source files. |
343 | ||
833c46e1 | 344 | TARG_CPU_DEP_a29k = |
1c94de4d | 345 | TARG_CPU_DEP_alpha = $(srcdir)/../include/opcode/alpha.h subsegs.h |
833c46e1 | 346 | # start-sanitize-arc |
1c94de4d | 347 | TARG_CPU_DEP_arc = $(srcdir)/../include/opcode/arc.h subsegs.h |
833c46e1 | 348 | # end-sanitize-arc |
1c94de4d | 349 | TARG_CPU_DEP_arm = subsegs.h |
833c46e1 KR |
350 | TARG_CPU_DEP_generic = |
351 | TARG_CPU_DEP_h8300 = $(srcdir)/../include/opcode/h8300.h | |
1c94de4d JM |
352 | TARG_CPU_DEP_h8500 = $(srcdir)/../opcodes/h8500-opc.h subsegs.h |
353 | TARG_CPU_DEP_hppa = subsegs.h | |
354 | TARG_CPU_DEP_i386 = $(srcdir)/../include/opcode/i386.h subsegs.h | |
833c46e1 KR |
355 | TARG_CPU_DEP_i860 = |
356 | TARG_CPU_DEP_i960 = | |
a1c7c0f3 | 357 | TARG_CPU_DEP_m68k = $(srcdir)/../include/opcode/m68k.h \ |
7e047ac2 | 358 | $(srcdir)/config/m68k-parse.h subsegs.h |
1c94de4d | 359 | TARG_CPU_DEP_m88k = $(srcdir)/config/m88k-opcode.h subsegs.h |
efec4a28 DP |
360 | TARG_CPU_DEP_mips = $(srcdir)/../include/opcode/mips.h subsegs.h \ |
361 | $(srcdir)/config/itbl-mips.h | |
833c46e1 | 362 | TARG_CPU_DEP_ns32k = |
1c94de4d JM |
363 | TARG_CPU_DEP_ppc = subsegs.h |
364 | TARG_CPU_DEP_sh = $(srcdir)/../opcodes/sh-opc.h subsegs.h | |
365 | TARG_CPU_DEP_sparc = subsegs.h | |
833c46e1 KR |
366 | TARG_CPU_DEP_tahoe = |
367 | TARG_CPU_DEP_vax = | |
1c94de4d | 368 | TARG_CPU_DEP_w65 = $(srcdir)/../opcodes/w65-opc.h subsegs.h |
833c46e1 KR |
369 | TARG_CPU_DEP_z8k = $(srcdir)/../opcodes/z8k-opc.h |
370 | ||
7e047ac2 ILT |
371 | gasp.o : gasp.c sb.h macro.h config.h |
372 | sb.o : sb.c sb.h config.h | |
373 | macro.o : macro.c macro.h sb.h hash.h config.h | |
84951544 | 374 | app.o : app.c write.h |
7e047ac2 | 375 | as.o : as.c output-file.h write.h subsegs.h sb.h macro.h |
84951544 KR |
376 | atof-generic.o : atof-generic.c |
377 | bignum-copy.o : bignum-copy.c | |
378 | cond.o : cond.c | |
379 | debug.o : debug.c subsegs.h | |
380 | expr.o : expr.c | |
381 | flonum-konst.o : flonum-konst.c | |
382 | flonum-copy.o : flonum-copy.c | |
383 | flonum-mult.o : flonum-mult.c | |
384 | frags.o : frags.c subsegs.h | |
385 | hash.o : hash.c | |
84951544 | 386 | input-file.o : input-file.c input-file.h |
7e047ac2 | 387 | input-scrub.o : input-scrub.c input-file.h sb.h |
84951544 KR |
388 | listing.o : listing.c input-file.h subsegs.h |
389 | literal.o : literal.c subsegs.h | |
390 | messages.o : messages.c | |
391 | output-file.o : output-file.c output-file.h | |
7e047ac2 | 392 | read.o : read.c sb.h macro.h |
84951544 KR |
393 | subsegs.o : subsegs.c subsegs.h |
394 | symbols.o : symbols.c subsegs.h | |
395 | write.o : write.c subsegs.h output-file.h | |
396 | ecoff.o : ecoff.c ecoff.h \ | |
397 | $(srcdir)/../include/coff/internal.h $(srcdir)/../include/coff/sym.h \ | |
398 | $(srcdir)/../include/coff/ecoff.h \ | |
399 | $(srcdir)/../include/coff/symconst.h \ | |
400 | $(srcdir)/../include/aout/stab_gnu.h | |
401 | stabs.o : stabs.c subsegs.h $(srcdir)/../include/aout/stab_gnu.h | |
402 | atof-targ.o : atof-targ.c | |
403 | obj-format.o : obj-format.c | |
efec4a28 | 404 | targ-cpu.o : targ-cpu.c $(TARG_CPU_DEP_@target_cpu_type@) $(IT_HDRS) |
d1a9e594 | 405 | |
816a827b ILT |
406 | obj-elf.o : $(srcdir)/config/obj-elf.c |
407 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-elf.c | |
408 | obj-ecoff.o : $(srcdir)/config/obj-ecoff.c | |
409 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-ecoff.c | |
410 | ||
411 | e-mipself.o : $(srcdir)/config/e-mipself.c | |
412 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipself.c | |
413 | e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c | |
414 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipsecoff.c | |
415 | ||
a1c7c0f3 ILT |
416 | # The m68k operand parser. |
417 | ||
418 | m68k-parse.c: $(srcdir)/config/m68k-parse.y | |
419 | $(BISON) $(BISONFLAGS) $(srcdir)/config/m68k-parse.y | |
420 | mv -f y.tab.c m68k-parse.c | |
336435bc | 421 | m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h |
a1c7c0f3 | 422 | |
efec4a28 DP |
423 | |
424 | # The instruction table specification lexical analyzer and parser. | |
425 | ||
426 | itbl-cpu.h : $(srcdir)/config/itbl-@target_cpu_type@.h | |
427 | itbl-parse.h : $(srcdir)/itbl-parse.y | |
428 | itbl-parse.c : $(srcdir)/itbl-parse.y | |
429 | itbl-lex.c : $(srcdir)/itbl-lex.l | |
430 | ||
431 | itbl-lex.c: $(srcdir)/itbl-lex.l | |
432 | $(LEX) $(LEXFLAGS) $(srcdir)/itbl-lex.l | |
433 | mv -f lex.yy.c itbl-lex.c | |
434 | ||
435 | itbl-lex.o: itbl-lex.c | |
436 | $(CC) -Wall -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) itbl-lex.c | |
437 | ||
438 | itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y | |
439 | $(YACC) -d $(YACCFLAGS) $(srcdir)/itbl-parse.y | |
440 | mv -f y.tab.c itbl-parse.c | |
441 | mv -f y.tab.h itbl-parse.h | |
442 | ||
443 | itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h itbl-cpu.h | |
444 | $(CC) -Wall -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) itbl-parse.c | |
445 | ||
446 | itbl-ops.o: $(srcdir)/itbl-ops.c \ | |
447 | $(srcdir)/itbl-ops.h itbl-cpu.h itbl-parse.h | |
448 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/itbl-ops.c | |
449 | ||
450 | # stand-alone assembler & disassembler | |
451 | itbl-test-ops.o: $(srcdir)/itbl-ops.c \ | |
452 | $(srcdir)/itbl-ops.h itbl-cpu.h itbl-parse.h | |
453 | $(CC) -o itbl-test-ops.o -DSTAND_ALONE -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/itbl-ops.c | |
454 | ||
455 | itbl-test.o: $(srcdir)/itbl-test.c $(srcdir)/itbl-ops.h itbl-cpu.h | |
456 | $(CC) -c -DSTAND_ALONE $(ALL_CFLAGS) $(INCLUDES) $(srcdir)/itbl-test.c | |
457 | ||
458 | IT_TEST_OBJS= itbl-parse.o itbl-lex.o itbl-test-ops.o | |
459 | itbl-test: $(IT_TEST_OBJS) itbl-test.o $(LIBDEPS) | |
460 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o itbl-test itbl-test.o $(IT_TEST_OBJS) $(LIBS) | |
461 | ||
462 | # target itbl definitions for configuring coprocessor itbl support. | |
463 | # configure should have taken care of this for us... | |
464 | itbl-cpu.h: $(srcdir)/config/itbl-@target_cpu_type@.h | |
465 | ln -s $(srcdir)/config/itbl-@target_cpu_type@.h itbl-cpu.h | |
466 | ||
467 | ||
fecd2382 RP |
468 | # Remake the info files. |
469 | ||
921faa52 | 470 | doc: $(srcdir)/as.info |
fecd2382 | 471 | |
921faa52 | 472 | $(srcdir)/as.info: $(srcdir)/doc/as.texinfo |
c97b9003 | 473 | @(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir) |
fecd2382 | 474 | |
b1986513 | 475 | diststuff: $(DISTSTUFF) info |
367d6244 | 476 | |
7420b02b | 477 | clean-here: |
f2889110 | 478 | -rm -f $(STAGESTUFF) core stamp-mk.com |
b1986513 KR |
479 | -rm -f testsuite/*.o testsuite/*.out \ |
480 | testsuite/gas.log testsuite/gas.sum testsuite/site.exp | |
fecd2382 | 481 | |
daa7e184 ILT |
482 | clean mostlyclean: clean-here |
483 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ | |
7420b02b | 484 | |
fecd2382 | 485 | # Like clean but also delete the links made to configure gas. |
011d16ac ILT |
486 | |
487 | DISTCLEAN_HERE = config.status Makefile targ-env.h targ-cpu.h \ | |
488 | targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \ | |
efec4a28 | 489 | atof-targ.h itbl-cpu.h \ |
011d16ac ILT |
490 | config-stamp config.h conf config.log config.cache .gdbinit \ |
491 | testsuite/Makefile testsuite/config.status | |
492 | ||
367d6244 | 493 | distclean: clean-here |
daa7e184 | 494 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ |
011d16ac ILT |
495 | -rm -f $(DISTCLEAN_HERE) |
496 | ||
497 | maintainer-clean realclean: clean-here | |
6b0a6eaa KR |
498 | @echo "This command is intended for maintainers to use;" |
499 | @echo "it deletes files that may require special tools to rebuild." | |
011d16ac ILT |
500 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ |
501 | -rm -rf $(DISTCLEAN_HERE) $(DISTSTUFF) | |
542e1629 | 502 | |
fecd2382 RP |
503 | # Entry points `install', `includes' and `uninstall'. |
504 | ||
505 | # Copy the files into directories where they will be run. | |
542e1629 | 506 | install: |
7420b02b | 507 | srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
c97b9003 | 508 | $(INSTALL_XFORM) as.new $(bindir)/as; \ |
7420b02b | 509 | $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \ |
1c94de4d JM |
510 | test -d $(tooldir) || mkdir $(tooldir); \ |
511 | test -d $(tooldir)/bin || mkdir $(tooldir)/bin; \ | |
28d3e4a3 | 512 | n=`echo as | sed '$(program_transform_name)'`; \ |
1c94de4d JM |
513 | rm -f $(tooldir)/bin/as; \ |
514 | ln $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \ | |
515 | || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as | |
a5a4b5ac | 516 | srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
138b11d8 | 517 | $(INSTALL_XFORM) gasp.new $(bindir)/gasp |
fecd2382 | 518 | |
fecd2382 RP |
519 | # Cancel installation by deleting the installed files. |
520 | uninstall: | |
fa156ffe | 521 | -n=`t='$(program_transform_name)'; echo as | sed $$t`; \ |
7e10f53c ILT |
522 | rm -f $(bindir)/$$n; \ |
523 | rm -f $(mandir)/$$n.1 | |
fa156ffe | 524 | -n=`t='$(program_transform_name)'; echo gasp | sed $$t`; \ |
a5a4b5ac | 525 | rm -f $(bindir)/$$n; \ |
542e1629 | 526 | |
fecd2382 RP |
527 | # These exist for maintenance purposes. |
528 | ||
529 | tags TAGS: force | |
787c6bfe | 530 | etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in |
ac7f7dfe | 531 | |
542e1629 | 532 | bootstrap: as.new force |
fecd2382 | 533 | $(MAKE) stage1 |
3256c4b5 KR |
534 | rm -f stage && ln -s stage1 stage |
535 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
fecd2382 | 536 | $(MAKE) stage2 |
3256c4b5 KR |
537 | rm -f stage && ln -s stage2 stage |
538 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
a01bf1fb | 539 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
540 | |
541 | bootstrap2: force | |
3256c4b5 KR |
542 | rm -f stage && ln -s stage1 stage |
543 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
fecd2382 | 544 | $(MAKE) stage2 |
3256c4b5 KR |
545 | rm -f stage && ln -s stage2 stage |
546 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
da0b2bff | 547 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
548 | |
549 | bootstrap3: force | |
3256c4b5 KR |
550 | rm -f stage && ln -s stage2 stage |
551 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
a01bf1fb | 552 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
553 | |
554 | # Copy the object files from a particular stage into a subdirectory. | |
555 | stage1: force | |
556 | -mkdir stage1 | |
557 | -mv $(STAGESTUFF) stage1 | |
81f73963 | 558 | if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi |
fecd2382 RP |
559 | |
560 | stage2: force | |
561 | -mkdir stage2 | |
562 | -mv $(STAGESTUFF) stage2 | |
81f73963 | 563 | if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi |
fecd2382 RP |
564 | |
565 | stage3: force | |
566 | -mkdir stage3 | |
6a3958b2 | 567 | -mv $(STAGESTUFF) stage3 |
81f73963 | 568 | if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi |
fecd2382 | 569 | |
a01bf1fb RP |
570 | against=stage2 |
571 | ||
f2889110 KR |
572 | # This rule is derived from corresponding code in the Makefile.in for gcc. |
573 | # The "tail +16c" is to bypass headers which may include timestamps or | |
574 | # temporary assembly file names. | |
a01bf1fb | 575 | comparison: force |
f2889110 | 576 | x=0 ; \ |
6b0a6eaa | 577 | for file in *.o ; do \ |
f2889110 KR |
578 | tail +16c ./$$file > tmp-foo1; \ |
579 | if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \ | |
580 | if cmp tmp-foo1 tmp-foo2 ; then \ | |
581 | true ; \ | |
582 | else \ | |
583 | echo $$file differs ; \ | |
584 | x=1 ; \ | |
585 | fi ; \ | |
586 | else true; fi ; \ | |
587 | done ; \ | |
588 | exit $$x | |
589 | -rm -f tmp-foo* | |
a01bf1fb | 590 | |
6a3958b2 | 591 | de-stage1: force |
b3cd8555 | 592 | - (cd stage1 ; rm -f as ; mv -f * ..) |
6a3958b2 RP |
593 | - rmdir stage1 |
594 | ||
595 | de-stage2: force | |
b3cd8555 | 596 | - (cd stage2 ; rm -f as ; mv -f * ..) |
6a3958b2 RP |
597 | - rmdir stage2 |
598 | ||
599 | de-stage3: force | |
b3cd8555 | 600 | - (cd stage3 ; rm -f as ; mv -f * ..) |
6a3958b2 | 601 | - rmdir stage3 |
fecd2382 | 602 | |
fecd2382 | 603 | #In GNU Make, ignore whether `stage*' exists. |
daa7e184 ILT |
604 | .PHONY: stage1 stage2 stage3 stage4 clean mostlyclean realclean distclean |
605 | .PHONY: TAGS bootstrap | |
fecd2382 RP |
606 | |
607 | force: | |
608 | ||
fc00f451 | 609 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \ |
a1c7c0f3 | 610 | $(srcdir)/configure.in config.status conf.in |
a26878d1 | 611 | $(SHELL) ./config.status |
1df6e266 KR |
612 | .gdbinit: $(srcdir)/gdbinit.in config.status |
613 | $(SHELL) ./config.status |