]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gas/Makefile.am
Cleanups in binutils makefiles.
[thirdparty/binutils-gdb.git] / gas / Makefile.am
CommitLineData
252b5132
RH
1## Process this file with automake to generate Makefile.in
2
a5c7551f 3AUTOMAKE_OPTIONS = 1.11 dejagnu foreign no-dist
79887925 4ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
252b5132
RH
5
6SUBDIRS = doc po
7
8tooldir = $(exec_prefix)/$(target_alias)
9
9c46fb1b
AM
10YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi`
11LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi`
252b5132 12
a2d91340 13WARN_CFLAGS = @WARN_CFLAGS@
9e9b66a9 14NO_WERROR = @NO_WERROR@
a2d91340
AC
15AM_CFLAGS = $(WARN_CFLAGS)
16
252b5132
RH
17TARG_CPU = @target_cpu_type@
18TARG_CPU_C = $(srcdir)/config/tc-@target_cpu_type@.c
19TARG_CPU_O = tc-@target_cpu_type@.o
20TARG_CPU_H = $(srcdir)/config/tc-@target_cpu_type@.h
21OBJ_FORMAT_C = $(srcdir)/config/obj-@obj_format@.c
22OBJ_FORMAT_O = obj-@obj_format@.o
23OBJ_FORMAT_H = $(srcdir)/config/obj-@obj_format@.h
24TARG_ENV_H = $(srcdir)/config/te-@te_file@.h
25ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c
26ATOF_TARG_O = atof-@atof@.o
27
28# use @target_cpu_type@ for refering to configured target name
12e64c2c 29IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h
252b5132
RH
30IT_SRCS=itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c
31IT_DEPS=$(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h
32IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o
33
34# CPU types. This is only used for dependency information.
35
36CPU_TYPES = \
252b5132
RH
37 alpha \
38 arc \
39 arm \
ec694b89 40 avr \
07c1b327 41 bfin \
3d3d428f 42 cr16 \
3bcbcc3d 43 cris \
1fe1f39c 44 crx \
252b5132
RH
45 d10v \
46 d30v \
d172d4ba 47 dlx \
252b5132 48 fr30 \
0ebb9a87 49 frv \
252b5132 50 h8300 \
252b5132 51 hppa \
5b93d8bb 52 i370 \
252b5132
RH
53 i386 \
54 i860 \
55 i960 \
f26a5955 56 ia64 \
a40cbfa3 57 ip2k \
84e94c90 58 lm32 \
49f58d10 59 m32c \
252b5132 60 m32r \
60bcf0fa 61 m68hc11 \
252b5132 62 m68k \
f26a5955 63 maxq \
252b5132 64 mcore \
280d71bf 65 mep \
7ba29e2a 66 microblaze \
252b5132 67 mips \
3c3bdf30 68 mmix \
252b5132
RH
69 mn10200 \
70 mn10300 \
2469cfa2 71 msp430 \
f26a5955 72 mt \
252b5132 73 ns32k \
c7e40348 74 openrisc \
3b16e843 75 or32 \
e135f41b 76 pdp11 \
041dd5a9 77 pj \
252b5132 78 ppc \
a85d7ed0 79 s390 \
1c0d3aa6 80 score \
252b5132 81 sh \
eb1e0e80 82 sh64 \
252b5132 83 sparc \
e9f53129 84 spu \
252b5132 85 tic30 \
98199d8f 86 tic4x \
39bec121 87 tic54x \
252b5132 88 v850 \
f26a5955 89 vax \
d70c5fc7 90 xc16x \
f26a5955 91 xstormy16 \
e0001a05 92 xtensa \
3c9b82ba 93 z80 \
252b5132
RH
94 z8k
95
96# Object format types. This is only used for dependency information.
98aa84af 97# We deliberately omit SOM, since it does not work as a cross assembler.
252b5132
RH
98
99OBJ_FORMATS = \
100 aout \
252b5132
RH
101 coff \
102 ecoff \
103 elf \
e57f8c65
TG
104 evax \
105 macho
252b5132
RH
106
107# This is an sh case which sets valid according to whether the CPU
108# type in the shell variable c and the OS type in the shell variable o
109# are supported. This helps cuts down on the amount of dependency
110# information.
111
112CPU_OBJ_VALID = \
113 valid= ; \
114 case $$o in \
115 aout) \
116 case $$c in \
7be1c489 117 arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \
252b5132
RH
118 valid=yes ;; \
119 esac ;; \
f26a5955 120 coff) \
43c34dee 121 case $$c in \
f26a5955
AM
122 arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \
123 | ppc | sh | sparc | tic* | xscale | z80 | z8k) \
124 valid=yes ;; \
43c34dee 125 esac ;; \
252b5132
RH
126 ecoff) \
127 case $$c in \
128 mips | alpha) valid=yes ;; \
129 esac ;; \
f26a5955
AM
130 elf) valid=yes ; \
131 case $$c in \
132 maxq | ns32k | tic* | z80 | z8k) valid= ;; \
133 esac ;; \
252b5132
RH
134 evax) \
135 case $$c in \
136 alpha) valid=yes ;; \
137 esac ;; \
e57f8c65
TG
138 macho) \
139 case $$c in \
140 i386) valid=yes ;; \
141 esac ;; \
252b5132
RH
142 vms) \
143 case $$c in \
144 vax) valid=yes ;; \
145 esac ;; \
146 esac;
147
16adf844 148# These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case.
252b5132 149
3bcbcc3d 150MULTI_CPU_TYPES = i386 mips cris
16adf844
AM
151
152MULTI_CPU_OBJ_VALID = \
252b5132 153 valid= ; \
16adf844
AM
154 case $$o in \
155 aout) \
156 case $$c in \
3bcbcc3d
HPN
157 i386 | cris) valid=yes ;; \
158 esac ;; \
159 coff) \
160 case $$c in \
161 i386 | mips) valid=yes ;; \
16adf844 162 esac ;; \
16adf844
AM
163 ecoff) \
164 case $$c in \
165 mips) valid=yes ;; \
166 esac ;; \
167 elf) valid=yes ;; \
252b5132
RH
168 esac;
169
170# Regular source files.
171
172GAS_CFILES = \
173 app.c \
174 as.c \
175 atof-generic.c \
252b5132
RH
176 cond.c \
177 depend.c \
fac0d250 178 dwarf2dbg.c \
54cfded0 179 dw2gencfi.c \
252b5132
RH
180 ecoff.c \
181 ehopt.c \
182 expr.c \
183 flonum-copy.c \
184 flonum-konst.c \
185 flonum-mult.c \
186 frags.c \
187 hash.c \
188 input-file.c \
189 input-scrub.c \
190 listing.c \
191 literal.c \
192 macro.c \
193 messages.c \
194 output-file.c \
195 read.c \
3d6b762c 196 remap.c \
252b5132
RH
197 sb.c \
198 stabs.c \
199 subsegs.c \
200 symbols.c \
201 write.c
202
bd3ba5d1 203CFILES = $(GAS_CFILES) itbl-ops.c cgen.c
252b5132
RH
204
205HFILES = \
206 as.h \
207 asintl.h \
208 bignum.h \
209 bit_fix.h \
210 cgen.h \
fac0d250 211 dwarf2dbg.h \
54cfded0 212 dw2gencfi.h \
252b5132
RH
213 ecoff.h \
214 emul-target.h \
215 emul.h \
216 expr.h \
217 flonum.h \
218 frags.h \
219 hash.h \
220 input-file.h \
b16b813f 221 itbl-lex.h \
252b5132
RH
222 itbl-ops.h \
223 listing.h \
224 macro.h \
225 obj.h \
226 output-file.h \
227 read.h \
228 sb.h \
229 struc-symbol.h \
230 subsegs.h \
231 symbols.h \
232 tc.h \
233 write.h
234
235# CPU files in config.
236
237TARGET_CPU_CFILES = \
252b5132
RH
238 config/tc-alpha.c \
239 config/tc-arc.c \
240 config/tc-arm.c \
ec694b89 241 config/tc-avr.c \
07c1b327 242 config/tc-bfin.c \
3d3d428f 243 config/tc-cr16.c \
3bcbcc3d 244 config/tc-cris.c \
1fe1f39c 245 config/tc-crx.c \
252b5132
RH
246 config/tc-d10v.c \
247 config/tc-d30v.c \
d172d4ba 248 config/tc-dlx.c \
a4835b42 249 config/tc-fr30.c \
0ebb9a87 250 config/tc-frv.c \
252b5132 251 config/tc-h8300.c \
252b5132 252 config/tc-hppa.c \
800eeca4 253 config/tc-ia64.c \
5b93d8bb 254 config/tc-i370.c \
252b5132
RH
255 config/tc-i386.c \
256 config/tc-i860.c \
257 config/tc-i960.c \
a40cbfa3 258 config/tc-ip2k.c \
bd3ba5d1 259 config/tc-iq2000.c \
84e94c90 260 config/tc-lm32.c \
49f58d10 261 config/tc-m32c.c \
252b5132 262 config/tc-m32r.c \
60bcf0fa 263 config/tc-m68hc11.c \
252b5132 264 config/tc-m68k.c \
bd3ba5d1 265 config/tc-maxq.c \
252b5132 266 config/tc-mcore.c \
280d71bf 267 config/tc-mep.c \
7ba29e2a 268 config/tc-microblaze.c \
252b5132 269 config/tc-mips.c \
3c3bdf30 270 config/tc-mmix.c \
252b5132
RH
271 config/tc-mn10200.c \
272 config/tc-mn10300.c \
2469cfa2 273 config/tc-msp430.c \
bd3ba5d1 274 config/tc-mt.c \
252b5132 275 config/tc-ns32k.c \
c7e40348 276 config/tc-openrisc.c \
3b16e843 277 config/tc-or32.c \
e135f41b 278 config/tc-pdp11.c \
041dd5a9 279 config/tc-pj.c \
252b5132 280 config/tc-ppc.c \
a85d7ed0 281 config/tc-s390.c \
1c0d3aa6 282 config/tc-score.c \
252b5132 283 config/tc-sh.c \
324bfcf3 284 config/tc-sh64.c \
252b5132 285 config/tc-sparc.c \
e9f53129 286 config/tc-spu.c \
252b5132 287 config/tc-tic30.c \
bd3ba5d1 288 config/tc-tic4x.c \
39bec121 289 config/tc-tic54x.c \
252b5132 290 config/tc-vax.c \
252b5132 291 config/tc-v850.c \
93fbbb04 292 config/tc-xstormy16.c \
d70c5fc7 293 config/tc-xc16x.c \
e0001a05 294 config/tc-xtensa.c \
3c9b82ba 295 config/tc-z80.c \
bd3ba5d1
NC
296 config/tc-z8k.c \
297 config/xtensa-relax.c
252b5132
RH
298
299TARGET_CPU_HFILES = \
252b5132
RH
300 config/tc-alpha.h \
301 config/tc-arc.h \
302 config/tc-arm.h \
ec694b89 303 config/tc-avr.h \
07c1b327 304 config/tc-bfin.h \
3d3d428f 305 config/tc-cr16.h \
3bcbcc3d 306 config/tc-cris.h \
1fe1f39c 307 config/tc-crx.h \
252b5132
RH
308 config/tc-d10v.h \
309 config/tc-d30v.h \
d172d4ba 310 config/tc-dlx.h \
a4835b42 311 config/tc-fr30.h \
0ebb9a87 312 config/tc-frv.h \
252b5132 313 config/tc-h8300.h \
252b5132 314 config/tc-hppa.h \
800eeca4 315 config/tc-ia64.h \
5b93d8bb 316 config/tc-i370.h \
252b5132
RH
317 config/tc-i386.h \
318 config/tc-i860.h \
319 config/tc-i960.h \
a40cbfa3 320 config/tc-ip2k.h \
bd3ba5d1 321 config/tc-iq2000.h \
84e94c90 322 config/tc-lm32.h \
49f58d10 323 config/tc-m32c.h \
252b5132 324 config/tc-m32r.h \
60bcf0fa 325 config/tc-m68hc11.h \
252b5132 326 config/tc-m68k.h \
bd3ba5d1 327 config/tc-maxq.h \
252b5132 328 config/tc-mcore.h \
280d71bf 329 config/tc-mep.h \
7ba29e2a 330 config/tc-microblaze.h \
252b5132 331 config/tc-mips.h \
3c3bdf30 332 config/tc-mmix.h \
252b5132
RH
333 config/tc-mn10200.h \
334 config/tc-mn10300.h \
2469cfa2 335 config/tc-msp430.h \
bd3ba5d1 336 config/tc-mt.h \
252b5132 337 config/tc-ns32k.h \
c7e40348 338 config/tc-openrisc.h \
3b16e843 339 config/tc-or32.h \
e135f41b 340 config/tc-pdp11.h \
041dd5a9 341 config/tc-pj.h \
252b5132 342 config/tc-ppc.h \
a85d7ed0 343 config/tc-s390.h \
1c0d3aa6 344 config/tc-score.h \
252b5132 345 config/tc-sh.h \
324bfcf3 346 config/tc-sh64.h \
252b5132 347 config/tc-sparc.h \
e9f53129 348 config/tc-spu.h \
252b5132 349 config/tc-tic30.h \
bd3ba5d1 350 config/tc-tic4x.h \
39bec121 351 config/tc-tic54x.h \
252b5132 352 config/tc-vax.h \
252b5132 353 config/tc-v850.h \
93fbbb04 354 config/tc-xstormy16.h \
d70c5fc7 355 config/tc-xc16x.h \
e0001a05 356 config/tc-xtensa.h \
3c9b82ba 357 config/tc-z80.h \
bd3ba5d1
NC
358 config/tc-z8k.h \
359 config/xtensa-relax.h
252b5132
RH
360
361# OBJ files in config
362
363OBJ_FORMAT_CFILES = \
364 config/obj-aout.c \
252b5132
RH
365 config/obj-coff.c \
366 config/obj-ecoff.c \
367 config/obj-elf.c \
368 config/obj-evax.c \
fe4fa32c 369 config/obj-fdpicelf.c \
e57f8c65 370 config/obj-macho.c \
a5c7551f 371 config/obj-multi.c \
ec91a2c2 372 config/obj-som.c
252b5132
RH
373
374OBJ_FORMAT_HFILES = \
375 config/obj-aout.h \
252b5132
RH
376 config/obj-coff.h \
377 config/obj-ecoff.h \
378 config/obj-elf.h \
379 config/obj-evax.h \
fe4fa32c 380 config/obj-fdpicelf.h \
e57f8c65 381 config/obj-macho.h \
a5c7551f 382 config/obj-multi.h \
ec91a2c2 383 config/obj-som.h
252b5132
RH
384
385# Emulation header files in config
386
387TARG_ENV_HFILES = \
388 config/te-386bsd.h \
bd3ba5d1
NC
389 config/te-aix5.h \
390 config/te-armeabi.h \
c820d418 391 config/te-armlinuxeabi.h \
252b5132 392 config/te-dynix.h \
a4835b42 393 config/te-epoc-pe.h \
bd3ba5d1 394 config/te-freebsd.h \
252b5132 395 config/te-generic.h \
bd3ba5d1 396 config/te-gnu.h \
252b5132 397 config/te-go32.h \
252b5132 398 config/te-hppa.h \
3438adb3
AM
399 config/te-hppa64.h \
400 config/te-hppalinux64.h \
252b5132 401 config/te-i386aix.h \
7463c317 402 config/te-ia64aix.h \
bd3ba5d1 403 config/te-interix.h \
252b5132
RH
404 config/te-lnews.h \
405 config/te-lynx.h \
406 config/te-mach.h \
407 config/te-macos.h \
252b5132
RH
408 config/te-nbsd.h \
409 config/te-nbsd532.h \
32137342 410 config/te-netware.h \
252b5132
RH
411 config/te-pc532mach.h \
412 config/te-pe.h \
252b5132
RH
413 config/te-psos.h \
414 config/te-riscix.h \
2774199c 415 config/te-solaris.h \
252b5132
RH
416 config/te-sparcaout.h \
417 config/te-sun3.h \
418 config/te-svr4.h \
e5a52504 419 config/te-symbian.h \
7148cc28 420 config/te-tmips.h \
bd3ba5d1 421 config/te-vxworks.h \
7148cc28 422 config/te-wince-pe.h
252b5132
RH
423
424# Multi files in config
425
426MULTI_CFILES = \
3bcbcc3d
HPN
427 config/e-crisaout.c \
428 config/e-criself.c \
4c63da97 429 config/e-i386aout.c \
252b5132
RH
430 config/e-i386coff.c \
431 config/e-i386elf.c \
432 config/e-mipsecoff.c \
433 config/e-mipself.c
434
435CONFIG_OBJS = \
436 $(TARG_CPU_O) \
437 $(OBJ_FORMAT_O) \
438 $(ATOF_TARG_O) \
439 $(extra_objects)
440
441GENERIC_OBJS = \
442 app.o \
443 as.o \
444 atof-generic.o \
252b5132
RH
445 cond.o \
446 depend.o \
fac0d250 447 dwarf2dbg.o \
54cfded0 448 dw2gencfi.o \
252b5132
RH
449 ehopt.o \
450 expr.o \
451 flonum-konst.o \
452 flonum-copy.o \
453 flonum-mult.o \
454 frags.o \
455 hash.o \
456 input-file.o \
457 input-scrub.o \
458 literal.o \
459 messages.o \
460 output-file.o \
461 read.o \
3d6b762c 462 remap.o \
252b5132
RH
463 subsegs.o \
464 symbols.o \
465 write.o \
466 listing.o \
467 ecoff.o \
468 stabs.o \
469 sb.o \
470 macro.o
471
bd3ba5d1
NC
472CONFIG_ATOF_CFILES = \
473 config/atof-ieee.c \
474 config/atof-vax.c
475
252b5132
RH
476OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
477
bd3ba5d1 478POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) $(TARG_ENV_HFILES) $(OBJ_FORMAT_HFILES) \
252b5132 479 $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
620c54b3 480 $(HFILES) $(CFILES)
252b5132 481po/POTFILES.in: @MAINT@ Makefile
323ee3f4 482 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
252b5132
RH
483 && mv tmp $(srcdir)/po/POTFILES.in
484
fea17916
NC
485# Note: GASP is now deprecated and has been removed. It is still
486# available in the CVS archive or older binutils releases if it is needed.
3f965e60 487noinst_PROGRAMS = as-new
81afc846
ILT
488noinst_SCRIPTS = $(GDBINIT)
489EXTRA_SCRIPTS = .gdbinit
252b5132 490
07c1b327 491EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
9ba4c445 492 bfin-parse.c bfin-parse.h bfin-lex.c
07c1b327 493
c45021f2 494diststuff: $(EXTRA_DIST) info
252b5132
RH
495
496DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
497
498# Now figure out from those variables how to compile and link.
499
500BASEDIR = $(srcdir)/..
501BFDDIR = $(BASEDIR)/bfd
502INCDIR = $(BASEDIR)/include
503
504# This is the variable actually used when we compile.
505# Specify the directories to be searched for header files.
506# Both . and srcdir are used, in that order,
507# so that tm.h and config.h will be found in the compilation
508# subdirectory rather than in the source directory.
14ec8efd 509AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
92f01d61 510 -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
92f01d61 511 -DLOCALEDIR="\"$(datadir)/locale\""
252b5132 512
252b5132
RH
513# How to link with both our special library facilities
514# and the system's installed libraries.
515
03bf704f 516GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
252b5132
RH
517
518# Files to be copied away after each stage in building.
519STAGESTUFF = *.o $(noinst_PROGRAMS)
520
252b5132
RH
521as_new_SOURCES = $(GAS_CFILES)
522as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
20e95c23 523 $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM)
252b5132 524as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
20e95c23 525 $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
a5c7551f
RW
526EXTRA_as_new_SOURCES = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
527 $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) \
528 $(CONFIG_ATOF_CFILES) $(MULTI_CFILES)
252b5132 529
c3298874
BE
530EXPECT = expect
531RUNTEST = runtest
252b5132
RH
532RUNTESTFLAGS=
533
534check-DEJAGNU: site.exp
535 if [ -d testsuite ]; then \
536 true; \
537 else \
538 mkdir testsuite; \
539 fi
540 rm -f testsuite/site.exp
541 cp site.exp testsuite/site.exp
542 rootme=`pwd`; export rootme; \
543 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
544 EXPECT=${EXPECT} ; export EXPECT ; \
252b5132
RH
545 runtest=$(RUNTEST); \
546 cd testsuite; \
547 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
548 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
549 $(RUNTESTFLAGS); \
550 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
551 fi
552
252b5132
RH
553# The m68k operand parser.
554
a5c7551f 555EXTRA_as_new_SOURCES += config/m68k-parse.y config/bfin-parse.y
252b5132
RH
556
557# If m68k-parse.y is in a different directory, then ylwrap will use an
558# absolute path when it invokes yacc, which will cause yacc to put the
559# absolute path into the generated file. That's a pain when it comes
560# to generating snapshots, because it introduces spurious diffs.
561# Since when we make the snapshots $(srcdir) = ".", we check for that
562# case and handle it differently. This means that anybody who
563# configures with $(srcdir) = "." will have to set their path in the
564# debugger if they want to debug m68k-parse.y. This is bad, but on
565# the other hand it's good that people who use the prebuilt
566# m68k-parse.c don't get a spurious absolute path.
567m68k-parse.c: $(srcdir)/config/m68k-parse.y
568 f=$(srcdir)/config/m68k-parse.y; \
569 if [ $$f = "./config/m68k-parse.y" ]; then \
570 ln -s config/m68k-parse.y . > /dev/null 2>/dev/null || \
571 ln config/m68k-parse.y . > /dev/null 2>/dev/null || \
572 cp config/m68k-parse.y . >/dev/null 2>/dev/null; \
573 f=m68k-parse.y; \
574 else true; fi; \
42ecbf5e 575 $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
252b5132
RH
576 if [ $$f = "m68k-parse.y" ]; then \
577 rm -f m68k-parse.y; \
578 else true; fi
1a66a017 579# Disable -Werror, if it has been enabled, since old versions of bison/
12e64c2c 580# yacc will produce working code which contain compile time warnings.
a5c7551f
RW
581m68k-parse.o: m68k-parse.c
582if am__fastdepCC
583 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ m68k-parse.c $(NO_WERROR)
584 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
585else
586if AMDEP
587 source='m68k-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
588 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
589endif
590 $(COMPILE) -c m68k-parse.c $(NO_WERROR)
591endif
252b5132
RH
592
593# Don't let the .y.h rule clobber m68k-parse.h.
594m68k-parse.h: ; @true
595$(srcdir)/config/m68k-parse.h: ; @true
596
7c8d43d8 597bfin-parse.c: $(srcdir)/config/bfin-parse.y
9ba4c445 598 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
7c8d43d8 599bfin-parse.h: bfin-parse.c
1ac4baed
BS
600bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
601 $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
07c1b327
CM
602
603bfin-defs.h: ; @true
604$(srcdir)/config/bfin-defs.h: ; @true
605
606bfin-lex.c: $(srcdir)/config/bfin-lex.l
1e0486ea 607 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
a5c7551f
RW
608bfin-lex.o: bfin-lex.c
609if am__fastdepCC
610 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ bfin-lex.c $(NO_WERROR)
611 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
612else
613if AMDEP
614 source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
615 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
616endif
617 $(COMPILE) -c bfin-lex.c $(NO_WERROR)
618endif
07c1b327 619
252b5132
RH
620# The instruction table specification lexical analyzer and parser.
621
0876dd7e 622# Disable -Werror, if it has been enabled, since old versions of bison/
12e64c2c 623# yacc will produce working code which contain compile time warnings.
a5c7551f
RW
624itbl-lex.o: itbl-lex.c
625if am__fastdepCC
626 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-lex.c $(NO_WERROR)
627 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
628else
629if AMDEP
630 source='itbl-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
631 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
632endif
633 $(COMPILE) -c itbl-lex.c $(NO_WERROR)
634endif
252b5132 635
1a66a017 636# Disable -Werror, if it has been enabled, since old versions of bison/
12e64c2c 637# yacc will produce working code which contain compile time warnings.
a5c7551f
RW
638itbl-parse.o: itbl-parse.c
639if am__fastdepCC
640 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-parse.c $(NO_WERROR)
641 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
642else
643if AMDEP
644 source='itbl-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
645 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
646endif
647 $(COMPILE) -c itbl-parse.c $(NO_WERROR)
648endif
252b5132
RH
649
650itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
42ecbf5e 651 $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
252b5132
RH
652
653# stand-alone itbl assembler & disassembler
654
fea17916 655EXTRA_PROGRAMS = itbl-test
252b5132 656itbl_test_SOURCES = itbl-parse.y itbl-lex.l
46eec08e 657itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
252b5132 658
a5c7551f
RW
659itbl-tops.o: itbl-ops.c
660if am__fastdepCC
661 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
662 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
663else
664if AMDEP
665 source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
666 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
667endif
668 $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
669endif
670
671itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c
672if am__fastdepCC
673 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
674 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
675else
676if AMDEP
677 source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
678 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
679endif
252b5132 680 $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
a5c7551f 681endif
252b5132
RH
682
683# CGEN interface.
684
685CGEN_CPU_PREFIX = @cgen_cpu_prefix@
686
687cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
688 $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
689 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
690 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
691
692# Remake the info files.
693
e079bef8 694MOSTLYCLEANFILES = $(STAGESTUFF) core \
252b5132
RH
695 testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
696 testsuite/site.exp site.bak site.exp stage stage1 stage2
697
252b5132
RH
698.PHONY: install-exec-local install-data-local
699.PHONY: install-exec-bindir install-exec-tooldir
700
701install-exec-local: install-exec-bindir @install_tooldir@
702
703install-exec-bindir: $(noinst_PROGRAMS)
d3d8a9ee 704 $(mkinstalldirs) $(DESTDIR)$(bindir)
252b5132
RH
705 @list='$(noinst_PROGRAMS)'; for p in $$list; do \
706 if test -f $$p; then \
707 echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
d3d8a9ee 708 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
252b5132
RH
709 else :; fi; \
710 done
711
f8c827e9 712install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
d3d8a9ee 713 $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
252b5132
RH
714 n=`echo as | sed '$(transform)'`; \
715 if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
d3d8a9ee
NC
716 rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
717 ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
718 || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
252b5132
RH
719 else \
720 true ; \
721 fi
722
723# These exist for maintenance purposes.
724
725.PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
726
727bootstrap: as-new
728 $(MAKE) stage1
729 rm -f stage && ln -s stage1 stage
730 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
731 $(MAKE) stage2
732 rm -f stage && ln -s stage2 stage
733 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
734 $(MAKE) comparison against=stage2
735
736bootstrap2:
737 rm -f stage && ln -s stage1 stage
738 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
739 $(MAKE) stage2
740 rm -f stage && ln -s stage2 stage
741 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
742 $(MAKE) comparison against=stage2
743
744bootstrap3:
745 rm -f stage && ln -s stage2 stage
746 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
747 $(MAKE) comparison against=stage2
748
749# Copy the object files from a particular stage into a subdirectory.
750stage1:
751 -mkdir stage1
752 -mv $(STAGESTUFF) stage1
753 if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
754
755stage2:
756 -mkdir stage2
757 -mv $(STAGESTUFF) stage2
758 if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
759
760stage3:
761 -mkdir stage3
762 -mv $(STAGESTUFF) stage3
763 if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
764
765against=stage2
766
767# This rule is derived from corresponding code in the Makefile.in for gcc.
768# The "tail +16c" is to bypass headers which may include timestamps or
769# temporary assembly file names.
770comparison:
771 x=0 ; \
772 for file in *.o ; do \
773 tail +16c ./$$file > tmp-foo1; \
774 if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
775 if cmp tmp-foo1 tmp-foo2 ; then \
776 true ; \
777 else \
778 echo $$file differs ; \
779 x=1 ; \
780 fi ; \
781 else true; fi ; \
782 done ; \
783 exit $$x
784 -rm -f tmp-foo*
785
786.PHONY: de-stage1 de-stage2 de-stage3
787
788de-stage1:
789 - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
790 - rmdir stage1
791
792de-stage2:
793 - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
794 - rmdir stage2
795
796de-stage3:
797 - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
798 - rmdir stage3
799
14ee9f48 800CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt