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