xref: /original-bsd/sys/vax/conf/Makefile.vax (revision 23a40993)
1#	Makefile.vax	4.9	06/30/83
2#
3# Makefile for 4.2 bsd
4#
5# This makefile is constructed from a machine description:
6#	config machine
7# Most changes should be made in the machine description
8#	/sys/conf/``machineid''
9# after which you should do
10#	 config machineid
11# Generic makefile changes should be made in
12#	/sys/conf/makefile
13# after which config should be rerun for all machines.
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#
21C2=	/lib/c2
22LD=	/bin/ld
23TOUCH=	touch -f -c
24
25COPTS=	${IDENT} -DKERNEL
26CFLAGS=	-O ${COPTS}
27
28AHEADS=	../vax/pcb.m
29
30%OBJS
31
32%CFILES
33
34%LOAD
35
36clean:
37	rm -f eddep *vmunix tags *.o locore.i [a-tv-z]*.s \
38		errs linterrs makelinks
39
40lint: /tmp
41	@lint -hbxn -I. -DGENERIC ${COPTS} ../vax/Locore.c \
42	  ${CFILES} ../vax/swapgeneric.c ioconf.c | \
43	    grep -v 'struct/union .* never defined' | \
44	    grep -v 'possible pointer alignment problem'
45
46../vax/symbols.sort: ../vax/symbols.raw
47	grep -v '^#' ../vax/symbols.raw \
48	    | sed 's/^	//' | sort -u > ../vax/symbols.sort
49
50locore.o: assym.s ${AHEADS} ../vax/scb.s ../vax/locore.s ubglue.s \
51    ../vax/mtpr.h ../vax/trap.h ../machine/psl.h ../machine/pte.h \
52    ../vax/cpu.h mba.h
53	cat assym.s ../vax/scb.s ../vax/locore.s ubglue.s > locore.c
54	cc -E -I. -DLOCORE ${COPTS} locore.c > locore.i
55	@echo 'as -o locore.o $${AHEADS} locore.i'
56	@as -o locore.o ${AHEADS} locore.i
57	@rm locore.i
58
59# the following is necessary because autoconf.o depends on #if GENERIC
60autoconf.o tu.o: makefile
61
62# the following are necessary because the files depend on the types of
63# vax cpu's included in the system configuration
64clock.o machdep.o autoconf.o conf.o cons.o flp.o mba.o uba.o vaxcpu.o : makefile
65# depend on network configuration
66af.o : makefile
67
68assym.s: ../h/param.h ../machine/pte.h ../h/buf.h ../h/vmparam.h \
69    ../h/vmmeter.h ../h/dir.h ../h/cmap.h ../h/map.h ../vaxuba/ubavar.h \
70    ../h/proc.h ../h/msgbuf.h
71	cc ${IDENT} ${PARAM} ../vax/genassym.c; ./a.out >assym.s; rm -f a.out
72
73../h/param.h: /usr/include/signal.h
74	${TOUCH} ../h/param.h
75../h/tty.h:  ../h/ttychars.h ../h/ttydev.h
76	${TOUCH} ../h/tty.h
77../h/ioctl.h: /usr/include/sgtty.h ../h/ttychars.h ../h/ttydev.h
78	${TOUCH} ../h/ioctl.h
79../h/user.h: ../vax/pcb.h ../h/dmap.h ../h/types.h \
80    /usr/include/errno.h
81	${TOUCH} ../h/user.h
82../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h
83	${TOUCH} ../h/vm.h
84
85depend:
86	grep '^#include' ${CFILES} | grep -v '<' | \
87	sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
88	    -e 's/\.c/.o/' \
89	    -e 's,../[a-zA-Z]*/,,' | \
90	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
91		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
92		       else rec = rec " " $$2 } } \
93	      END { print rec } ' > makedep
94	echo '$$r makedep' >>eddep
95	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
96	echo '$$r makedep' >>eddep
97	echo 'w' >>eddep
98	cp makefile makefile.bak
99	ed - makefile < eddep
100	rm eddep makedep
101
102
103links:
104	egrep '#if' ${CFILES} | sed -f ../conf/defines | \
105	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
106	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
107	  sort -u | comm -23 - dontlink | \
108	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
109	echo 'rm -f udiv.o;ln -s ../GENERIC/udiv.o udiv.o' >> makelinks
110	echo 'rm -f urem.o;ln -s ../GENERIC/urem.o urem.o' >> makelinks
111	sh makelinks && rm -f dontlink
112
113tags:
114	/usr/ucb/ctags ${CFILES}
115
116print:
117	@pr -f makefile ../sys/TODO linterrs
118	@/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF
119	@(size vmunix *.o) | pr -f -h sizes
120	@ls -ls | pr -f
121	@cd ../h; ls -ls | pr -f ; pr -f *.m *.h
122	@echo 'once upon a time ...'
123	@cd ../sys; pr -f asm.sed Locore.c scb.s locore.s
124	@pr -f ${CFILES}
125
126ioconf.o: ioconf.c ../h/param.h ../machine/pte.h ../h/buf.h ../h/map.h \
127    ../vaxmba/mbavar.h ../h/vm.h ../vaxuba/ubavar.h
128	${CC} -I. -c -S ${COPTS} ioconf.c
129	${C2} ioconf.s | sed -f ../vax/asm.sed | ${AS} -o ioconf.o
130	rm -f ioconf.s
131
132param.c: ../conf/param.c
133	cp ../conf/param.c .
134
135param.o: param.c makefile
136	${CC} -I. -c ${CFLAGS} ${PARAM} param.c
137
138%RULES
139
140# DO NOT DELETE THIS LINE -- make depend uses it
141
142