1# Makefile.i386 -- with config changes. 2# Copyright 1990 W. Jolitz 3# from: @(#)Makefile.i386 7.1 5/10/91
| 1# Makefile.i386 -- with config changes. 2# Copyright 1990 W. Jolitz 3# from: @(#)Makefile.i386 7.1 5/10/91
|
4# $Id: Makefile.i386,v 1.99 1997/05/31 17:59:56 peter Exp $
| 4# $Id: Makefile.i386,v 1.100 1997/06/29 16:39:09 bde Exp $
|
5# 6# Makefile for FreeBSD 7# 8# This makefile is constructed from a machine description: 9# config machineid 10# Most changes should be made in the machine description 11# /sys/i386/conf/``machineid'' 12# after which you should do 13# config machineid 14# Generic makefile changes should be made in 15# /sys/i386/conf/Makefile.i386 16# after which config should be rerun for all machines. 17# 18 19BINFORMAT?= aout 20#BINFORMAT?= aoutkld 21#BINFORMAT?= elf 22
| 5# 6# Makefile for FreeBSD 7# 8# This makefile is constructed from a machine description: 9# config machineid 10# Most changes should be made in the machine description 11# /sys/i386/conf/``machineid'' 12# after which you should do 13# config machineid 14# Generic makefile changes should be made in 15# /sys/i386/conf/Makefile.i386 16# after which config should be rerun for all machines. 17# 18 19BINFORMAT?= aout 20#BINFORMAT?= aoutkld 21#BINFORMAT?= elf 22
|
| 23STD8X16FONT?= iso 24
|
23.if exists(./@/.) 24S= ./@ 25.else 26S= ../.. 27.endif 28I386= ${S}/i386 29 30COPTFLAGS?=-O 31INCLUDES= -nostdinc -I- -I. -I$S 32# This hack is to allow kernel compiles to succeed on machines w/out srcdist 33.if exists($S/../include) 34INCLUDES+= -I$S/../include 35.else 36INCLUDES+= -I/usr/include 37.endif 38COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h 39CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 40LOAD_ADDRESS?= F0100000 41DEFINED_PROF= ${PROF} 42.if defined(PROF) 43CFLAGS+= -malign-functions=4 44.if ${PROFLEVEL} >= 2 45IDENT+= -DGPROF4 -DGUPROF 46PROF+= -mprofiler-epilogue 47.endif 48.endif 49 50NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 51NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 52# XXX LOCORE means "don't declare C stuff" not "for locore.s". 53NORMAL_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 54DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 55DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 56DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 57PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< 58 59# ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally 60# omitted from SYSTEM_CFILES. They depend on setdefs.h, a header which 61# is generated from all of ${OBJS}. We don't want to have to compile 62# everything just to do a make depend. 63SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c 64SYSTEM_SFILES= ${I386}/i386/locore.s 65SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} 66.if ${CFLAGS:M-g} == "" 67SYMORDER_EXCLUDE=-x symbols.exclude 68.endif 69SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 70.if ${BINFORMAT} == aout 71SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 72SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o 73SYSTEM_LD_TAIL= @echo rearranging symbols; \ 74 symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \ 75 size $@; chmod 755 $@ 76.endif 77.if ${BINFORMAT} == aoutkld 78SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 79SYSTEM_LD= @${LD} -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o 80SYSTEM_LD_TAIL= @echo rearranging symbols; \ 81 symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \ 82 size $@; chmod 755 $@ 83.endif 84.if ${BINFORMAT} == elf 85SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \ 86 setdef1.o 87SYSTEM_LD= @${LD} -Bstatic -Ttext ${LOAD_ADDRESS} -e btext -defsym _DYNAMIC=0 \ 88 -o $@ -X ${SYSTEM_OBJS} vers.o 89SYSTEM_LD_TAIL= @size $@; chmod 755 $@ 90.endif 91 92%BEFORE_DEPEND 93 94%OBJS 95 96%CFILES 97 98%SFILES 99 100%LOAD 101 102%CLEAN 103 104clean: 105 rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \ 106 makelinks param.c setdefs.h symbols.exclude symbols.sort tags \ 107 vers.c vnode_if.c vnode_if.h ${CLEAN} 108 109#lint: /tmp param.c 110# @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ 111# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 112# grep -v 'struct/union .* never defined' | \ 113# grep -v 'possible pointer alignment problem' 114 115symbols.exclude: Makefile 116 echo "gcc2_compiled." >symbols.exclude 117 echo "___gnu_compiled_c" >>symbols.exclude 118 119symbols.sort: ${I386}/i386/symbols.raw 120 grep -v '^#' ${I386}/i386/symbols.raw \ 121 | sed 's/^ //' | sort -u > symbols.sort 122 123locore.o: ${I386}/i386/locore.s assym.s 124 ${NORMAL_S} 125 126setdef0.o: ${I386}/i386/setdef0.c setdefs.h 127 ${NORMAL_C} 128 129setdef1.o: ${I386}/i386/setdef1.c setdefs.h 130 ${NORMAL_C} 131 132setdefs.h: gensetdefs ${OBJS} 133 ./gensetdefs ${OBJS} >setdefs.h 134 135gensetdefs: gensetdefs.o 136 ${CC} ${CFLAGS} gensetdefs.o -o $@ 137 138gensetdefs.o: ${I386}/i386/gensetdefs.c 139 ${CC} -c ${CFLAGS} ${I386}/i386/gensetdefs.c 140 141# everything potentially depends on the Makefile since everything potentially 142# depends on the options. Some things are more dependent on the Makefile for 143# historical reasons. 144machdep.o: Makefile 145 146# the following is necessary because autoconf.o depends on #if GENERIC 147autoconf.o: Makefile 148 149# XXX - may no longer be needed 150locore.o: Makefile 151 152# depends on KDB (cons.o also depends on GENERIC) 153trap.o cons.o: Makefile 154 155# this rule stops ./assym.s in .depend from causing problems 156./assym.s: assym.s 157 158assym.s: genassym 159 ./genassym >assym.s 160 161# Some of the defines that genassym outputs may well depend on the 162# value of kernel options. 163genassym.o: ${I386}/i386/genassym.c Makefile opt_global.h 164 ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 165 166genassym: genassym.o 167 ${CC} ${CFLAGS} ${PARAM} genassym.o -o $@ 168 169${OBJS}: opt_global.h 170 171# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. 172depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} 173 rm -f .newdep 174 mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} 175 mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 176 MKDEP_CPP="${CC} -E -x assembler-with-cpp" ; export MKDEP_CPP ; \ 177 mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} 178 rm -f .depend 179 mv -f .newdep .depend 180 181links: 182 egrep '#if' ${CFILES:Nswapkernel.c} | sed -f $S/conf/defines | \ 183 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 184 echo ${CFILES:Nswapkernel.c} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 185 sort -u | comm -23 - dontlink | \ 186 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 187 sh makelinks && rm -f dontlink 188 189tags: 190 @echo "see $S/kern/Makefile for tags" 191 192install: 193 @if [ ! -f kernel ] ; then \ 194 echo "You must first build your kernel before trying to install." ; \ 195 exit 1 ; \ 196 fi 197 chflags noschg /kernel 198 mv /kernel /kernel.old 199 if [ `/usr/sbin/sysctl -n kern.bootfile` = /kernel ] ; then \ 200 /usr/sbin/sysctl -w kern.bootfile=/kernel.old ; \ 201 mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ 202 fi 203 install -c -m 555 -o root -g wheel -fschg kernel / 204 205ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \ 206 ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h 207 ${CC} -c ${CFLAGS} ioconf.c 208 209param.c: $S/conf/param.c 210 -rm -f param.c 211 cp $S/conf/param.c . 212 213param.o: param.c Makefile 214 ${CC} -c ${CFLAGS} ${PARAM} param.c 215 216vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 217 sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 218 ${CC} ${CFLAGS} -c vers.c 219 220vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src 221 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 222vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 223 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 224 225.include <bsd.kern.mk> 226 227%RULES 228 229# DO NOT DELETE THIS LINE -- make depend uses it
| 25.if exists(./@/.) 26S= ./@ 27.else 28S= ../.. 29.endif 30I386= ${S}/i386 31 32COPTFLAGS?=-O 33INCLUDES= -nostdinc -I- -I. -I$S 34# This hack is to allow kernel compiles to succeed on machines w/out srcdist 35.if exists($S/../include) 36INCLUDES+= -I$S/../include 37.else 38INCLUDES+= -I/usr/include 39.endif 40COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h 41CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 42LOAD_ADDRESS?= F0100000 43DEFINED_PROF= ${PROF} 44.if defined(PROF) 45CFLAGS+= -malign-functions=4 46.if ${PROFLEVEL} >= 2 47IDENT+= -DGPROF4 -DGUPROF 48PROF+= -mprofiler-epilogue 49.endif 50.endif 51 52NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 53NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 54# XXX LOCORE means "don't declare C stuff" not "for locore.s". 55NORMAL_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 56DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 57DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 58DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 59PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< 60 61# ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally 62# omitted from SYSTEM_CFILES. They depend on setdefs.h, a header which 63# is generated from all of ${OBJS}. We don't want to have to compile 64# everything just to do a make depend. 65SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c 66SYSTEM_SFILES= ${I386}/i386/locore.s 67SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} 68.if ${CFLAGS:M-g} == "" 69SYMORDER_EXCLUDE=-x symbols.exclude 70.endif 71SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 72.if ${BINFORMAT} == aout 73SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 74SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o 75SYSTEM_LD_TAIL= @echo rearranging symbols; \ 76 symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \ 77 size $@; chmod 755 $@ 78.endif 79.if ${BINFORMAT} == aoutkld 80SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 81SYSTEM_LD= @${LD} -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o 82SYSTEM_LD_TAIL= @echo rearranging symbols; \ 83 symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \ 84 size $@; chmod 755 $@ 85.endif 86.if ${BINFORMAT} == elf 87SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \ 88 setdef1.o 89SYSTEM_LD= @${LD} -Bstatic -Ttext ${LOAD_ADDRESS} -e btext -defsym _DYNAMIC=0 \ 90 -o $@ -X ${SYSTEM_OBJS} vers.o 91SYSTEM_LD_TAIL= @size $@; chmod 755 $@ 92.endif 93 94%BEFORE_DEPEND 95 96%OBJS 97 98%CFILES 99 100%SFILES 101 102%LOAD 103 104%CLEAN 105 106clean: 107 rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \ 108 makelinks param.c setdefs.h symbols.exclude symbols.sort tags \ 109 vers.c vnode_if.c vnode_if.h ${CLEAN} 110 111#lint: /tmp param.c 112# @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ 113# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 114# grep -v 'struct/union .* never defined' | \ 115# grep -v 'possible pointer alignment problem' 116 117symbols.exclude: Makefile 118 echo "gcc2_compiled." >symbols.exclude 119 echo "___gnu_compiled_c" >>symbols.exclude 120 121symbols.sort: ${I386}/i386/symbols.raw 122 grep -v '^#' ${I386}/i386/symbols.raw \ 123 | sed 's/^ //' | sort -u > symbols.sort 124 125locore.o: ${I386}/i386/locore.s assym.s 126 ${NORMAL_S} 127 128setdef0.o: ${I386}/i386/setdef0.c setdefs.h 129 ${NORMAL_C} 130 131setdef1.o: ${I386}/i386/setdef1.c setdefs.h 132 ${NORMAL_C} 133 134setdefs.h: gensetdefs ${OBJS} 135 ./gensetdefs ${OBJS} >setdefs.h 136 137gensetdefs: gensetdefs.o 138 ${CC} ${CFLAGS} gensetdefs.o -o $@ 139 140gensetdefs.o: ${I386}/i386/gensetdefs.c 141 ${CC} -c ${CFLAGS} ${I386}/i386/gensetdefs.c 142 143# everything potentially depends on the Makefile since everything potentially 144# depends on the options. Some things are more dependent on the Makefile for 145# historical reasons. 146machdep.o: Makefile 147 148# the following is necessary because autoconf.o depends on #if GENERIC 149autoconf.o: Makefile 150 151# XXX - may no longer be needed 152locore.o: Makefile 153 154# depends on KDB (cons.o also depends on GENERIC) 155trap.o cons.o: Makefile 156 157# this rule stops ./assym.s in .depend from causing problems 158./assym.s: assym.s 159 160assym.s: genassym 161 ./genassym >assym.s 162 163# Some of the defines that genassym outputs may well depend on the 164# value of kernel options. 165genassym.o: ${I386}/i386/genassym.c Makefile opt_global.h 166 ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 167 168genassym: genassym.o 169 ${CC} ${CFLAGS} ${PARAM} genassym.o -o $@ 170 171${OBJS}: opt_global.h 172 173# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. 174depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} 175 rm -f .newdep 176 mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} 177 mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 178 MKDEP_CPP="${CC} -E -x assembler-with-cpp" ; export MKDEP_CPP ; \ 179 mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} 180 rm -f .depend 181 mv -f .newdep .depend 182 183links: 184 egrep '#if' ${CFILES:Nswapkernel.c} | sed -f $S/conf/defines | \ 185 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 186 echo ${CFILES:Nswapkernel.c} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 187 sort -u | comm -23 - dontlink | \ 188 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 189 sh makelinks && rm -f dontlink 190 191tags: 192 @echo "see $S/kern/Makefile for tags" 193 194install: 195 @if [ ! -f kernel ] ; then \ 196 echo "You must first build your kernel before trying to install." ; \ 197 exit 1 ; \ 198 fi 199 chflags noschg /kernel 200 mv /kernel /kernel.old 201 if [ `/usr/sbin/sysctl -n kern.bootfile` = /kernel ] ; then \ 202 /usr/sbin/sysctl -w kern.bootfile=/kernel.old ; \ 203 mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ 204 fi 205 install -c -m 555 -o root -g wheel -fschg kernel / 206 207ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \ 208 ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h 209 ${CC} -c ${CFLAGS} ioconf.c 210 211param.c: $S/conf/param.c 212 -rm -f param.c 213 cp $S/conf/param.c . 214 215param.o: param.c Makefile 216 ${CC} -c ${CFLAGS} ${PARAM} param.c 217 218vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 219 sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 220 ${CC} ${CFLAGS} -c vers.c 221 222vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src 223 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 224vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 225 sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 226 227.include <bsd.kern.mk> 228 229%RULES 230 231# DO NOT DELETE THIS LINE -- make depend uses it
|