xref: /original-bsd/sys/vax/conf/Makefile.vax (revision 68d9582f)
1#	@(#)Makefile.vax	7.20 (Berkeley) 03/30/92
2
3# Makefile for 4.4 BSD
4#
5# This makefile is constructed from a machine description:
6#	config machineid
7# Most changes should be made in the machine description
8#	/sys/vax/conf/``machineid''
9# after which you should do
10#	 config machineid
11# Machine generic makefile changes should be made in
12#	/sys/conf/Makefile.``machinetype''
13# after which config should be rerun for all machines of that type.
14#
15# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
16#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
17#
18# -DTRACE	compile in kernel tracing hooks
19# -DQUOTA	compile in file system quotas
20# -DUUDMA	compile in unibus tu58 pseudo-dma code
21#
22
23# DEBUG is set to -g by config if debugging is requested (config -g).
24# PROF is set to -pg by config if debugging is requested (config -p).
25AS=	/usr/old/bin/as ${DEBUG}
26CC=	/usr/old/bin/cc ${DEBUG}
27CPP=	/usr/old/bin/cpp
28LD=	/usr/old/bin/ld
29C2=	/usr/old/libexec/c2
30
31# source tree is located via $S relative to the compilation directory
32S=	../..
33VAX=	$S/vax
34
35INCLUDES= -I. -I$S -I$S/sys
36COPTS=	${INCLUDES} ${IDENT} -DKERNEL
37CFLAGS=	-O ${COPTS}
38AHEADS=	${VAX}/vax/pcb.m
39
40INLINECMD=	${VAX}/inline/obj/inline
41INLINE= ${INLINECMD} ${INLINEOPTS}
42
43# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
44# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
45# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
46# is marked as config-dependent.
47
48NORMAL_C=	${CC} -S ${CFLAGS} ${PROF} $<; \
49		${INLINE} < $*.s | ${AS} -o $@; rm -f $*.s
50NORMAL_C_C=	${CC} -S ${CFLAGS} ${PROF} ${PARAM} $<; \
51		${INLINE} < $*.s | ${AS} -o $@; rm -f $*.s
52
53DRIVER_C=	${CC} -S ${COPTS} ${PROF} $<; \
54		${C2} -i $*.s | ${INLINE} | ${AS} -o $@; rm -f $*.s
55DRIVER_C_C=	${CC} -S ${COPTS} ${PROF} ${PARAM} $<; \
56		${C2} -i $*.s | ${INLINE} | ${AS} -o $@; rm -f $*.s
57
58NORMAL_S=	${CPP} ${COPTS} $< | ${AS} -o $@
59NORMAL_S_C=	${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@
60
61%OBJS
62
63%CFILES
64
65# load lines for config "xxx" will be emitted as:
66# xxx: ${SYSTEM_DEP} swapxxx.o
67#	${SYSTEM_LD_HEAD}
68#	${SYSTEM_LD} swapxxx.o
69#	${SYSTEM_LD_TAIL}
70SYSTEM_OBJ=	locore.o ${OBJS} param.o ioconf.o vers.o
71#SYSTEM_DEP=	Makefile symbols.sort ${SYSTEM_OBJ}
72SYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
73SYSTEM_LD_HEAD=	rm -f $@
74SYSTEM_LD=	@echo loading vmunix;\
75		${LD} -x -n -o $@ -e start -T 80000000 ${SYSTEM_OBJ}
76SYSTEM_LD_TAIL=
77#SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@
78
79%LOAD
80
81newvers vers.c:
82	sh $S/conf/newvers.sh
83
84clean:
85	rm -f eddep *vmunix tags *.o locore.i locore.c [a-tv-z]*.s \
86		Errs errs linterrs makelinks genassym
87
88lint: /tmp param.c
89	@lint -hbxn -DGENERIC ${COPTS} ${PARAM} \
90	  ${VAX}/vax/Locore.c ${CFILES} ioconf.c param.c | \
91	    grep -v 'struct/union .* never defined' | \
92	    grep -v 'possible pointer alignment problem'
93
94symbols.sort: ${VAX}/vax/symbols.raw
95	grep -v '^#' ${VAX}/vax/symbols.raw \
96	    | sed 's/^	//' | sort -u > symbols.sort
97
98${INLINECMD}:
99	cd ${VAX}/inline; make
100
101locore.o: assym.s ${AHEADS} ${VAX}/vax/rpb.s ${VAX}/vax/scb.s ubvec.s
102locore.o: ${VAX}/vax/locore.s ubglue.s ${VAX}/include/mtpr.h
103locore.o: ${VAX}/include/trap.h ${VAX}/include/psl.h ${VAX}/include/pte.h
104locore.o: ${VAX}/include/cpu.h mba.h
105locore.o:
106	cat assym.s ${VAX}/vax/rpb.s ${VAX}/vax/scb.s ubvec.s \
107	    ${VAX}/vax/locore.s ubglue.s > locore.c
108	${CC} -E -DLOCORE ${COPTS} locore.c > locore.i
109	@echo 'as -o locore.o $${AHEADS} locore.i'
110	@${AS} -o locore.o ${AHEADS} locore.i
111	@rm locore.i
112
113# the following is necessary because autoconf.o depends on #if GENERIC
114autoconf.o tu.o: Makefile
115
116# the following are necessary because the files depend on the types of
117# vax cpu's included in the system configuration
118emulate.o clock.o machdep.o autoconf.o conf.o cons.o cpudata.o : Makefile
119crl.o flp.o mba.o uba.o vaxcpu.o : Makefile
120
121# depend on network configuration
122af.o uipc_proto.o uipc_domain.o locore.o: Makefile
123
124# depends on kdb being configured
125trap.o:	Makefile
126
127assym.s: genassym
128	./genassym >assym.s
129
130# depend on maxusers
131genassym: ${VAX}/vax/genassym.c Makefile
132	${CC} ${INCLUDES} ${IDENT} ${PARAM} -o genassym ${VAX}/vax/genassym.c
133
134depend: assym.s ${CFILES}
135	mkdep ${COPTS} ${.ALLSRC:M*.c} ioconf.c
136	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${VAX}/vax/genassym.c
137
138links:
139	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
140	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
141	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
142	  sort -u | comm -23 - dontlink | \
143	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
144	echo 'rm -f udiv.o;ln -s ../GENERIC/udiv.o udiv.o' >> makelinks
145	echo 'rm -f urem.o;ln -s ../GENERIC/urem.o urem.o' >> makelinks
146	sh makelinks && rm -f dontlink
147
148tags:
149	@echo "see $S/kern/Makefile for tags"
150
151param.c: $S/conf/param.c
152	rm -f param.c
153	cp $S/conf/param.c .
154
155ioconf.o param.o vers.o:
156	${NORMAL_C_C}
157
158%RULES
159