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