#
# SCCSID = "%W% %Y% %Q% %G%"
#
# makefile for adb	11/16/83
#	
#	modifications 01/19/84 -- jaa
#	make depend added 05/31/85 -- bog
#	-z changed to -Z to comply w/sbs change to cc 06/12/85 -- bog
#	use COPTS -- passed down from kernel's "make adb:"  -- 091185 bog
#	make adb load as a 413 file. Remove -Z option -- too noisy. (100585 bog)
#
# NB:	machine.h contains implementation dependent constants
#	U_VA for start of user virtual address space, currently
#	1 Meg (0x100000), u_pagesize which is currently
#	4096 (0x1000), and U_USRTOP which is now fixed at
#	page 3f0. Any future implementation which alters
#	these constants will also necessitate a change to machine.h
#		SAS	11/16/83
DESTDIR	=

MODULES =	access command expr\
		format input main message\
		opset output pcs print\
		process runpcs setup sym

OFILES 	=	access.o command.o expr.o\
		format.o input.o main.o message.o\
		opset.o output.o pcs.o print.o\
		process.o runpcs.o setup.o sym.o
CC 	= /bin/cc
# Load adb as a 413 (demand-paged) object.
LD413 	= /bin/ld -z
CFLAGS 	= -O ${COPTS} -I. -z


adb:	${OFILES}
	${LD413} /lib/crt0.o -o adb ${OFILES} -lc -x

install:
	install -s adb ${DESTDIR}bin

clean:
	rm -f adb ${OFILES} core a.out adb.make

depend:
	cat </dev/null >x.c
	for i in ${MODULES}; do \
		(echo $$i.o: $$i.c >>makedep; \
		grep '^#[ 	]*include' x.c $$i.c | sed \
			-e 's,<\(.*\)>,"/usr/include/\1",' \
			-e 's/:[^"]*"\([^"]*\)".*/: \1/' \
			-e 's/\.c/\.o/' >>makedep); done
	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
	echo '$$r makedep' >>eddep
	echo 'w' >>eddep
	cp makefile makefile.bak
	ed - makefile < eddep
	rm eddep makedep x.c
	echo '# DEPENDENCIES MUST END AT END OF FILE' >> makefile
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> makefile
	echo '# see make depend above' >> makefile

# DO NOT DELETE THIS LINE -- make depend uses it

access.o: access.c
access.o: defs.h
command.o: command.c
command.o: defs.h
expr.o: expr.c
expr.o: defs.h
format.o: format.c
format.o: defs.h
input.o: input.c
input.o: defs.h
main.o: main.c
main.o: defs.h
main.o: /usr/include/setjmp.h
message.o: message.c
message.o: defs.h
opset.o: opset.c
opset.o: defs.h
output.o: output.c
output.o: defs.h
pcs.o: pcs.c
pcs.o: defs.h
print.o: print.c
print.o: defs.h
process.o: process.c
process.o: defs.h
runpcs.o: runpcs.c
runpcs.o: defs.h
setup.o: setup.c
setup.o: defs.h
setup.o: machine.h
setup.o: /usr/include/sys/stat.h
sym.o: sym.c
sym.o: defs.h
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
