LOCAL = /usr/ucb/
I = -I.

#
#	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 aspseudo.c; instructions and semantic info
#				for each instruction
#	fp_pseudo	included in aspseudo.c; semantic info for each
#				68881 FPU instruction
#

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 = /usr

#
#	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.
#			

AS = /bin/as
LD = /bin/ld

OPTS = -O

LDFLAGS = $(OPTS)

CFLAGS=  -DUNIX -DUNIXDEVEL -DFLEXNAMES $I $(OPTS)

LINTFLAGS = -DUNIX -DUNIXDEVEL -DFLEXNAMES $I

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

lint:
	lint $(LINTFLAGS) $(SRCS)

aspseudo.o :	as.h astoks.h instrs fp_pseudo
#	$(CC) $(CFLAGS) -R -c aspseudo.c
#	DON'T use -O here unless you *really* like to wait on compiles!
	$(CC) -DUNIX -DUNIXDEVEL -DFLEXNAMES $I -R -c aspseudo.c

instrs: instrs.src
	./mkinstrs < instrs.src > instrs

mkinstrs:	mkinstrs.c
	$(CC) $(CFLAGS) mkinstrs.c -o mkinstrs

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

clean:
	rm -f $(OBJS) as
install: as
	install -s as ${DESTDIR}/bin/fpas

print:
	pr Makefile $(HDRS) $(SRCS)

netprint:
	csh /usr/grad/henry/bin/:netprint Makefile $(HDRS) $(SRCS)

vgrind:
	vgrind $(GRIND)

sources: ${SRCS} ${HDRS}
${SRCS} ${HDRS}:
	sccs get $@
