--- gas/Makefile 2018/04/24 16:37:52 1.1.1.1 +++ gas/Makefile 2018/04/24 16:38:39 1.1.1.3 @@ -1,68 +1,233 @@ -# This makefile may be used to make either the VAX or the 68020 assembler +# Makefile for GAS. +# Copyright (C) 1989, Free Software Foundation +# +# This file is part of GAS, the GNU Assembler. +# +# GAS is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 1, or (at your option) +# any later version. +# +# GAS is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GAS; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -# This makefile must be changed to to compile the 68020 assembler on -# the HPUX machines. See the instructions around line 23. (They should -# be clearly marked with HPUX.) +# This makefile may be used to make the VAX, 68020, 80386, +# SPARC, or ns32k assembler(s). -# To make the 68020 assembler compile as the default, un-comment the next -# four lines, and comment out the four lines below the next (text) comment -a: a68 - @rm -f a - @ln a68 a -lint: lint_68k -# To make the VAX assembler compile as the default, un-comment the next four -# lines, and comment out the four lines above this comment -#a: avax -# @rm -f a -# @ln avax a -#lint: lint_vax - -# NOTE: m68k.h should be a symlink to either m-sun3.h , m-hpux.h or m-generic.h -# depending on which machine you want to compile the 68020 assembler for. - -# To compile for HPUX, symlink m-hpux.h to m68k.h , un-comment the -# next two lines, and comment out the CFLAGS line seven lines (or so) down. -# CFLAGS = -g -I../hp-include -I. -# LOADLIBES = -lGNU - -# to include the mc68851 mmu coprocessor instructions un-comment -# the next line, and comment out the following line. (68020 only) -# CFLAGS = -g -I. -Dm68851 +# If you are on a BSD system, un-comment the next two lines, and comment out +# the lines for SystemV and HPUX below CFLAGS = -g -I. LDFLAGS = $(CFLAGS) +# To compile gas on a System Five machine, comment out the two lines above +# and un-comment out the next three lines +# Comment out the -lPW on the LOADLIBES line if you are using GCC. +# CFLAGS = -g -I. -DUSG +# LDFLAGS = $(CFLAGS) +# LOADLIBES = -lmalloc -lPW +# To compile gas for HPUX, link m-hpux.h to m68k.h , and un-comment the +# next two lines. (If you are using GCC, comment out the alloca.o part) +# (Get alloca from the emacs distribution, or use GCC.) +# CFLAGS = -g -I. -DUSG +# LOADLIBES = alloca.o + +# If you just want to compile the vax assembler, type 'make avax' + +# If you just want to compile the i386 assembler, type 'make a386' + +# If you just want to compile the ns32k assembler, type 'make a32k' + +# If you just want to compile the sparc assembler, type 'make asparc' + +# If you just want to compile the mc68020 assembler, make sure m68k.h +# is correctly set up, and type type 'make a68' (Except on HPUX machines, +# where you will have to make the changes marked below before typing +# 'make a68' +# m68k.h should be a symbolic or hard-link to one of +# m-sun3.h , m-hpux.h or m-generic.h +# depending on which machine you want to compile the 68020 assembler for. +# +# If you machine does not have vfprintf, but does have _doprnt(), +# remove the # from the -DNO_VARARGS line below. +# +# To include the mc68851 mmu coprocessor instructions in the 68020 assembler, +# remove the # from the -Dm68851 line below. +# +# If you want the 80386 assembler to correctly handle fsub/fsubr and fdiv/fdivr +# opcodes (unlike most 80386 assemblers), remove the # from +# the -DNON_BROKEN_WORDS line below. + +O1 = -DNO_VARARGS +O2 = # -DNON_BROKEN_WORDS +O3 = # -Dm68851 + +OPTIONS = $(O1) $(O2) $(O3) -x =\ -as.o xrealloc.o xmalloc.o hash.o hex-value.o\ -atof-generic.o append.o messages.o expr.o app.o\ -frags.o input-file.o input-scrub.o output-file.o read.o\ -subsegs.o symbols.o write.o error.o version.o\ +# +# To make the 68020 assembler compile as the default, un-comment the next +# line, and comment out all the other lines that start with DEFAULT_GAS +DEFAULT_GAS=a68 +# +# To make the VAX assembler compile as the default, un-comment the next +# line and commment out all the other lines that start with DEFAULT_GAS +#DEFAULT_GAS=avax +# +# To make the 80386 assembler compile as the default, un-comment the next +# line and commment out all the other lines that start with DEFAULT_GAS +#DEFAULT_GAS=a386 +# +# To make the ns32k assembler compile as the default, un-comment the next +# line and commment out all the other lines that start with DEFAULT_GAS +#DEFAULT_GAS=a32k +# +# To make the sparc assembler compile as the default, un-comment the next +# line and commment out all the other lines that start with DEFAULT_GAS +#DEFAULT_GAS=asparc + +# Global Sources ------------------------------------------------------------- + +a =\ +as.o xrealloc.o xmalloc.o hash.o hex-value.o \ +atof-generic.o append.o messages.o expr.o app.o \ +frags.o input-file.o input-scrub.o output-file.o \ +subsegs.o symbols.o version.o \ flonum-const.o flonum-copy.o flonum-mult.o strstr.o bignum-copy.o \ -gdb.o gdb-file.o gdb-symbols.o gdb-blocks.o obstack.o\ +gdb.o gdb-file.o gdb-symbols.o gdb-blocks.o obstack.o \ gdb-lines.o +a: $(DEFAULT_GAS) + @rm -f a + @ln $(DEFAULT_GAS) a -# files that aren't used flonum-normal.o flonum-print.o cpystr.o -y =\ -m68k.o atof-m68k.o -z = \ -vax.o atof-vax.o +# SPARC GAS ------------------------------------------------------------------ +v = sparc.o atof-m68k.o write-sparc.o read-sparc.o -a68: $x $y - $(CC) -o a68 $(LDFLAGS) $x $y $(LOADLIBES) +V = sparc.c sparc.h sparc-opcode.h -avax: $x $z - $(CC) -o avax $(LDFLAGS) $x $z $(LOADLIBES) +atof-m68k.o: flonum.h +sparc.o: sparc.c sparc.h sparc-opcode.h as.h frags.h struc-symbol.h +sparc.o: flonum.h expr.h hash.h md.h write.h read.h symbols.h + $(CC) -c $(CFLAGS) -DSPARC sparc.c +write-sparc.o: write.c + $(CC) -c -DSPARC $(CFLAGS) $< + mv write.o write-sparc.o -m68k.o: a.out.h as.h expr.h flonum.h frags.h hash.h -m68k.o: m68k-opcode.h m68k.h md.h obstack.h struc-symbol.h pmmu.h +read-sparc.o: read.c + $(CC) -c -DSPARC $(CFLAGS) $< + mv read.o read-sparc.o -app.o: as.h +asparc: $a $v + $(CC) -o asparc $(LDFLAGS) $a $v $(LOADLIBES) + +# NS32K GAS ------------------------------------------------------------------ +w = ns32k.o atof-ns32k.o write.o read.o + +W = ns32k.c atof-ns32k.c ns32k-opcode.h + +atof-ns32k.o: flonum.h +ns32k.o: as.h frags.h struc-symbol.h flonum.h expr.h md.h hash.h +ns32k.o: write.h symbols.h ns32k-opcode.h + +a32k: $a $w + $(CC) -o a32k $(LDFLAGS) $a $w $(LOADLIBES) + +# 80386 GAS ------------------------------------------------------------------ +x = i386.o atof-i386.o write.o read.o + +X = i386.c atof-i386.c i386.h i386-opcode.h + +i386.o: i386.c as.h read.h flonum.h frags.h struc-symbol.h expr.h +i386.o: symbols.h hash.h md.h i386.h i386-opcode.h + $(CC) $(CFLAGS) $(OPTIONS) -c $< + +atof-i386.o: flonum.h + +a386: $a $x + $(CC) -o a386 $(LDFLAGS) $a $x $(LOADLIBES) + +# 68020 GAS ------------------------------------------------------------------ +y = m68k.o atof-m68k.o write.o read.o + +Y = m68k.c atof-m68k.c m68k-opcode.h m-hpux.h m-sun3.h m-generic.h -as.o: a.out.h as.h read.h struc-symbol.h write.h -atof-generic.o: flonum.h atof-m68k.o: flonum.h +m68k.o: m68k.c a.out.h as.h expr.h flonum.h frags.h hash.h +m68k.o: m68k-opcode.h m68k.h md.h obstack.h struc-symbol.h + $(CC) $(CFLAGS) $(OPTIONS) -c $< + +a68: $a $y + $(CC) -o a68 $(LDFLAGS) $a $y $(LOADLIBES) + +# VAX GAS -------------------------------------------------------------------- +z = vax.o atof-vax.o write.o read.o + +Z = vax.c atof-vax.c vax-opcode.h vax-inst.h make-gas.com objrecdef.h vms.c + +vax.o: vax.c a.out.h as.h expr.h flonum.h frags.h md.h obstack.h +vax.o: read.h struc-symbol.h symbols.h vax-inst.h vax-opcode.h atof-vax.o: as.h flonum.h read.h + +avax: $a $z + $(CC) -o avax $(LDFLAGS) $a $z $(LOADLIBES) + +# global files --------------------------------------------------------------- + +messages.o: messages.c + $(CC) $(CFLAGS) $(OPTIONS) -c $< + +hash.o: hash.c + $(CC) $(CFLAGS) -Derror=as_fatal -c $< + +xmalloc.o: xmalloc.c + $(CC) $(CFLAGS) -Derror=as_fatal -c $< + +xrealloc.o: xrealloc.c + $(CC) $(CFLAGS) -Derror=as_fatal -c $< + +A =\ +as.c xrealloc.c xmalloc.c hash.c hex-value.c \ +atof-generic.c append.c messages.c expr.c bignum-copy.c \ +frags.c input-file.c input-scrub.c output-file.c read.c \ +subsegs.c symbols.c write.c strstr.c \ +flonum-const.c flonum-copy.c flonum-mult.c app.c version.c \ +gdb.c gdb-file.c gdb-symbols.c gdb-blocks.c obstack.c \ +gdb-lines.c + +H = \ +a.out.h as.h bignum.h expr.h flonum.h \ +frags.h hash.h input-file.h md.h \ +obstack.h read.h struc-symbol.h subsegs.h \ +symbols.h write.h + +gas-dist.tar: COPYING README $A $H $Z $Y $X $W $V Makefile + -rm -r gas-dist + mkdir gas-dist + ln COPYING README $A $H $Z $Y $X $W $V Makefile gas-dist + tar cvhf gas-dist.tar gas-dist + +gas-dist.tar.Z: gas-dist.tar + compress < gas-dist.tar > gas-dist.tar.Z + +clean: + rm -f a avax a68 a386 a32k asparc $a $v $w $x $y $z a core gmon.out bugs a.out + +dist: gas-dist.tar gas-dist.tar.Z + +install: a + cp a /usr/local/bin/gas + + +# General .o-->.h dependencies + +app.o: as.h +as.o: a.out.h as.h read.h struc-symbol.h write.h +atof-generic.o: flonum.h bignum-copy.o: bignum.h expr.o: a.out.h as.h expr.h flonum.h obstack.h read.h struc-symbol.h expr.o: symbols.h @@ -85,57 +250,8 @@ read.o: a.out.h as.h expr.h flonum.h fr read.o: read.h struc-symbol.h symbols.h subsegs.o: a.out.h as.h frags.h obstack.h struc-symbol.h subsegs.h write.h symbols.o: a.out.h as.h frags.h hash.h obstack.h struc-symbol.h symbols.h -vax.o: a.out.h as.h expr.h flonum.h frags.h md.h obstack.h read.h -vax.o: struc-symbol.h symbols.h vax-inst.h vax-opcode.h write.o: a.out.h as.h md.h obstack.h struc-symbol.h subsegs.h write.o: symbols.h write.h flonum.h: bignum.h -# app is no longer a separate process. -# app: app.c -# $(CC) -o app app.c -clean: - rm -f avax a68 $x $y $z a core gmon.out - -oprint: oprint.o pp.o - $(CC) $(LDFLAGS) -o oprint oprint.o pp.o - - -A =\ -as.c xrealloc.c xmalloc.c hash.c hex-value.c\ -atof-generic.c append.c messages.c expr.c bignum-copy.c\ -frags.c input-file.c input-scrub.c output-file.c read.c\ -subsegs.c symbols.c write.c error.c strstr.c\ -flonum-const.c flonum-copy.c flonum-mult.c app.c version.c\ -gdb.c gdb-file.c gdb-symbols.c gdb-blocks.c obstack.c\ -gdb-lines.c - -B =\ -m68k.c atof-m68k.c - -C =\ -vax.c atof-vax.c - -H = \ -a.out.h as.h bignum.h expr.h flonum.h \ -frags.h hash.h input-file.h m68k-opcode.h md.h \ -obstack.h read.h struc-symbol.h subsegs.h \ -symbols.h vax-inst.h vax-opcode.h write.h \ -m-sun3.h m-generic.h pmmu.h m-hpux.h - -# JF unused flonum-normal.c flonum-print.c cpystr.c - -lint_68k: - lint -I. $A $B - -lint_vax: - lint -I. $A $C - -gas-dist.tar: COPYING README $A $B $C $H Makefile - tar cvf gas-dist.tar COPYING README $A $B $C $H Makefile - -gas-dist.tar.Z: gas-dist.tar - compress < gas-dist.tar > gas-dist.tar.Z - -dist: gas-dist.tar gas-dist.tar.Z