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