Commit | Line | Data |
---|---|---|
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 |
23 | TOUCH= touch -f -c |
24 | LD= /usr/bin/ld | |
25 | CC= cc | |
26 | CPP= cpp | |
082cf5d8 RG |
27 | STRIP= strip |
28 | DBSYM= /usr/sbin/dbsym | |
15637ed4 RG |
29 | |
30 | S= ../.. | |
31 | I386= ../../i386 | |
32 | ||
4c45483e GW |
33 | CWARNFLAGS=-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 | 41 | COPTFLAGS=-O |
779aaf29 | 42 | COPTFLAGS+=-D__FreeBSD__ |
15637ed4 RG |
43 | INCLUDES= -I. -I$S -I$S/sys |
44 | COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX | |
45 | ASFLAGS= | |
0d327739 | 46 | CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} |
1d7f5b47 | 47 | LOAD_ADDRESS?= F0100000 |
15637ed4 RG |
48 | |
49 | NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< | |
50 | NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< | |
51 | NORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o | |
52 | DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< | |
53 | DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< | |
3fc0a319 DG |
54 | SYSTEM_OBJS=locore.o exception.o swtch.o support.o ${OBJS} param.o \ |
55 | ioconf.o conf.o machdep.o | |
15637ed4 RG |
56 | SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS} |
57 | SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ | |
691da472 | 58 | SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o |
15637ed4 | 59 | SYSTEM_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 |
65 | GPROF.EX= /usr/src/lib/csu.i386/gprof.ex |
66 | PROFILE_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 | ||
77 | clean: | |
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 | |
87 | symbols.sort: ${I386}/i386/symbols.raw | |
88 | grep -v '^#' ${I386}/i386/symbols.raw \ | |
89 | | sed 's/^ //' | sort -u > symbols.sort | |
90 | ||
91 | locore.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 |
99 | exception.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 | ||
106 | swtch.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 | ||
111 | support.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 |
116 | machdep.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 |
120 | autoconf.o: Makefile | |
121 | ||
122 | # depend on network configuration | |
123 | af.o uipc_proto.o locore.o: Makefile | |
124 | ||
15637ed4 RG |
125 | # depends on KDB (cons.o also depends on GENERIC) |
126 | trap.o cons.o: Makefile | |
127 | ||
081b00bb | 128 | assym.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. | |
139 | genassym: Makefile | |
15637ed4 | 140 | ${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \ |
c779bb1a | 141 | ${I386}/i386/genassym.c -static -o genassym |
15637ed4 RG |
142 | |
143 | depend: 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 | ||
147 | links: | |
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 | ||
155 | tags: | |
156 | @echo "see $S/kern/Makefile for tags" | |
157 | ||
158 | ioconf.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 |
162 | conf.o: ${I386}/i386/conf.c $S/sys/conf.h |
163 | ${CC} -c ${CFLAGS} ${I386}/i386/conf.c | |
15637ed4 | 164 | |
082cf5d8 | 165 | param.c: $S/conf/param.c |
15637ed4 RG |
166 | -rm -f param.c |
167 | cp $S/conf/param.c . | |
168 | ||
169 | param.o: param.c Makefile | |
170 | ${CC} -c ${CFLAGS} ${PARAM} param.c | |
171 | ||
082cf5d8 | 172 | vers.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 |