2 # Copyright (C) 1989, Free Software Foundation
4 # This file is part of GAS, the GNU Assembler.
6 # GAS 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 1, or (at your option)
11 # GAS 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.
16 # You should have received a copy of the GNU General Public License
17 # along with GAS; see the file COPYING. If not, write to
18 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 # This makefile may be used to make the VAX, 68020, 80386,
21 # SPARC, AMD 29000, ns32k, or i860 assembler(s).
22 ALL = asm29k avax a68 a386 asparc a32k a860 a960
23 MDSRC=vax.c m68k.c i386.c sparc.c am29k.c ns32k.c
25 BINDIR = $(DESTDIR)/bin
27 # If you are on a BSD system, un-comment the next two lines, and comment out
28 # the lines for SystemV and HPUX below
29 #G0 = -g -I. #-O -Wall
32 # To compile gas on a System Five machine, comment out the two lines above
33 # and un-comment out the next three lines
34 # Comment out the -lPW on the LOADLIBES line if you are using GCC.
37 LOADLIBES = # -lmalloc -lPW
39 # To compile gas for HPUX, link m-hpux.h to m68k.h , and un-comment the
40 # next two lines. (If you are using GCC, comment out the alloca.o part)
41 # (Get alloca from the emacs distribution, or use GCC.)
42 # HPUX 7.0 may have a bug in setvbuf. gas gives an error message like
43 # 1:"Unknown operator" -- Statement 'NO_APP' ignored
44 # if setvbuf is broken. Re-compile input-file.c (and only input-file.c
45 # with -DVMS and the problem should go away.
48 # LOADLIBES = alloca.o
50 # To compile gas for a Sequent Symmetry, comment out all the above lines,
51 # and un-comment the next two lines.
52 # G0 = -g -I. -DUSE_SYSTEM_HDR -DEXEC_VERSION=1
53 # LOADLIBES = -lc /usr/att/lib/libc.a
55 # Use these lines to build gas using hc.
56 #CC=hc29 -cmdlink.cmd -Dconst= -I../include/msdos
58 #LOADLIBES= ../binutils/alloca.o
60 # If you just want to compile the vax assembler, type 'make avax'
62 # If you just want to compile the i386 assembler, type 'make a386'
64 # If you just want to compile the ns32k assembler, type 'make a32k'
66 # If you just want to compile the sparc assembler, type 'make asparc'
68 # If you just want to compile the AMD 29000 assembler, type 'make asm29k'
70 # If you just want to compile the a860 assembler, type 'make a860'
72 # If you just want to compile the a960 assembler, type 'make a960'
74 # If you just want to compile the mc68020 assembler, make sure m68k.h
75 # is correctly set up, and type type 'make a68' (Except on HPUX machines,
76 # where you will have to make the changes marked below before typing
78 # m68k.h should be a symbolic or hard-link to one of
79 # m-sun3.h , m-hpux.h or m-generic.h
80 # depending on which machine you want to compile the 68020 assembler for.
82 # If you want the 68k assembler to be completely compatable with the the
83 # SUN one, un-comment the -DLOCAL_LABELS_FB and -DLOCAL_LABELS_DOLLAR
86 # Gas prefers STDARG's, but if your machine doesn't have stdarg.h, you
87 # should define remove the # from the -DNO_STDARG line below. In this
88 # case gas will try to use VARARGS instead. (but keep reading).
90 # If your machine does not have vfprintf, but does have _doprnt(),
91 # remove the # from the -DNO_VARARGS line below.
93 # If the return-type of a signal-hander is void (instead of int),
94 # remove the # from the -DSIGTY line below.
96 # To include the mc68851 mmu coprocessor instructions in the 68020 assembler,
97 # remove the # from the -Dm68851 line below.
99 # If you want the 68020 assembler use a register prefix character, un-comment
100 # the REGISTER_PREFIX line, and (maybe) change the '%' to the appropriate
103 # If you want the assembler to treat .L* or ..* symbols as local, instead of
104 # the usual L* symbols, un-comment the DOT_LABEL_PREFIX line.
106 # If you want the 80386 assembler to correctly handle fsub/fsubr and fdiv/fdivr
107 # opcodes (unlike most 80386 assemblers), remove the # from
108 # the -DNON_BROKEN_WORDS line below.
110 # To compile 80386 Gas for the Sequent Symmetry, un-comment the -DEXEC_VERSION
111 # and the -DUSE_SYSTEM_HDR lines below.
113 # To compile gas for the HP 9000/300 un-comment the -DUSE_HP_HDR line below.
115 # For the ns32k, the options are 32532 or 32032 CPU and 32381 or 32081 FPU.
116 # To select the NS32532, remove the # from the -DNS32532 line below.
117 # To compile in tne NS32381 opcodes in addition to the NS32081 opcodes
118 # (the 32381 is a superset of the 32081), remove the # from the -DNS32381
121 # For the ns32k on a Sequent, uncomment the SEQUENT_COMPATABILITY line below.
123 # If you want character constants to *require* closing single quotes,
124 # eg 'c' rather than 'c then use the -DREQUIRE_CHAR_CLOSE_QUOTE lines
125 # below. The default is for the closing quote to be optional.
127 # To produce intel's b.out format, use the B_OUT line below.
129 # if you want to allow "\v" to mean a control-k, use the BACKSLASH_V
132 # [Why is there a distinction between "Ox" and "Gx"? It would seem easier
133 # to not have to figure out that your code isn't working because some
134 # define's are only seen by some modules and you tested it in a module
135 # where it never gets defined... gnu@cygnus.com]
139 O3 = # -DNON_BROKEN_WORDS
141 O5 = # -DEXEC_VERSION=1
145 O8 = # -DDOT_LABEL_PREFIX
146 O9 = # -DSEQUENT_COMPATABILITY
148 G1 = # -DREGISTER_PREFIX=\'%\'
149 G2 = # -DUSE_SYSTEM_HDR
151 G4 = # -DLOCAL_LABELS_DOLLAR
152 G5 = # -DLOCAL_LABELS_FB
154 G7 = # -DREQUIRE_CHAR_CLOSE_QUOTE
158 OPTIONS = $(O1) $(O2) $(O3) $(O4) $(O5) $(O6) $(O7) $(O8) $(O9)
160 CFLAGS = $(G0) $(G1) $(G2) $(G3) $(G4) $(G5) $(G6) $(G7) $(G8) $(G9) $(OPTIONS)
163 # To make the 68020 assembler compile as the default, un-comment the next
164 # line, and comment out all the other lines that start with DEFAULT_GAS
167 # To make the VAX assembler compile as the default, un-comment the next
168 # line and commment out all the other lines that start with DEFAULT_GAS
171 # To make the 80386 assembler compile as the default, un-comment the next
172 # line and commment out all the other lines that start with DEFAULT_GAS
175 # To make the ns32k assembler compile as the default, un-comment the next
176 # line and commment out all the other lines that start with DEFAULT_GAS
179 # To make the sparc assembler compile as the default, un-comment the next
180 # line and commment out all the other lines that start with DEFAULT_GAS
184 # To make the i860 assembler compile as the default, un-comment the next
185 # line and comment out all the other lines that start with DEFAULT_GAS
188 # To make the asm29k assembler compile as the default, un-comment the next
189 # line and commment out all the other lines that start with DEFAULT_GAS
192 # To make the i960 assembler compile as the default, un-comment the next
193 # line and commment out all the other lines that start with DEFAULT_GAS
196 # Global Sources -------------------------------------------------------------
199 as.o xrealloc.o xmalloc.o hash.o hex-value.o \
200 atof-generic.o messages.o expr.o app.o \
201 frags.o input-file.o input-scrub.o output-file.o \
202 subsegs.o symbols.o version.o \
203 flonum-const.o flonum-copy.o flonum-mult.o strstr.o bignum-copy.o \
205 #gdb.o gdb-file.o gdb-symbols.o gdb-blocks.o gdb-lines.o
211 # i960 GAS ------------------------------------------------------------------
212 t = i960.o i960-opcode.o atof-ieee.o ver960.o read-i960.o write-i960.o
214 T = i960.c i960-opcode.c atof-ieee.c ver960.c
216 i960.o: i960.c i960-opcode.h as.h frags.h struc-symbol.h
217 i960.o: flonum.h expr.h hash.h md.h write.h read.h symbols.h
218 $(CC) -c $(CFLAGS) -DI80960 i960.c
220 write-i960.o: write.c
221 $(CC) -c $(CFLAGS) write.c
222 mv write.o write-i960.o
225 $(CC) -c $(CFLAGS) read.c
226 mv read.o read-i960.o
229 $(CC) -o a960 $(LDFLAGS) $a $t $(LOADLIBES)
232 $(MAKE) 'CFLAGS=$(CFLAGS) -DI80960' a960_cheat
236 # AM29K GAS ------------------------------------------------------------------
237 u = am29k.o atof-ieee.o write.o read.o
239 U = am29k.c am29k-opcode.h
241 am29k.o: am29k.c a.out.gnu.h as.h expr.h flonum.h frags.h hash.h
242 am29k.o: am29k-opcode.h md.h obstack.h struc-symbol.h
243 $(CC) $(CFLAGS) -c am29k.c
246 $(CC) -o asm29k $(LDFLAGS) $a $u $(LOADLIBES)
248 # I860 GAS ------------------------------------------------------------------
249 u = i860.o atof-ieee.o write.o read.o
251 U = i860.c i860-opcode.h
253 i860.o: i860.c i860-opcode.h as.h frags.h struc-symbol.h
254 i860.o: flonum.h expr.h hash.h md.h write.h read.h symbols.h
255 $(CC) -c $(CFLAGS) i860.c
257 atof-ieee.o: flonum.h
260 $(CC) -o a860 $(LDFLAGS) $a $u $(LOADLIBES)
262 # SPARC GAS ------------------------------------------------------------------
263 v = sparc.o atof-ieee.o write.o read.o
265 V = sparc.c sparc-opcode.h
267 atof-ieee.o: flonum.h
268 sparc.o: sparc.c reloc.h sparc-opcode.h as.h frags.h struc-symbol.h
269 sparc.o: flonum.h expr.h hash.h md.h write.h read.h symbols.h
270 $(CC) -c $(CFLAGS) -DSPARC sparc.c
273 $(CC) -o asparc $(LDFLAGS) $a $v $(LOADLIBES)
275 # NS32K GAS ------------------------------------------------------------------
276 w = ns32k.o atof-ieee.o write-ns32k.o read-ns32k.o
278 W = ns32k.c ns32k-opcode.h
280 atof-ieee.o: flonum.h
281 ns32k.o: as.h frags.h struc-symbol.h flonum.h expr.h md.h hash.h
282 ns32k.o: write.h symbols.h ns32k-opcode.h ns32k.c
283 $(CC) $(CFLAGS) $(OPTIONS) -c ns32k.c
285 write-ns32k.o: write.c
287 cp write.c write-ns32k.c
288 $(CC) -c -DNS32K $(CFLAGS) write-ns32k.c
293 cp read.c read-ns32k.c
294 $(CC) -c -DNS32K $(CFLAGS) read-ns32k.c
298 $(CC) -o a32k $(LDFLAGS) $a $w $(LOADLIBES)
300 # 80386 GAS ------------------------------------------------------------------
301 x = i386.o atof-ieee.o write.o read.o
303 X = i386.c i386.h i386-opcode.h
305 i386.o: i386.c as.h read.h flonum.h frags.h struc-symbol.h expr.h
306 i386.o: symbols.h hash.h md.h i386.h i386-opcode.h
307 $(CC) $(CFLAGS) $(OPTIONS) -c i386.c
309 atof-ieee.o: flonum.h
312 $(CC) -o a386 $(LDFLAGS) $a $x $(LOADLIBES)
314 # 68020 GAS ------------------------------------------------------------------
315 y = m68k.o atof-ieee.o write.o read.o
317 Y = m68k.c atof-ieee.c m68k-opcode.h m-hpux.h m-sun3.h m-generic.h
319 atof-ieee.o: flonum.h
321 m68k.o: m68k.c a.out.gnu.h as.h expr.h flonum.h frags.h hash.h
322 m68k.o: m68k-opcode.h m68k.h md.h obstack.h struc-symbol.h
323 $(CC) $(CFLAGS) $(OPTIONS) -c m68k.c
326 $(CC) -o a68 $(LDFLAGS) $a $y $(LOADLIBES)
328 # VAX GAS --------------------------------------------------------------------
329 z = vax.o atof-vax.o write.o read.o
331 Z = vax.c atof-vax.c vax-opcode.h vax-inst.h \
332 make-gas.com objrecdef.h vms.c vms-dbg.c README-vms-dbg
334 vax.o: vax.c a.out.gnu.h as.h expr.h flonum.h frags.h md.h obstack.h
335 vax.o: read.h struc-symbol.h symbols.h vax-inst.h vax-opcode.h
336 atof-vax.o: as.h flonum.h read.h
339 $(CC) -o avax $(LDFLAGS) $a $z $(LOADLIBES)
341 # global files ---------------------------------------------------------------
344 $(CC) $(CFLAGS) -Derror=as_fatal -c hash.c
347 $(CC) $(CFLAGS) -Derror=as_fatal -c xmalloc.c
349 xrealloc.o: xrealloc.c
350 $(CC) $(CFLAGS) -Derror=as_fatal -c xrealloc.c
353 as.c xrealloc.c xmalloc.c hash.c hex-value.c \
354 atof-generic.c messages.c expr.c bignum-copy.c \
355 frags.c input-file.c input-scrub.c output-file.c read.c \
356 subsegs.c symbols.c write.c strstr.c \
357 flonum-const.c flonum-copy.c flonum-mult.c app.c version.c \
359 #gdb.c gdb-file.c gdb-symbols.c gdb-blocks.c \
363 a.out.gnu.h as.h bignum.h expr.h flonum.h \
364 frags.h hash.h input-file.h md.h \
365 obstack.h read.h reloc.h struc-symbol.h subsegs.h \
368 dist: COPYING README ChangeLog $A $H $U $V $W $X $Y $Z Makefile
369 echo gas-`sed -n -e '/ version /s/[^0-9.]*\([0-9.]*\).*/\1/p' < version.c` > .fname
372 ln COPYING README ChangeLog $A $H $U $V $W $X $Y $Z Makefile `cat .fname`
373 tar cvhZf `cat .fname`.tar.Z `cat .fname`
374 -rm -rf .fname `cat .fname`
377 rm -f a avax a68 a386 a32k asparc asm29k a860 a960 $a $u $v $w $x $y $z a core gmon.out bugs a.out
381 install: install_tools
385 # For things like: emacs `make mdsrc`
389 LINT = /usr/5bin/lint
393 $(LINT) $(LINTFLAGS) $(CFLAGS) $A
395 # General .o-->.h dependencies
398 as.o: a.out.gnu.h as.h read.h struc-symbol.h write.h
399 atof-generic.o: flonum.h
400 bignum-copy.o: bignum.h
401 expr.o: a.out.gnu.h as.h expr.h flonum.h obstack.h read.h struc-symbol.h
403 flonum-const.o: flonum.h
404 flonum-copy.o: flonum.h
405 flonum-mult.o: flonum.h
406 flonum-normal.o:flonum.h
407 flonum-print.o: flonum.h
408 frags.o: a.out.gnu.h as.h frags.h obstack.h struc-symbol.h subsegs.h
411 #gdb-lines.o: as.h frags.h obstack.h
412 #gdb-symbols.o: a.out.gnu.h as.h struc-symbol.h
414 input-file.o: input-file.h
415 input-scrub.o: as.h input-file.h read.h
418 read.o: a.out.gnu.h as.h expr.h flonum.h frags.h hash.h md.h obstack.h
419 read.o: read.h struc-symbol.h symbols.h reloc.h
420 subsegs.o: a.out.gnu.h as.h frags.h obstack.h struc-symbol.h subsegs.h write.h
421 symbols.o: a.out.gnu.h as.h frags.h hash.h obstack.h struc-symbol.h symbols.h
422 write.o: a.out.gnu.h as.h md.h obstack.h struc-symbol.h subsegs.h
423 write.o: symbols.h write.h reloc.h
430 etags Makefile* README* config.gas *.[hc]