xref: /original-bsd/sys/i386/conf/Makefile.i386 (revision 58db4230)
1# Copyright 1990 W. Jolitz
2# @(#)Makefile.i386	1.1 01/15/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/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 -Dconst=__const__ -Dvolatile=__volatile__ \
24		-Dsigned=__signed__ -Dinline=__inline__ \
25		-Uunix -fpcc-struct-return
26
27S=	../..
28I386=	../../i386
29
30INCLUDES= -I. -I$S -I$S/sys
31COPTS=	${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX -DREFBIT
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 machine/pte.h \
55	vector.s ${I386}/isa/icu.s ${I386}/isa/isa.h ${I386}/isa/icu.h
56	cat assym.s ${I386}/i386/locore.s vector.s ${I386}/isa/icu.s > locore.c
57	${CC} -E -I. -DLOCORE ${COPTS} locore.c > locore.i
58	@echo 'as -o locore.o locore.i'
59	@${AS} -o locore.o locore.i
60	@rm locore.i locore.c
61
62# the following is necessary because autoconf.o depends on #if GENERIC
63autoconf.o: Makefile
64
65# depend on network configuration
66af.o uipc_proto.o locore.o: Makefile
67
68# depend on maxusers
69assym.s machdep.o: Makefile
70
71# depends on KDB (cons.o also depends on GENERIC)
72trap.o cons.o: Makefile
73
74assym.s: $S/sys/param.h machine/pte.h $S/sys/buf.h $S/sys/vmparam.h \
75    $S/sys/vmmeter.h $S/sys/cmap.h $S/sys/map.h \
76    $S/sys/proc.h $S/sys/msgbuf.h machine/vmparam.h
77
78assym.s: genassym
79	./genassym >assym.s
80
81genassym:
82	${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
83		 ${I386}/i386/genassym.c -o genassym
84
85depend: assym.s param.c
86	mkdep ${COPTS} ${CFILES} ioconf.c
87	mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
88
89links:
90	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
91	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
92	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
93	  sort -u | comm -23 - dontlink | \
94	  sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
95	sh makelinks && rm -f dontlink
96
97tags:
98	@echo "see $S/kern/Makefile for tags"
99
100ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h $S/sys/map.h \
101    $S/sys/vm.h ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
102
103param.c: $S/conf/param.c
104	-rm -f param.c
105	cp $S/conf/param.c .
106
107param.o: param.c Makefile
108	${CC} -c ${CFLAGS} ${PARAM} param.c
109
110%RULES
111
112# DO NOT DELETE THIS LINE -- make depend uses it
113
114