Commit | Line | Data |
---|---|---|
15637ed4 | 1 | # Copyright 1990 W. Jolitz |
082cf5d8 | 2 | # from: @(#)Makefile.i386 7.1 5/10/91 |
cdd10b9f | 3 | # $Id: Makefile.i386,v 1.11 1993/11/07 04:41:11 wollman 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 | ||
0d327739 GW |
33 | CWARNFLAGS= |
34 | COPTFLAGS=-O | |
15637ed4 RG |
35 | INCLUDES= -I. -I$S -I$S/sys |
36 | COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DNPX | |
37 | ASFLAGS= | |
0d327739 | 38 | CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} |
082cf5d8 | 39 | LOAD_ADDRESS?= FE000000 |
15637ed4 RG |
40 | |
41 | NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< | |
42 | NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< | |
43 | NORMAL_S= ${CPP} -I. -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o | |
44 | DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< | |
45 | DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< | |
236ce996 | 46 | SYSTEM_OBJS=locore.o ${OBJS} param.o ioconf.o conf.o machdep.o |
15637ed4 RG |
47 | SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS} |
48 | SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ | |
082cf5d8 | 49 | SYSTEM_LD= @${LD} -z -T ${LOAD_ADDRESS} -o $@ -X vers.o ${SYSTEM_OBJS} |
15637ed4 | 50 | SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; \ |
082cf5d8 | 51 | ${DBSYM} -fT ${LOAD_ADDRESS} $@; ${STRIP} -x $@; size $@; chmod 755 $@ |
15637ed4 | 52 | |
082cf5d8 RG |
53 | # (XXX) ok, this is weird. but we've got a working ed, and a broken ex, and |
54 | # the script is identical for either... -- cgd | |
55 | # | |
15637ed4 RG |
56 | GPROF.EX= /usr/src/lib/csu.i386/gprof.ex |
57 | PROFILE_C= ${CC} -S -c ${CFLAGS} $< ; \ | |
082cf5d8 | 58 | ed - $*.s < ${GPROF.EX} ; \ |
15637ed4 RG |
59 | ${AS} -o $@ $*.s ; \ |
60 | rm -f $*.s | |
61 | ||
62 | %OBJS | |
63 | ||
64 | %CFILES | |
65 | ||
66 | %LOAD | |
67 | ||
68 | clean: | |
69 | rm -f eddep *386bsd tags *.o locore.i [a-uw-z]*.s \ | |
cdd10b9f | 70 | errs linterrs makelinks genassym ,assym.s stamp-assym |
15637ed4 | 71 | |
cdd10b9f GW |
72 | #lint: /tmp param.c |
73 | # @lint -hbxn -I. -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ | |
74 | # ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ | |
75 | # grep -v 'struct/union .* never defined' | \ | |
76 | # grep -v 'possible pointer alignment problem' | |
15637ed4 RG |
77 | |
78 | symbols.sort: ${I386}/i386/symbols.raw | |
79 | grep -v '^#' ${I386}/i386/symbols.raw \ | |
80 | | sed 's/^ //' | sort -u > symbols.sort | |
81 | ||
82 | locore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \ | |
83 | machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s \ | |
84 | $S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h \ | |
85 | ${I386}/isa/icu.h ${I386}/isa/isa.h vector.h $S/net/netisr.h | |
86 | ${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \ | |
87 | ${AS} ${ASFLAGS} -o locore.o | |
88 | ||
082cf5d8 RG |
89 | machdep.o: ${I386}/i386/machdep.c Makefile |
90 | ${CC} -c ${CFLAGS} -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${PROF} $< | |
91 | ||
15637ed4 RG |
92 | # the following is necessary because autoconf.o depends on #if GENERIC |
93 | autoconf.o: Makefile | |
94 | ||
95 | # depend on network configuration | |
96 | af.o uipc_proto.o locore.o: Makefile | |
97 | ||
15637ed4 RG |
98 | # depends on KDB (cons.o also depends on GENERIC) |
99 | trap.o cons.o: Makefile | |
100 | ||
081b00bb | 101 | assym.s: genassym |
cdd10b9f GW |
102 | ./genassym >,assym.s |
103 | if cmp -s assym.s ,assym.s; then \ | |
104 | rm -f ,assym.s; \ | |
105 | else \ | |
106 | rm -f assym.s; \ | |
107 | mv ,assym.s assym.s; \ | |
108 | fi | |
109 | ||
110 | # Some of the defines that genassym outputs may well depend on the | |
111 | # value of kernel options. | |
112 | genassym: Makefile | |
15637ed4 | 113 | ${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} \ |
2ca20ba8 | 114 | ${I386}/i386/genassym.c -o genassym |
15637ed4 RG |
115 | |
116 | depend: assym.s param.c | |
082cf5d8 | 117 | sh /usr/bin/mkdep -DLOAD_ADDRESS=0x${LOAD_ADDRESS} ${COPTS} ${CFILES} ioconf.c param.c ${I386}/i386/conf.c |
15637ed4 RG |
118 | sh /usr/bin/mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c |
119 | ||
120 | links: | |
121 | egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ | |
122 | sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink | |
123 | echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ | |
124 | sort -u | comm -23 - dontlink | \ | |
125 | sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks | |
126 | sh makelinks && rm -f dontlink | |
127 | ||
128 | tags: | |
129 | @echo "see $S/kern/Makefile for tags" | |
130 | ||
131 | ioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \ | |
132 | ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h | |
133 | ${CC} -c ${CFLAGS} ioconf.c | |
134 | ||
082cf5d8 | 135 | conf.o: ${I386}/i386/conf.c |
15637ed4 RG |
136 | ${CC} -traditional -c ${CFLAGS} ${I386}/i386/conf.c |
137 | ||
082cf5d8 | 138 | param.c: $S/conf/param.c |
15637ed4 RG |
139 | -rm -f param.c |
140 | cp $S/conf/param.c . | |
141 | ||
142 | param.o: param.c Makefile | |
143 | ${CC} -c ${CFLAGS} ${PARAM} param.c | |
144 | ||
082cf5d8 | 145 | vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} |
15637ed4 RG |
146 | sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} |
147 | ${CC} ${CFLAGS} -c vers.c | |
148 | ||
149 | %RULES | |
150 | ||
151 | # DO NOT DELETE THIS LINE -- make depend uses it | |
152 |