start of autoconfig
[unix-history] / usr / src / sys / tahoe / conf / Makefile.tahoe
CommitLineData
336ca318 1# @(#)Makefile.tahoe 1.3 (Berkeley) %G%
58eaa410 2#
4a6cc6f7 3# Makefile for 4.3 BSD
58eaa410
SL
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
4a6cc6f7 12# /sys/conf/Makefile
58eaa410
SL
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# -DSWABIPS compile in code to byte swap ip packets on 3Mb/s Ethernet
21#
4a6cc6f7
SL
22C2= /lib/c2
23LD= /bin/ld
24TOUCH= touch -f -c
25INDIR= ../tahoe/inline
26INLINE= ${INDIR}/inline
27
28INCLUDES= -I. -I../h
29COPTS= ${INCLUDES} ${IDENT} -DKERNEL
58eaa410
SL
30CFLAGS= -O ${COPTS}
31
32%OBJS
33
34%CFILES
35
36%LOAD
37
38clean:
39 rm -f eddep *vmunix tags *.o locore.i [a-tv-z]*.s \
40 errs linterrs makelinks
41
42lint: /tmp
4a6cc6f7
SL
43 @lint -hbxn -I. -DGENERIC ${COPTS} ${PARAM} ../tahoe/Locore.c \
44 ${CFILES} ../tahoe/swapgeneric.c ioconf.c param.c | \
58eaa410
SL
45 grep -v 'struct/union .* never defined' | \
46 grep -v 'possible pointer alignment problem'
47
4a6cc6f7
SL
48../tahoe/symbols.sort: ../tahoe/symbols.raw
49 grep -v '^#' ../tahoe/symbols.raw \
50 | sed 's/^ //' | sort -u > ../tahoe/symbols.sort
58eaa410 51
4a6cc6f7
SL
52${INLINE}: ${INDIR}/inline.h ${INDIR}/langpats.c
53${INLINE}: ${INDIR}/libcpats.c ${INDIR}/machdep.c
54${INLINE}: ${INDIR}/machpats.c ${INDIR}/main.c
55 cd ${INDIR}; make
56
57locore.o: assym.s ../tahoe/scb.s ../tahoe/locore.s \
58 vbglue.s ../tahoe/mtpr.h ../tahoe/trap.h ../tahoe/psl.h \
59 ../tahoe/pte.h ../tahoe/cp.h ../tahoe/mem.h
60 cat assym.s ../tahoe/scb.s ../tahoe/locore.s \
61 vbglue.s > locore.c
58eaa410
SL
62 ${CC} -E -I. -DLOCORE ${COPTS} locore.c > locore.i
63 @echo 'as -o locore.o locore.i'
64 @${AS} -o locore.o locore.i
65 @rm locore.i
66
67# the following is necessary because autoconf.o depends on #if GENERIC
4a6cc6f7 68autoconf.o: Makefile
58eaa410
SL
69
70# depend on network configuration
4a6cc6f7 71af.o : Makefile
58eaa410 72# depend on maxusers
4a6cc6f7 73assym.s machdep.o: Makefile
58eaa410 74
4a6cc6f7
SL
75assym.s: ../h/param.h ../tahoe/pte.h ../h/buf.h ../h/vmparam.h \
76 ../h/vmmeter.h ../h/dir.h ../h/cmap.h ../h/map.h ../tahoevba/vbavar.h \
336ca318 77 ../h/proc.h ../h/msgbuf.h ../tahoe/scb.h
4a6cc6f7 78 ${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} ../tahoe/genassym.c; ./a.out >assym.s; rm -f a.out
58eaa410 79
4a6cc6f7 80../h/param.h: ../tahoe/machparam.h ../h/signal.h ../h/types.h
58eaa410
SL
81 ${TOUCH} ../h/param.h
82../h/tty.h: ../h/ttychars.h ../h/ttydev.h
83 ${TOUCH} ../h/tty.h
84../h/ioctl.h: /usr/include/sgtty.h ../h/ttychars.h ../h/ttydev.h
85 ${TOUCH} ../h/ioctl.h
4a6cc6f7 86../h/user.h: ../tahoe/pcb.h ../h/dmap.h ../h/time.h ../h/resource.h \
58eaa410
SL
87 /usr/include/errno.h
88 ${TOUCH} ../h/user.h
89../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h
90 ${TOUCH} ../h/vm.h
4a6cc6f7 91../h/vmparam.h: ../tahoe/vmparam.h
58eaa410
SL
92 ${TOUCH} ../h/vmparam.h
93
4a6cc6f7
SL
94depend:
95 -if [ ! -f assym.s ]; then touch assym.s; fi
96 ${CC} -M ${COPTS} ${CFILES} | \
97 sed -e ':loop' \
98 -e 's/\.\.\/[^ /]*\/\.\./../' \
99 -e 't loop' | \
58eaa410
SL
100 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
101 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
102 else rec = rec " " $$2 } } \
103 END { print rec } ' > makedep
58eaa410
SL
104 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
105 echo '$$r makedep' >>eddep
106 echo 'w' >>eddep
4a6cc6f7
SL
107 cp Makefile Makefile.bak
108 ex - Makefile < eddep
58eaa410
SL
109 rm eddep makedep
110
58eaa410
SL
111links:
112 egrep '#if' ${CFILES} | sed -f ../conf/defines | \
113 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
114 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
115 sort -u | comm -23 - dontlink | \
116 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
117 echo 'rm -f udiv.o;ln -s ../GENERIC/udiv.o udiv.o' >> makelinks
118 echo 'rm -f urem.o;ln -s ../GENERIC/urem.o urem.o' >> makelinks
119 sh makelinks && rm -f dontlink
120
121tags:
122 /usr/ucb/ctags ${CFILES}
123
124print:
4a6cc6f7 125 @pr -f Makefile ../sys/TODO linterrs
58eaa410
SL
126 @/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF
127 @(size vmunix *.o) | pr -f -h sizes
128 @ls -ls | pr -f
129 @cd ../h; ls -ls | pr -f ; pr -f *.m *.h
130 @echo 'once upon a time ...'
4a6cc6f7
SL
131 @cd ../tahoe; pr -f Locore.c scb.s locore.s
132 @cd ${INDIR}; make print
58eaa410
SL
133 @pr -f ${CFILES}
134
4a6cc6f7
SL
135ioconf.o: ioconf.c ../h/param.h ../tahoe/pte.h ../h/buf.h ../h/map.h \
136 ../h/vm.h ../tahoevba/vbavar.h
58eaa410
SL
137
138param.c: ../conf/param.c
139 rm -f param.c
140 cp ../conf/param.c .
141
4a6cc6f7 142param.o: param.c Makefile
58eaa410
SL
143 ${CC} -I. -c ${CFLAGS} ${PARAM} param.c
144
145%RULES
146
147# DO NOT DELETE THIS LINE -- make depend uses it
148