This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / gnu / usr.bin / as / Makefile.gnu
CommitLineData
7b374118
NW
1# Makefile for GAS.
2# Copyright (C) 1989, Free Software Foundation
3#
4# This file is part of GAS, the GNU Assembler.
5#
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)
9# any later version.
10#
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.
15#
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.
19
20# This makefile may be used to make the VAX, 68020, 80386,
21# SPARC, ns32k, or i860 assembler(s).
22
23BINDIR = /usr/local/bin
24#CC=gcc
25
26# If you are on a BSD system, un-comment the next two lines, and comment out
27# the lines for SystemV and HPUX below
28G0 = -g -I. #-O -Wall
29LDFLAGS = $(CFLAGS)
30#
31# To compile gas on a System Five machine, comment out the two lines above
32# and un-comment out the next three lines
33# Comment out the -lPW on the LOADLIBES line if you are using GCC.
34# G0 = -g -I. -DUSG
35# LDFLAGS = $(CFLAGS)
36# LOADLIBES = -lmalloc -lPW
37#
38# To compile gas for HPUX, link m-hpux.h to m68k.h , and un-comment the
39# next two lines. (If you are using GCC, comment out the alloca.o part)
40# (Get alloca from the emacs distribution, or use GCC.)
41# HPUX 7.0 may have a bug in setvbuf. gas gives an error message like
42# 1:"Unknown operator" -- Statement 'NO_APP' ignored
43# if setvbuf is broken. Re-compile input-file.c (and only input-file.c
44# with -DVMS and the problem should go away.
45#
46# G0 = -g -I. -DUSG
47# LOADLIBES = alloca.o
48#
49# To compile gas for a Sequent Symmetry, comment out all the above lines,
50# and un-comment the next two lines.
51# G0 = -g -I. -DUSE_SYSTEM_HDR -DEXEC_VERSION=1
52# LOADLIBES = -lc /usr/att/lib/libc.a
53
54# If you just want to compile the vax assembler, type 'make avax'
55
56# If you just want to compile the i386 assembler, type 'make a386'
57
58# If you just want to compile the ns32k assembler, type 'make a32k'
59
60# If you just want to compile the sparc assembler, type 'make asparc'
61
62# If you just want to compile the mc68020 assembler, make sure m68k.h
63# is correctly set up, and type type 'make a68' (Except on HPUX machines,
64# where you will have to make the changes marked below before typing
65# 'make a68'
66# m68k.h should be a symbolic or hard-link to one of
67# m-sun3.h , m-hpux.h or m-generic.h
68# depending on which machine you want to compile the 68020 assembler for.
69#
70# If you want the 68k assembler to be completely compatable with the the
71# SUN one, un-comment the -DSUN_ASM_SYNTAX line below.
72#
73# If you machine does not have vfprintf, but does have _doprnt(),
74# remove the # from the -DNO_VARARGS line below.
75#
76# If the return-type of a signal-hander is void (instead of int),
77# remove the # from the -DSIGTY line below.
78#
79# To include the mc68851 mmu coprocessor instructions in the 68020 assembler,
80# remove the # from the -Dm68851 line below.
81#
82# If you want the 68020 assembler use a register prefix character, un-comment
83# the REGISTER_PREFIX line, and (maybe) change the '%' to the appropriate
84# character.
85#
86# If you want the assembler to treat .L* or ..* symbols as local, instead of
87# the usual L* symbols, un-comment the DOT_LABEL_PREFIX line.
88#
89# If you want the 80386 assembler to correctly handle fsub/fsubr and fdiv/fdivr
90# opcodes (unlike most 80386 assemblers), remove the # from
91# the -DNON_BROKEN_WORDS line below.
92#
93# To compile 80386 Gas for the Sequent Symmetry, un-comment the -DEXEC_VERSION
94# and the -DUSE_SYSTEM_HDR lines below.
95#
96# To compile gas for the HP 9000/300 un-comment the -DUSE_HP_HDR line below.
97#
98# For the ns32k, the options are 32532 or 32032 CPU and 32381 or 32081 FPU.
99# To select the NS32532, remove the # from the -DNS32532 line below.
100# To compile in tne NS32381 opcodes in addition to the NS32081 opcodes
101# (the 32381 is a superset of the 32081), remove the # from the -DNS32381
102# line below.
103#
104# For the ns32k on a Sequent, uncomment the SEQUENT_COMPATABILITY line below.
105#
106# If you want the .align N directive to align to the next N byte boundry,
107# instead of the next 1<<N boundry, un-comment the OTHER_ALIGN line below.
108# (This option is automatically enabled when building the sparc assembler.
109#
110
111O1 = -DNO_VARARGS
112O2 = # -DNON_BROKEN_WORDS
113O3 = # -Dm68851
114O4 = # -DEXEC_VERSION=1
115O5 = # -DSIGTY=void
116O6 = # -DNS32532
117O6 = # -DNS32381
118O7 = # -DDOT_LABEL_PREFIX
119O8 = # -DSEQUENT_COMPATABILITY
120O9 = # -DREGISTER_PREFIX=\'%\'
121O10= # -DOTHER_ALIGN
122
123G1 = # -DUSE_SYSTEM_HDR
124G2 = # -DUSE_HP_HDR
125G3 = # -DSUN_ASM_SYNTAX
126
127OPTIONS = $(O1) $(O2) $(O3) $(O4) $(O5) $(O6) $(O7) $(O8) $(O9) $(O10)
128
129CFLAGS = $(G0) $(G1) $(G2) $(G3) $(G4)
130
131#
132# To make the 68020 assembler compile as the default, un-comment the next
133# line, and comment out all the other lines that start with DEFAULT_GAS
134DEFAULT_GAS=a68
135#
136# To make the VAX assembler compile as the default, un-comment the next
137# line and commment out all the other lines that start with DEFAULT_GAS
138#DEFAULT_GAS=avax
139#
140# To make the 80386 assembler compile as the default, un-comment the next
141# line and commment out all the other lines that start with DEFAULT_GAS
142#DEFAULT_GAS=a386
143#
144# To make the ns32k assembler compile as the default, un-comment the next
145# line and commment out all the other lines that start with DEFAULT_GAS
146#DEFAULT_GAS=a32k
147#
148# To make the sparc assembler compile as the default, un-comment the next
149# line and commment out all the other lines that start with DEFAULT_GAS
150#DEFAULT_GAS=asparc
151#
152# To make the i860 assembler compile as the default, un-comment the next
153# line and comment out all the other lines that start with DEFAULT_GAS
154#DEFAULT_GAS=a860
155
156# Global Sources -------------------------------------------------------------
157
158a =\
159as.o xrealloc.o xmalloc.o hash.o hex-value.o \
160atof-generic.o append.o messages.o expr.o app.o \
161frags.o input-file.o input-scrub.o output-file.o \
162subsegs.o symbols.o version.o \
163flonum-const.o flonum-copy.o flonum-mult.o strstr.o bignum-copy.o \
164obstack.o
165#gdb.o gdb-file.o gdb-symbols.o gdb-blocks.o gdb-lines.o
166
167a: $(DEFAULT_GAS)
168 @rm -f a
169 @ln $(DEFAULT_GAS) a
170
171# I860 GAS ------------------------------------------------------------------
172u = i860.o atof-ieee.o write-i860.o read-i860.o
173
174U = i860.c i860.h i860-opcode.h
175
176i860.o: i860.c i860.h i860-opcode.h as.h frags.h struc-symbol.h
177i860.o: flonum.h expr.h hash.h md.h write.h read.h symbols.h
178 $(CC) -c $(CFLAGS) -DI860 i860.c
179
180atof-ieee.o: flonum.h
181
182write-i860.o: write.c i860.h
183 $(CC) -c -DI860 $(CFLAGS) write.c
184 mv write.o write-i860.o
185
186read-i860.o: read.c i860.h
187 $(CC) -c -DI860 $(CFLAGS) read.c
188 mv read.o read-i860.o
189
190a860: $a $u
191 $(CC) -o a860 $(LDFLAGS) $a $u $(LOADLIBES)
192
193# SPARC GAS ------------------------------------------------------------------
194v = sparc.o atof-ieee.o write-sparc.o read-sparc.o
195
196V = sparc.c sparc.h sparc-opcode.h
197
198atof-ieee.o: flonum.h
199sparc.o: sparc.c sparc.h sparc-opcode.h as.h frags.h struc-symbol.h
200sparc.o: flonum.h expr.h hash.h md.h write.h read.h symbols.h
201 $(CC) -c $(CFLAGS) -DSPARC sparc.c
202
203write-sparc.o: write.c
204 $(CC) -c -DSPARC $(CFLAGS) write.c
205 mv write.o write-sparc.o
206
207read-sparc.o: read.c
208 $(CC) -c -DSPARC $(CFLAGS) read.c
209 mv read.o read-sparc.o
210
211asparc: $a $v
212 $(CC) -o asparc $(LDFLAGS) $a $v $(LOADLIBES)
213
214# NS32K GAS ------------------------------------------------------------------
215w = ns32k.o atof-ieee.o write-ns32k.o read-ns32k.o
216
217W = ns32k.c ns32k-opcode.h
218
219atof-ieee.o: flonum.h
220ns32k.o: as.h frags.h struc-symbol.h flonum.h expr.h md.h hash.h
221ns32k.o: write.h symbols.h ns32k-opcode.h ns32k.c
222 $(CC) $(CFLAGS) $(OPTIONS) -c ns32k.c
223
224write-ns32k.o: write.c
225 $(CC) -c -DNS32K $(CFLAGS) write.c
226 mv write.o write-ns32k.o
227
228read-ns32k.o:
229 $(CC) -c -DNS32K $(CFLAGS) read.c
230 mv read.o read-ns32k.o
231
232a32k: $a $w
233 $(CC) -o a32k $(LDFLAGS) $a $w $(LOADLIBES)
234
235# 80386 GAS ------------------------------------------------------------------
236x = i386.o atof-ieee.o write.o read.o
237
238X = i386.c i386.h i386-opcode.h
239
240i386.o: i386.c as.h read.h flonum.h frags.h struc-symbol.h expr.h
241i386.o: symbols.h hash.h md.h i386.h i386-opcode.h
242 $(CC) $(CFLAGS) $(OPTIONS) -c i386.c
243
244atof-ieee.o: flonum.h
245
246a386: $a $x
247 $(CC) -o a386 $(LDFLAGS) $a $x $(LOADLIBES)
248
249# 68020 GAS ------------------------------------------------------------------
250y = m68k.o atof-ieee.o write.o read.o
251
252Y = m68k.c atof-ieee.c m68k-opcode.h m-hpux.h m-sun3.h m-generic.h
253
254atof-ieee.o: flonum.h
255
256m68k.o: m68k.c a.out.gnu.h as.h expr.h flonum.h frags.h hash.h
257m68k.o: m68k-opcode.h m68k.h md.h obstack.h struc-symbol.h
258 $(CC) $(CFLAGS) $(OPTIONS) -c m68k.c
259
260a68: $a $y
261 $(CC) -o a68 $(LDFLAGS) $a $y $(LOADLIBES)
262
263# VAX GAS --------------------------------------------------------------------
264z = vax.o atof-vax.o write.o read.o
265
266Z = vax.c atof-vax.c vax-opcode.h vax-inst.h \
267 make-gas.com objrecdef.h vms.c vms-dbg.c README-vms-dbg
268
269vax.o: vax.c a.out.gnu.h as.h expr.h flonum.h frags.h md.h obstack.h
270vax.o: read.h struc-symbol.h symbols.h vax-inst.h vax-opcode.h
271atof-vax.o: as.h flonum.h read.h
272
273avax: $a $z
274 $(CC) -o avax $(LDFLAGS) $a $z $(LOADLIBES)
275
276# global files ---------------------------------------------------------------
277
278as.o: as.c
279 $(CC) $(CFLAGS) $(OPTIONS) -c as.c
280
281messages.o: messages.c
282 $(CC) $(CFLAGS) $(OPTIONS) -c messages.c
283
284hash.o: hash.c
285 $(CC) $(CFLAGS) -Derror=as_fatal -c hash.c
286
287xmalloc.o: xmalloc.c
288 $(CC) $(CFLAGS) -Derror=as_fatal -c xmalloc.c
289
290xrealloc.o: xrealloc.c
291 $(CC) $(CFLAGS) -Derror=as_fatal -c xrealloc.c
292
293A =\
294as.c xrealloc.c xmalloc.c hash.c hex-value.c \
295atof-generic.c append.c messages.c expr.c bignum-copy.c \
296frags.c input-file.c input-scrub.c output-file.c read.c \
297subsegs.c symbols.c write.c strstr.c \
298flonum-const.c flonum-copy.c flonum-mult.c app.c version.c \
299obstack.c \
300#gdb.c gdb-file.c gdb-symbols.c gdb-blocks.c \
301#gdb-lines.c
302
303H = \
304a.out.gnu.h as.h bignum.h expr.h flonum.h \
305frags.h hash.h input-file.h md.h \
306obstack.h read.h struc-symbol.h subsegs.h \
307symbols.h write.h
308
309dist: COPYING README ChangeLog $A $H $Z $Y $X $W $V $U Makefile
310 echo gas-`sed -n -e '/ version /s/[^0-9.]*\([0-9.]*\).*/\1/p' < version.c` > .fname
311 mkdir `cat .fname`
312
313 ln COPYING README ChangeLog $A $H $Z $Y $X $W $V $U Makefile `cat .fname`
314 tar cvhZf `cat .fname`.tar.Z `cat .fname`
315 -rm -r `cat .fname`
316 -rm .fname
317
318clean:
319 rm -f a avax a68 a386 a32k asparc $a $v $w $x $y $z a core gmon.out bugs a.out
320
321install: a
322 cp a $(BINDIR)/gas
323
324
325# General .o-->.h dependencies
326
327app.o: as.h
328as.o: a.out.gnu.h as.h read.h struc-symbol.h write.h
329atof-generic.o: flonum.h
330bignum-copy.o: bignum.h
331expr.o: a.out.gnu.h as.h expr.h flonum.h obstack.h read.h struc-symbol.h
332expr.o: symbols.h
333flonum-const.o: flonum.h
334flonum-copy.o: flonum.h
335flonum-mult.o: flonum.h
336flonum-normal.o:flonum.h
337flonum-print.o: flonum.h
338frags.o: a.out.gnu.h as.h frags.h obstack.h struc-symbol.h subsegs.h
339#gdb.o: as.h
340#gdb-blocks.o: as.h
341#gdb-lines.o: as.h frags.h obstack.h
342#gdb-symbols.o: a.out.gnu.h as.h struc-symbol.h
343hash.o: hash.h
344input-file.o: input-file.h
345input-scrub.o: as.h input-file.h read.h
346messages.o: as.h
347obstack.o: obstack.h
348read.o: a.out.gnu.h as.h expr.h flonum.h frags.h hash.h md.h obstack.h
349read.o: read.h struc-symbol.h symbols.h
350subsegs.o: a.out.gnu.h as.h frags.h obstack.h struc-symbol.h subsegs.h write.h
351symbols.o: a.out.gnu.h as.h frags.h hash.h obstack.h struc-symbol.h symbols.h
352write.o: a.out.gnu.h as.h md.h obstack.h struc-symbol.h subsegs.h
353write.o: symbols.h write.h
354
355flonum.h: bignum.h
356