corrected pointer to sound.doc
[unix-history] / sys / i386 / conf / Makefile.i386
CommitLineData
15637ed4 1# Copyright 1990 W. Jolitz
082cf5d8 2# from: @(#)Makefile.i386 7.1 5/10/91
1c7454b0 3# $Id: Makefile.i386,v 1.23 1994/03/21 20:48:47 ats Exp $
082cf5d8
RG
4#
5# Makefile for FreeBSD
15637ed4
RG
6#
7# This makefile is constructed from a machine description:
8# config machineid
9# Most changes should be made in the machine description
10# /sys/i386/conf/``machineid''
11# after which you should do
12# config machineid
13# Generic makefile changes should be made in
14# /sys/i386/conf/Makefile.i386
15# after which config should be rerun for all machines.
16#
17# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE INVISIBLE TO MAKEFILE
18# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
19#
20# -DTRACE compile in kernel tracing hooks
21# -DQUOTA compile in file system quotas
22#
15637ed4
RG
23TOUCH= touch -f -c
24LD= /usr/bin/ld
25CC= cc
26CPP= cpp
082cf5d8
RG
27STRIP= strip
28DBSYM= /usr/sbin/dbsym
15637ed4
RG
29
30S= ../..
31I386= ../../i386
32
4c45483e
GW
33CWARNFLAGS=-W -Wreturn-type -Wcomment
34#
35# The following flags are next up for working on:
fde1aeb2 36# -Wredundant-decls -Wnested-externs
4c45483e
GW
37#
38# When working on removing warnings from code, the `-Werror' flag should be
39# of material assistance.
40#
0d327739 41COPTFLAGS=-O
779aaf29 42COPTFLAGS+=-D__FreeBSD__
15637ed4
RG
43INCLUDES= -I. -I$S -I$S/sys
44COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX
45ASFLAGS=
0d327739 46CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
1d7f5b47 47LOAD_ADDRESS?= F0100000
15637ed4
RG
48
49NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
50NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
51NORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o
52DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $<
53DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
3fc0a319
DG
54SYSTEM_OBJS=locore.o exception.o swtch.o support.o ${OBJS} param.o \
55 ioconf.o conf.o machdep.o
15637ed4
RG
56SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
57SYSTEM_LD_HEAD= @echo loading $@; rm -f $@
691da472 58SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o
15637ed4 59SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \
082cf5d8 60 ${DBSYM} -fT ${LOAD_ADDRESS} $@; ${STRIP} -x $@; size $@; chmod 755 $@
15637ed4 61
082cf5d8
RG
62# (XXX) ok, this is weird. but we've got a working ed, and a broken ex, and
63# the script is identical for either... -- cgd
64#
15637ed4
RG
65GPROF.EX= /usr/src/lib/csu.i386/gprof.ex
66PROFILE_C= ${CC} -S -c ${CFLAGS} $< ; \
082cf5d8 67 ed - $*.s < ${GPROF.EX} ; \
15637ed4
RG
68 ${AS} -o $@ $*.s ; \
69 rm -f $*.s
70
71%OBJS
72
73%CFILES
74
75%LOAD
76
77clean:
78 rm -f eddep *386bsd tags *.o locore.i [a-uw-z]*.s \
cdd10b9f 79 errs linterrs makelinks genassym ,assym.s stamp-assym
15637ed4 80
cdd10b9f
GW
81#lint: /tmp param.c
82# @lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \
83# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \
84# grep -v 'struct/union .* never defined' | \
85# grep -v 'possible pointer alignment problem'
15637ed4
RG
86
87symbols.sort: ${I386}/i386/symbols.raw
88 grep -v '^#' ${I386}/i386/symbols.raw \
89 | sed 's/^ //' | sort -u > symbols.sort
90
91locore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
92 machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \
1c7454b0 93 $S/sys/errno.h machine/specialreg.h \
3fc0a319
DG
94 ${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h \
95 machine/asmacros.h
15637ed4
RG
96 ${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
97 ${AS} ${ASFLAGS} -o locore.o
98
3fc0a319
DG
99exception.o: assym.s ${I386}/i386/exception.s machine/trap.h \
100 ${I386}/isa/vector.s ${I386}/isa/icu.s \
101 $S/sys/errno.h ${I386}/isa/icu.h ${I386}/isa/isa.h vector.h \
102 $S/net/netisr.h machine/asmacros.h
103 ${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/exception.s | \
104 ${AS} ${ASFLAGS} -o exception.o
105
106swtch.o: assym.s ${I386}/i386/swtch.s \
1c7454b0 107 $S/sys/errno.h machine/asmacros.h
3fc0a319
DG
108 ${CPP} -I. ${COPTS} ${I386}/i386/swtch.s | \
109 ${AS} ${ASFLAGS} -o swtch.o
110
111support.o: assym.s ${I386}/i386/support.s \
112 $S/sys/errno.h machine/asmacros.h
113 ${CPP} -I. ${COPTS} ${I386}/i386/support.s | \
114 ${AS} ${ASFLAGS} -o support.o
115
082cf5d8
RG
116machdep.o: ${I386}/i386/machdep.c Makefile
117 ${CC} -c ${CFLAGS} -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${PROF} $<
118
15637ed4
RG
119# the following is necessary because autoconf.o depends on #if GENERIC
120autoconf.o: Makefile
121
122# depend on network configuration
123af.o uipc_proto.o locore.o: Makefile
124
15637ed4
RG
125# depends on KDB (cons.o also depends on GENERIC)
126trap.o cons.o: Makefile
127
081b00bb 128assym.s: genassym
cdd10b9f
GW
129 ./genassym >,assym.s
130 if cmp -s assym.s ,assym.s; then \
131 rm -f ,assym.s; \
132 else \
133 rm -f assym.s; \
134 mv ,assym.s assym.s; \
135 fi
136
137# Some of the defines that genassym outputs may well depend on the
138# value of kernel options.
139genassym: Makefile
15637ed4 140 ${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \
c779bb1a 141 ${I386}/i386/genassym.c -static -o genassym
15637ed4
RG
142
143depend: assym.s param.c
082cf5d8 144 sh /usr/bin/mkdep -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c
15637ed4
RG
145 sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c
146
147links:
148 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
149 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
150 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
151 sort -u | comm -23 - dontlink | \
152 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
153 sh makelinks && rm -f dontlink
154
155tags:
156 @echo "see $S/kern/Makefile for tags"
157
158ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \
159 ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h
160 ${CC} -c ${CFLAGS} ioconf.c
161
4c45483e
GW
162conf.o: ${I386}/i386/conf.c $S/sys/conf.h
163 ${CC} -c ${CFLAGS} ${I386}/i386/conf.c
15637ed4 164
082cf5d8 165param.c: $S/conf/param.c
15637ed4
RG
166 -rm -f param.c
167 cp $S/conf/param.c .
168
169param.o: param.c Makefile
170 ${CC} -c ${CFLAGS} ${PARAM} param.c
171
082cf5d8 172vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
15637ed4
RG
173 sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
174 ${CC} ${CFLAGS} -c vers.c
175
176%RULES
177
178# DO NOT DELETE THIS LINE -- make depend uses it
179