xref: /original-bsd/sys/i386/conf/Makefile.i386 (revision 93ab02a6)
1# Copyright 1990 W. Jolitz
2# @(#)Makefile.i386	7.1 05/10/91
3# Makefile for 4.3 BSD-Reno
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/i386/conf/``machineid''
9# after which you should do
10#	 config machineid
11# Generic makefile changes should be made in
12#	/sys/i386/conf/Makefile.i386
13# after which config should be rerun for all machines.
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#
21TOUCH=	touch -f -c
22LD=	/usr/bin/ld
23CC=	cc
24CPP=	cpp
25
26S=	../..
27I386=	../../i386
28
29INCLUDES= -I. -I$S -I$S/sys
30COPTS=	${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
31ASFLAGS=
32CFLAGS=	-O ${COPTS}
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 linterrs makelinks
43
44lint: /tmp param.c
45	@lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \
46	  ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \
47	    grep -v 'struct/union .* never defined' | \
48	    grep -v 'possible pointer alignment problem'
49
50symbols.sort: ${I386}/i386/symbols.raw
51	grep -v '^#' ${I386}/i386/symbols.raw \
52	    | sed 's/^	//' | sort -u > symbols.sort
53
54locore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
55	machine/pte.h vector.s ${I386}/isa/icu.s ${I386}/isa/isa.h \
56	${I386}/isa/icu.h
57	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
58		${AS} ${ASFLAGS} -o locore.o
59
60# the following is necessary because autoconf.o depends on #if GENERIC
61autoconf.o: Makefile
62
63# depend on network configuration
64af.o uipc_proto.o locore.o: Makefile
65
66# depend on maxusers
67assym.s machdep.o: Makefile
68
69# depends on KDB (cons.o also depends on GENERIC)
70trap.o cons.o: Makefile
71
72assym.s: $S/sys/param.h machine/pte.h $S/sys/buf.h \
73    $S/sys/vmmeter.h $S/sys/map.h \
74    $S/sys/proc.h $S/sys/msgbuf.h machine/vmparam.h
75
76assym.s: genassym
77	./genassym >assym.s
78
79genassym:
80	${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
81		 ${I386}/i386/genassym.c -o genassym
82
83depend: assym.s param.c
84	mkdep ${COPTS} ${CFILES} ioconf.c
85	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
86
87links:
88	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
89	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
90	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
91	  sort -u | comm -23 - dontlink | \
92	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
93	sh makelinks && rm -f dontlink
94
95tags:
96	@echo "see $S/kern/Makefile for tags"
97
98ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h $S/sys/map.h \
99    ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
100	${CC} -traditional -c ${CFLAGS} ioconf.c
101
102param.c: $S/conf/param.c
103	-rm -f param.c
104	cp $S/conf/param.c .
105
106param.o: param.c Makefile
107	${CC} -c ${CFLAGS} ${PARAM} param.c
108
109%RULES
110
111# DO NOT DELETE THIS LINE -- make depend uses it
112
113