#
# Copyright (c) 1980 Regents of the University of California.
# All rights reserved.  The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
#
#	@(#)Makefile	5.3 (Berkeley) 4/28/86
#
#
#	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 instrs.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

DESTDIR = 

#
#	available flags:
#
#	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.
#			
DEFS=	-DFLEXNAMES
AS=	/bin/as
CFLAGS= -O ${DEFS} 

as:	${OBJS}
	${CC} ${OBJS} -o as

.c.o:	astoks.h ${HDRS}
	${CC} ${CFLAGS} -c $*.c

aspseudo.o:	as.h astoks.h instrs fp_pseudo
	${CC} ${DEFS} -c -R aspseudo.c

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

mkinstrs:	mkinstrs.c
	${CC} ${CFLAGS} mkinstrs.c -o mkinstrs

clean:
	rm -f ${OBJS} as instrs mkinstrs rslts a.out Errs core

install: as
	install -s as ${DESTDIR}/bin

lint:
	lint -hvx ${DEFS} ${SRCS}

print:
	pr Makefile ${HDRS} ${SRCS}
