#
#	as.h		Definitions for data structures
#	asscan.h	Definitions for the character scanner
#	astoks.h	The defines for tokens that yacc produced
#				included implicitly in as.h
#	asexpr.h	The macros for parsing and expressions
#	assyms.h	Macros for dealing with the symbol table
#
#	asscan.c	lexical analyzer and the character scanner
#	asparse.c	parser
#	asexpr.c	parses expressions, constructs and evaluates
#				expression trees
#
#	asmain.c	main body
#	assyms.c	symbol table processing routines
#	asjxxx.c	Fixes jxxx instructions
#	ascode.c	Emits code
#	asio.c		Does block I/O and faster versions of fwrite
#
#	aspseudo.c	Symbol table definitions for reserved words
#	instrs		included in pseudo.c; instructions and semantic info
#				for each instructions
#

HDRS = astoks.h as.h asscan.h assyms.h asexpr.h 

SRCS = asscan.c asmain.c asparse.c \
	asexpr.c assyms.c \
	asjxxx.c ascode.c aspseudo.c \
	asio.c

OBJS = asscan.o asparse.o asexpr.o \
	asmain.o assyms.o \
	asjxxx.o ascode.o aspseudo.o \
	asio.o

GRIND = astoks.h as.h asscan.h assyms.h asexpr.h \
	asmain.c asscan.c asparse.c asexpr.c \
	assyms.c asjxxx.c ascode.c asio.c

DESTDIR = 
#
#	available flags:
#
#  (UNIX and VMS are mutually exclusive.)
#	UNIX		Must be set if the assembler is to produce a.out
#			files for UNIX.
#
#	VMS		Must be set if the assembler is to produce executables
#			for VMS (Thanks to David Kashtan, SRI for these fixes)
#
#	if VMS is set, then these two flags are also valid:
#			(necessary to frob system calls and '$' conventions
#	VMSDEVEL	The assembler is being compiled under VMS
#	UNIXDEVEL	The assembler is being compiled under UNIX
#
#
#	DEBUG		print out various debugging information
#			in the first pass
#
#	FLEXNAMES	All names are stored internally as true character
#			strings, null terminated, and can be no more
#			than BUFSIZ long.
#			

LD = /bin/ld

LDFLAGS= -n

I=-I/usr/gun/usr/include		# cross stuff 
CC=xcc
.c.o:
	$(CC) $(CFLAGS) -c $<

CFLAGS=  -DDEBUG -DUNIX -DUNIXDEVEL -DFLEXNAMES $I 

LINTFLAGS = -DUNIX -DUNIXDEVEL -DFLEXNAMES

as:	$(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) -o as

lint:
	lint $(LINTFLAGS) $(SRCS)

aspseudo.o :	as.h astoks.h aspseudo.c instrs 
	$(CC) -S $(CFLAGS) aspseudo.c
	$(AS) -o aspseudo.o aspseudo.s
	rm aspseudo.s

clean:
	rm -f $(OBJS) as a.out rslts core
install:
	install -s as ${DESTDIR}/bin

ascode.o:	ascode.c
ascode.o:	as.h astoks.h
ascode.o:	assyms.h
asexpr.o:	asexpr.c
asexpr.o:	as.h astoks.h
asexpr.o:	asexpr.h
asio.o:		asio.c
asio.o:		as.h astoks.h
asjxxx.o:	asjxxx.c
asjxxx.o:	as.h astoks.h
asjxxx.o:	assyms.h
asmain.o:	asmain.c
asmain.o:	as.h astoks.h
asmain.o:	assyms.h
asmain.o:	asexpr.h
asmain.o:	asscan.h
asparse.o:	asparse.c
asparse.o:	as.h astoks.h
asparse.o:	asexpr.h
asparse.o:	asscan.h
asparse.o:	assyms.h
aspseudo.o:	aspseudo.c
aspseudo.o:	as.h astoks.h
aspseudo.o:	instrs
asscan.o:	asscan.c
asscan.o:	as.h astoks.h
asscan.o:	asscan.h
assyms.o:	assyms.c
assyms.o:	as.h astoks.h
assyms.o:	asscan.h
assyms.o:	assyms.h
