4.3BSD-Reno/src/sys/conf/Makefile.vax

#
# Copyright (c) 1980, 1986 Regents of the University of California.
# All rights reserved.  The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
#
#	@(#)Makefile.vax	7.16 (Berkeley) 6/24/90
#
# Makefile for 4.3 BSD
#
# This makefile is constructed from a machine description:
#	config machineid
# Most changes should be made in the machine description
#	/sys/conf/``machineid''
# after which you should do
#	 config machineid
# Generic makefile changes should be made in
#	/sys/conf/Makefile.``machinetype''
# after which config should be rerun for all machines.
#
# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
#
# -DTRACE	compile in kernel tracing hooks
# -DQUOTA	compile in file system quotas
# -DUUDMA	compile in unibus tu58 pseudo-dma code
#
C2=	/usr/libexec/c2
LD=	/usr/bin/ld
INLINECMD= ../vax/inline/inline
INLINE=	${INLINECMD} ${INLINEOPTS}
TOUCH=	touch -f -c

INCLUDES= -I. -I../sys
COPTS=	${INCLUDES} ${IDENT} -DKERNEL
CFLAGS=	-O ${COPTS}

AHEADS=	../vax/pcb.m

%OBJS

%CFILES

%LOAD

clean:
	rm -f eddep *vmunix tags *.o locore.i [a-tv-z]*.s \
		errs linterrs makelinks

lint: /tmp param.c
	@lint -hbxn -DGENERIC ${COPTS} ${PARAM} \
	  ../vax/Locore.c ${CFILES} ioconf.c param.c | \
	    grep -v 'struct/union .* never defined' | \
	    grep -v 'possible pointer alignment problem'

../vax/symbols.sort: ../vax/symbols.raw
	grep -v '^#' ../vax/symbols.raw \
	    | sed 's/^	//' | sort -u > ../vax/symbols.sort

../vax/inline/inline: ../vax/inline/inline.h ../vax/inline/langpats.c
../vax/inline/inline: ../vax/inline/libcpats.c ../vax/inline/machdep.c
../vax/inline/inline: ../vax/inline/machpats.c ../vax/inline/main.c
	cd ../vax/inline; make

locore.o: assym.s ${AHEADS} ../vax/rpb.s ../vax/scb.s ubvec.s \
    ../vax/locore.s ubglue.s ../vax/mtpr.h ../vax/trap.h machine/psl.h \
    machine/pte.h ../vax/cpu.h mba.h
	cat assym.s ../vax/rpb.s ../vax/scb.s ubvec.s ../vax/locore.s \
	    ubglue.s > locore.c
	cc -E -DLOCORE -I../vax ${COPTS} locore.c > locore.i
	@echo 'as -o locore.o $${AHEADS} locore.i'
	@as -o locore.o ${AHEADS} locore.i
	@rm locore.i

emulate.o: ../vax/emulate.s
	cpp -I. ${COPTS} ../vax/emulate.s | ${AS} -o emulate.o

# the following is necessary because autoconf.o depends on #if GENERIC
autoconf.o tu.o: Makefile

# the following are necessary because the files depend on the types of
# vax cpu's included in the system configuration
clock.o machdep.o autoconf.o conf.o cons.o cpudata.o : Makefile
crl.o flp.o mba.o uba.o vaxcpu.o : Makefile

# depend on network configuration
af.o uipc_proto.o uipc_domain.o locore.o: Makefile

# depends on kdb being configured
trap.o:	Makefile

# depend on maxusers
assym.s: Makefile

assym.s: genassym
	./genassym >assym.s

genassym:
	cc ${INCLUDES} ${IDENT} ${PARAM} -o genassym ../vax/genassym.c

depend: assym.s
	mkdep ${COPTS} ${CFILES} ioconf.c
	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ../vax/genassym.c

links:
	egrep '#if' ${CFILES} | sed -f ../conf/defines | \
	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
	  sort -u | comm -23 - dontlink | \
	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
	echo 'rm -f udiv.o;ln -s ../GENERIC/udiv.o udiv.o' >> makelinks
	echo 'rm -f urem.o;ln -s ../GENERIC/urem.o urem.o' >> makelinks
	sh makelinks && rm -f dontlink

tags:
	@echo "see ../kern/Makefile for tags"

print:
	@pr -f Makefile ../kern/TODO linterrs
	@/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF
	@(size vmunix *.o) | pr -f -h sizes
	@ls -ls | pr -f
	@cd ../kern; ls -ls | pr -f ; pr -f *.m *.h
	@echo 'once upon a time ...'
	@cd ../vax; pr -f Locore.c scb.s locore.s
	@cd ../vax/inline; make print
	@pr -f ${CFILES}

ioconf.o: ioconf.c ../sys/param.h machine/pte.h ../sys/buf.h ../sys/map.h \
    ../vaxmba/mbavar.h ../sys/vm.h ../vaxuba/ubavar.h
	${CC} -c -S ${COPTS} ioconf.c
	${C2} ioconf.s | ../vax/inline/inline | ${AS} -o ioconf.o
	rm -f ioconf.s

param.c: ../conf/param.c
	-rm -f param.c
	cp ../conf/param.c .

param.o: param.c Makefile
	${CC} -c ${CFLAGS} ${PARAM} param.c

%RULES

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