Makefile.powerpc revision 7432
14Srgrimes# Copyright 1990 W. Jolitz 2509Srgrimes# from: @(#)Makefile.i386 7.1 5/10/91 37432Sbde# $Id: Makefile.i386,v 1.59 1995/03/25 23:21:36 bde Exp $ 44Srgrimes# 5509Srgrimes# Makefile for FreeBSD 6509Srgrimes# 74Srgrimes# This makefile is constructed from a machine description: 84Srgrimes# config machineid 94Srgrimes# Most changes should be made in the machine description 104Srgrimes# /sys/i386/conf/``machineid'' 114Srgrimes# after which you should do 124Srgrimes# config machineid 134Srgrimes# Generic makefile changes should be made in 144Srgrimes# /sys/i386/conf/Makefile.i386 154Srgrimes# after which config should be rerun for all machines. 164Srgrimes# 173698SwollmanCC?= cc 183698SwollmanCPP?= cpp 195908SbdeLD?= /usr/bin/ld 204Srgrimes 212056Swollman.if exists(./@/.) 222056SwollmanS= ./@ 232056Swollman.else 244SrgrimesS= ../.. 252056Swollman.endif 262056SwollmanI386= ${S}/i386 274Srgrimes 287432SbdeCWARNFLAGS?=-W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit 29798Swollman# 303863Sbde# The following flags are next up for working on: 317432Sbde# -Wnested-externs (almost works) 327367Sbde# -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations 33798Swollman# 34798Swollman# When working on removing warnings from code, the `-Werror' flag should be 35798Swollman# of material assistance. 36798Swollman# 374836SdgCOPTFLAGS?=-O 386733Sbde# Not ready for -I- yet. #include "foo.h" where foo.h is in the srcdir fails. 396733SbdeINCLUDES= -nostdinc -I. -I$S -I$S/sys -I$S/../include 402408SbdeCOPTS= ${INCLUDES} ${IDENT} -DKERNEL -Di386 -DLOAD_ADDRESS=0x${LOAD_ADDRESS} 414SrgrimesASFLAGS= 42712SwollmanCFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 43974SdgLOAD_ADDRESS?= F0100000 444Srgrimes 454SrgrimesNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 464SrgrimesNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 472408Sbde# XXX errors leak out of all the pipes. Should use cc *.S. 482408Sbde# XXX LOCORE means "don't declare C stuff" not "for locore.s". 493863SbdeNORMAL_S= ${CPP} -DLOCORE ${COPTS} $< | ${AS} ${ASFLAGS} -o $*.o 504SrgrimesDRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 514SrgrimesDRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 523863SbdePROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< 532408Sbde 542408SbdeSFILES= ${I386}/i386/exception.s ${I386}/i386/microtime.s \ 553258Sdg ${I386}/i386/support.s ${I386}/i386/swtch.s ${I386}/apm/apm_setup.s 562408SbdeSYSTEM_CFILES= ioconf.c param.c vnode_if.c 572408SbdeSYSTEM_SFILES= ${I386}/i386/locore.s 585908SbdeSYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o 595908SbdeSYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} libkern.a 605908SbdeSYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 611549SrgrimesSYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o libkern.a 625908Sbde.if ${CFLAGS:M-g} == "" 635908SbdeSYMORDER_EXCLUDE=-x symbols.exclude 645908Sbde.endif 655908SbdeSYSTEM_LD_TAIL= @echo rearranging symbols; \ 666018Sphk symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \ 675908Sbde size $@; chmod 755 $@ 684Srgrimes 695327Sgibbs%BEFORE_DEPEND 705327Sgibbs 714Srgrimes%OBJS 724Srgrimes 734Srgrimes%CFILES 744Srgrimes 754Srgrimes%LOAD 764Srgrimes 776802Sgibbs%CLEAN 786802Sgibbs 792232Sjkh# This is slightly different from before in that if you define PROF 802232Sjkh# to anything, it will assume profiling. Don't do "PROF=" to turn 812232Sjkh# profiling off! 822232Sjkh.if exists($S/libkern/obj) 832232SjkhLIBKERNP=$S/libkern/obj 842232Sjkh.else 852232SjkhLIBKERNP=$S/libkern 862239Sjkh.endif 872239Sjkh 882232Sjkh.if defined(PROF) 892232SjkhLIBKERN=${LIBKERNP}/libkern_p.a 902232Sjkh.else 912232SjkhLIBKERN=${LIBKERNP}/libkern.a 922239Sjkh.endif 931549Srgrimes 942232Sjkhlibkern.a: ${LIBKERN} 952514Sjkh @rm -f libkern.a 962232Sjkh ln -s ${LIBKERN} libkern.a 972232Sjkh 982232Sjkh${LIBKERN}: 992232Sjkh @(cd $S/libkern; make) 1002232Sjkh 1014Srgrimesclean: 1025908Sbde rm -f eddep kernel tags *.o *.s errs linterrs makelinks genassym \ 1036802Sgibbs symbols.exclude symbols.sort ${CLEAN} 1044Srgrimes 105715Swollman#lint: /tmp param.c 1063863Sbde# @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ 107715Swollman# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 108715Swollman# grep -v 'struct/union .* never defined' | \ 109715Swollman# grep -v 'possible pointer alignment problem' 1104Srgrimes 1115908Sbdesymbols.exclude: Makefile 1125908Sbde echo "gcc2_compiled." >symbols.exclude 1135908Sbde echo "___gnu_compiled_c" >>symbols.exclude 1145908Sbde 1154Srgrimessymbols.sort: ${I386}/i386/symbols.raw 1164Srgrimes grep -v '^#' ${I386}/i386/symbols.raw \ 1174Srgrimes | sed 's/^ //' | sort -u > symbols.sort 1184Srgrimes 1192464Sbdelocore.o: ${I386}/i386/locore.s assym.s 1202408Sbde ${NORMAL_S} 1214Srgrimes 1222408Sbde# everything potentially depends on the Makefile since everything potentially 1232408Sbde# depends on the options. Some things are more dependent on the Makefile for 1242408Sbde# historical reasons. 1252408Sbdemachdep.o: Makefile 126757Sdg 1274Srgrimes# the following is necessary because autoconf.o depends on #if GENERIC 1284Srgrimesautoconf.o: Makefile 1294Srgrimes 1304Srgrimes# depend on network configuration 1314Srgrimesaf.o uipc_proto.o locore.o: Makefile 1324Srgrimes 1334Srgrimes# depends on KDB (cons.o also depends on GENERIC) 1344Srgrimestrap.o cons.o: Makefile 1354Srgrimes 1362408Sbde# this rule stops ./assym.s in .depend from causing problems 1372408Sbde./assym.s: assym.s 1382408Sbde 139649Snateassym.s: genassym 1403863Sbde ./genassym >assym.s 1414Srgrimes 142715Swollman# Some of the defines that genassym outputs may well depend on the 143715Swollman# value of kernel options. 1443863Sbdegenassym.o: ${I386}/i386/genassym.c Makefile 1454508Sbde ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 1464Srgrimes 1473863Sbdegenassym: genassym.o 1483863Sbde ${CC} -static ${CFLAGS} ${PARAM} genassym.o -o $@ 1493863Sbde 1502408Sbde# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. 1515327Sgibbsdepend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} 1522408Sbde mkdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} 1534508Sbde mkdep -a ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 1542408Sbde MKDEP_CPP=${CPP} ; export MKDEP_CPP ; \ 1553863Sbde mkdep -a -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} 1564Srgrimes 1574Srgrimeslinks: 1584Srgrimes egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1594Srgrimes sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1604Srgrimes echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1614Srgrimes sort -u | comm -23 - dontlink | \ 1624Srgrimes sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 1634Srgrimes sh makelinks && rm -f dontlink 1644Srgrimes 1654Srgrimestags: 1664Srgrimes @echo "see $S/kern/Makefile for tags" 1674Srgrimes 1682627Swollmaninstall: 1692823Sjkh chflags noschg /kernel 1702627Swollman mv /kernel /kernel.old 1712627Swollman install -c -m 555 -o root -g wheel -fschg kernel / 1722627Swollman 1734Srgrimesioconf.o: ioconf.c $S/sys/param.h machine/pte.h $S/sys/buf.h \ 1744Srgrimes ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h 1754Srgrimes ${CC} -c ${CFLAGS} ioconf.c 1764Srgrimes 177509Srgrimesparam.c: $S/conf/param.c 1784Srgrimes -rm -f param.c 1794Srgrimes cp $S/conf/param.c . 1804Srgrimes 1814Srgrimesparam.o: param.c Makefile 1824Srgrimes ${CC} -c ${CFLAGS} ${PARAM} param.c 1834Srgrimes 184509Srgrimesvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1854Srgrimes sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 1864Srgrimes ${CC} ${CFLAGS} -c vers.c 1874Srgrimes 1881549Srgrimesvnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src 1891549Srgrimes sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 1901549Srgrimesvnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 1911549Srgrimes sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 1921549Srgrimes 1934Srgrimes%RULES 1944Srgrimes 1954Srgrimes# DO NOT DELETE THIS LINE -- make depend uses it 196