xref: /original-bsd/sys/tahoe/conf/Makefile.tahoe (revision 6d57652c)
1#	@(#)Makefile.tahoe	1.22 (Berkeley) 12/11/90
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/tahoe/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 INVISIBLE 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=	/usr/libexec/c2
22LD=	/usr/bin/ld
23
24S=	../..
25TAHOE=	../../tahoe
26
27INCLUDES= -I. -I$S -I$S/sys
28COPTS=	${INCLUDES} ${IDENT} -DKERNEL
29CFLAGS=	-O ${COPTS}
30
31INLINECMD=	${TAHOE}/inline/obj/inline
32INLINE=	${INLINECMD} ${INLINEOPTS}
33
34%OBJS
35
36%CFILES
37
38%LOAD
39
40clean:
41	rm -f eddep *vmunix tags *.o locore.i [a-uw-z]*.s \
42		Errs errs linterrs makelinks
43
44lint: /tmp param.c
45	@lint -hbxn -I. -DGENERIC ${COPTS} ${PARAM} \
46	  ${TAHOE}/tahoe/Locore.c ${CFILES} ioconf.c param.c | \
47	    grep -v 'struct/union .* never defined' | \
48	    grep -v 'possible pointer alignment problem'
49
50symbols.sort: ${TAHOE}/tahoe/symbols.raw
51	grep -v '^#' ${TAHOE}/tahoe/symbols.raw \
52	    | sed 's/^	//' | sort -u > symbols.sort
53
54${INLINECMD}:
55	cd ${TAHOE}/inline; make
56
57locore.o: assym.s ${TAHOE}/tahoe/scb.s vbvec.s ${TAHOE}/tahoe/locore.s
58locore.o: vbglue.s ${TAHOE}/include/mtpr.h ${TAHOE}/include/trap.h
59locore.o: ${TAHOE}/include/psl.h ${TAHOE}/include/pte.h ${TAHOE}/tahoe/cp.h
60locore.o: ${TAHOE}/tahoe/mem.h
61locore.o:
62	cat assym.s ${TAHOE}/tahoe/scb.s vbvec.s ${TAHOE}/tahoe/locore.s \
63	    vbglue.s > locore.c
64	${CC} -E -DLOCORE ${COPTS} locore.c > locore.i
65	@echo 'as -o locore.o locore.i'
66	@${AS} -o locore.o locore.i
67	@rm locore.i
68
69# the following is necessary because autoconf.o depends on #if GENERIC
70autoconf.o: Makefile
71
72# depend on network configuration
73af.o uipc_proto.o locore.o: Makefile
74
75# depend on maxusers
76assym.s machdep.o: Makefile
77
78# depends on KDB (cons.o also depends on GENERIC)
79trap.o cons.o: Makefile
80
81assym.s: genassym
82	./genassym >assym.s
83
84genassym:
85	${CC} ${INCLUDES} ${IDENT} ${PARAM} -o genassym \
86	    ${TAHOE}/tahoe/genassym.c
87
88depend: assym.s
89	mkdep ${COPTS} ${CFILES} ioconf.c
90	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${TAHOE}/tahoe/genassym.c
91
92links:
93	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
94	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
95	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
96	  sort -u | comm -23 - dontlink | \
97	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
98	echo 'rm -f udiv.o;ln -s ../GENERIC/udiv.o udiv.o' >> makelinks
99	echo 'rm -f urem.o;ln -s ../GENERIC/urem.o urem.o' >> makelinks
100	sh makelinks && rm -f dontlink
101
102tags:
103	@echo "see $S/kern/Makefile for tags"
104
105param.c: $S/conf/param.c
106	rm -f param.c
107	cp $S/conf/param.c .
108
109param.o: param.c Makefile
110	${CC} -c ${CFLAGS} ${PARAM} param.c
111
112%RULES
113