386BSD 0.0 release
[unix-history] / usr / src / sys.386bsd / i386 / conf / Makefile.i386
CommitLineData
f1d29f8c
WJ
1# Copyright 1990 W. Jolitz
2# @(#)Makefile.i386 7.1 5/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
34NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
35NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
36DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $<
37DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
38SYSTEM_OBJS=locore.o ${OBJS} param.o ioconf.o conf.o
39SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
40SYSTEM_LD_HEAD= @echo loading $@; rm -f $@
41SYSTEM_LD= @${LD} -z -T FE000000 -o $@ -X ${SYSTEM_OBJS}
42SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; size $@; chmod 755 $@
43
44%OBJS
45
46%CFILES
47
48%LOAD
49
50clean:
51 rm -f eddep *386bsd tags *.o locore.i [a-uw-z]*.s \
52 errs linterrs makelinks
53
54lint: /tmp param.c
55 @lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \
56 ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \
57 grep -v 'struct/union .* never defined' | \
58 grep -v 'possible pointer alignment problem'
59
60symbols.sort: ${I386}/i386/symbols.raw
61 grep -v '^#' ${I386}/i386/symbols.raw \
62 | sed 's/^ //' | sort -u > symbols.sort
63
64locore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
65 machine/pte.h vector.s ${I386}/isa/icu.s ${I386}/isa/isa.h \
66 ${I386}/isa/icu.h
67 ${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
68 ${AS} ${ASFLAGS} -o locore.o
69
70# the following is necessary because autoconf.o depends on #if GENERIC
71autoconf.o: Makefile
72
73# depend on network configuration
74af.o uipc_proto.o locore.o: Makefile
75
76# depend on maxusers
77assym.s machdep.o: Makefile
78
79# depends on KDB (cons.o also depends on GENERIC)
80trap.o cons.o: Makefile
81
82assym.s: $S/sys/param.h machine/pte.h $S/sys/buf.h \
83 $S/sys/vmmeter.h \
84 $S/sys/proc.h $S/sys/msgbuf.h machine/vmparam.h
85
86assym.s: genassym
87 ./genassym >assym.s
88
89genassym:
90 ${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
91 ${I386}/i386/genassym.c -o genassym
92
93depend: assym.s param.c
94 sh /usr/bin/mkdep ${COPTS} ${CFILES} ioconf.c
95 sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
96
97links:
98 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
99 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
100 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
101 sort -u | comm -23 - dontlink | \
102 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
103 sh makelinks && rm -f dontlink
104
105tags:
106 @echo "see $S/kern/Makefile for tags"
107
108ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
109 ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
110 ${CC} -c ${CFLAGS} ioconf.c
111
112conf.o: $S/sys/param.h $S/sys/systm.h $S/sys/buf.h $S/sys/ioctl.h \
113 $S/sys/tty.h $S/sys/conf.h ${I386}/i386/conf.c
114 ${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c
115
116param.c: $S/conf/param.c
117 -rm -f param.c
118 cp $S/conf/param.c .
119
120param.o: param.c Makefile
121 ${CC} -c ${CFLAGS} ${PARAM} param.c
122
123%RULES
124
125# DO NOT DELETE THIS LINE -- make depend uses it
126