Makefile.powerpc revision 19461
116239Sjkh# Makefile.i386 -- with config changes. 24Srgrimes# Copyright 1990 W. Jolitz 3509Srgrimes# from: @(#)Makefile.i386 7.1 5/10/91 419461Sbde# $Id: Makefile.i386,v 1.89 1996/10/08 22:08:44 bde Exp $ 54Srgrimes# 6509Srgrimes# Makefile for FreeBSD 7509Srgrimes# 84Srgrimes# This makefile is constructed from a machine description: 94Srgrimes# config machineid 104Srgrimes# Most changes should be made in the machine description 114Srgrimes# /sys/i386/conf/``machineid'' 124Srgrimes# after which you should do 134Srgrimes# config machineid 144Srgrimes# Generic makefile changes should be made in 154Srgrimes# /sys/i386/conf/Makefile.i386 164Srgrimes# after which config should be rerun for all machines. 174Srgrimes# 188876SrgrimesCC?= cc 193698SwollmanCPP?= cpp 205908SbdeLD?= /usr/bin/ld 214Srgrimes 222056Swollman.if exists(./@/.) 232056SwollmanS= ./@ 242056Swollman.else 254SrgrimesS= ../.. 262056Swollman.endif 272056SwollmanI386= ${S}/i386 284Srgrimes 294836SdgCOPTFLAGS?=-O 3018518SbdeINCLUDES= -nostdinc -I- -I. -I$S 317627Snate# This hack is to allow kernel compiles to succeed on machines w/out srcdist 327627Snate.if exists($S/../include) 337627SnateINCLUDES+= -I$S/../include 347627Snate.else 357627SnateINCLUDES+= -I/usr/include 367627Snate.endif 3712400SdgCOPTS= ${INCLUDES} ${IDENT} -DKERNEL 38712SwollmanCFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 39974SdgLOAD_ADDRESS?= F0100000 404Srgrimes 414SrgrimesNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 424SrgrimesNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 432408Sbde# XXX LOCORE means "don't declare C stuff" not "for locore.s". 4416028SpeterNORMAL_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 454SrgrimesDRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 464SrgrimesDRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 4716028SpeterDRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 483863SbdePROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< 492408Sbde 5016239SjkhSYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c 512408SbdeSYSTEM_SFILES= ${I386}/i386/locore.s 5216239SjkhSYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 5313031SbdeSYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} 545908SbdeSYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 5513031SbdeSYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o 565908Sbde.if ${CFLAGS:M-g} == "" 575908SbdeSYMORDER_EXCLUDE=-x symbols.exclude 585908Sbde.endif 595908SbdeSYSTEM_LD_TAIL= @echo rearranging symbols; \ 606018Sphk symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \ 615908Sbde size $@; chmod 755 $@ 624Srgrimes 635327Sgibbs%BEFORE_DEPEND 645327Sgibbs 654Srgrimes%OBJS 664Srgrimes 674Srgrimes%CFILES 684Srgrimes 6911918Sdg%SFILES 7011918Sdg 714Srgrimes%LOAD 724Srgrimes 736802Sgibbs%CLEAN 746802Sgibbs 754Srgrimesclean: 7613031Sbde rm -f *.o *.s eddep errs genassym kernel linterrs \ 779647Sbde makelinks param.c symbols.exclude symbols.sort tags \ 789647Sbde vers.c vnode_if.c vnode_if.h ${CLEAN} 794Srgrimes 80715Swollman#lint: /tmp param.c 813863Sbde# @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ 82715Swollman# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 83715Swollman# grep -v 'struct/union .* never defined' | \ 84715Swollman# grep -v 'possible pointer alignment problem' 854Srgrimes 865908Sbdesymbols.exclude: Makefile 875908Sbde echo "gcc2_compiled." >symbols.exclude 885908Sbde echo "___gnu_compiled_c" >>symbols.exclude 895908Sbde 904Srgrimessymbols.sort: ${I386}/i386/symbols.raw 914Srgrimes grep -v '^#' ${I386}/i386/symbols.raw \ 924Srgrimes | sed 's/^ //' | sort -u > symbols.sort 934Srgrimes 942464Sbdelocore.o: ${I386}/i386/locore.s assym.s 952408Sbde ${NORMAL_S} 964Srgrimes 972408Sbde# everything potentially depends on the Makefile since everything potentially 982408Sbde# depends on the options. Some things are more dependent on the Makefile for 992408Sbde# historical reasons. 1002408Sbdemachdep.o: Makefile 101757Sdg 1024Srgrimes# the following is necessary because autoconf.o depends on #if GENERIC 1034Srgrimesautoconf.o: Makefile 1044Srgrimes 10513259Swollman# XXX - may no longer be needed 10613259Swollmanlocore.o: Makefile 1074Srgrimes 1084Srgrimes# depends on KDB (cons.o also depends on GENERIC) 1094Srgrimestrap.o cons.o: Makefile 1104Srgrimes 1112408Sbde# this rule stops ./assym.s in .depend from causing problems 1122408Sbde./assym.s: assym.s 1132408Sbde 114649Snateassym.s: genassym 1153863Sbde ./genassym >assym.s 1164Srgrimes 1178876Srgrimes# Some of the defines that genassym outputs may well depend on the 118715Swollman# value of kernel options. 1193863Sbdegenassym.o: ${I386}/i386/genassym.c Makefile 1204508Sbde ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 1214Srgrimes 1223863Sbdegenassym: genassym.o 12319461Sbde ${CC} ${CFLAGS} ${PARAM} genassym.o -o $@ 1243863Sbde 1252408Sbde# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. 1265327Sgibbsdepend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} 12714924Speter rm -f .newdep 12814924Speter mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} 12914924Speter mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 13014924Speter MKDEP_CPP="${CPP}" ; export MKDEP_CPP ; \ 13114924Speter mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} 13214331Speter rm -f .depend 13315679Swosch mv -f .newdep .depend 1344Srgrimes 1354Srgrimeslinks: 1368457Swollman egrep '#if' ${CFILES:Nswapkernel.c} | sed -f $S/conf/defines | \ 1374Srgrimes sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1388457Swollman echo ${CFILES:Nswapkernel.c} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1394Srgrimes sort -u | comm -23 - dontlink | \ 1404Srgrimes sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 1414Srgrimes sh makelinks && rm -f dontlink 1424Srgrimes 1434Srgrimestags: 1444Srgrimes @echo "see $S/kern/Makefile for tags" 1454Srgrimes 14615558Sjoerginstall: 14715558Sjoerg @if [ ! -f kernel ] ; then \ 14815558Sjoerg echo "You must first build your kernel before trying to install." ; \ 14915558Sjoerg exit 1 ; \ 15015558Sjoerg fi 1512823Sjkh chflags noschg /kernel 1522627Swollman mv /kernel /kernel.old 15317742Sache if [ `/usr/sbin/sysctl -n kern.bootfile` = /kernel ] ; then \ 15417742Sache /usr/sbin/sysctl -w kern.bootfile=/kernel.old ; \ 15513330Speter mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ 15613321Sphk fi 1572627Swollman install -c -m 555 -o root -g wheel -fschg kernel / 1582627Swollman 15915543Sphkioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \ 1604Srgrimes ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h 1614Srgrimes ${CC} -c ${CFLAGS} ioconf.c 1624Srgrimes 163509Srgrimesparam.c: $S/conf/param.c 1644Srgrimes -rm -f param.c 1654Srgrimes cp $S/conf/param.c . 1664Srgrimes 1674Srgrimesparam.o: param.c Makefile 1684Srgrimes ${CC} -c ${CFLAGS} ${PARAM} param.c 1694Srgrimes 170509Srgrimesvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1714Srgrimes sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 1724Srgrimes ${CC} ${CFLAGS} -c vers.c 1734Srgrimes 1741549Srgrimesvnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src 1751549Srgrimes sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 1761549Srgrimesvnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 1771549Srgrimes sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 1781549Srgrimes 17918820Sbde.include <bsd.kern.mk> 18018820Sbde 1814Srgrimes%RULES 1824Srgrimes 1834Srgrimes# DO NOT DELETE THIS LINE -- make depend uses it 184