Makefile.powerpc revision 27065
116239Sjkh# Makefile.i386 -- with config changes. 24Srgrimes# Copyright 1990 W. Jolitz 3509Srgrimes# from: @(#)Makefile.i386 7.1 5/10/91 427065Sbde# $Id: Makefile.i386,v 1.99 1997/05/31 17:59:56 peter 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# 184Srgrimes 1925083SjdpBINFORMAT?= aout 2025537Sdfr#BINFORMAT?= aoutkld 2125083Sjdp#BINFORMAT?= elf 2225083Sjdp 232056Swollman.if exists(./@/.) 242056SwollmanS= ./@ 252056Swollman.else 264SrgrimesS= ../.. 272056Swollman.endif 282056SwollmanI386= ${S}/i386 294Srgrimes 304836SdgCOPTFLAGS?=-O 3118518SbdeINCLUDES= -nostdinc -I- -I. -I$S 327627Snate# This hack is to allow kernel compiles to succeed on machines w/out srcdist 337627Snate.if exists($S/../include) 347627SnateINCLUDES+= -I$S/../include 357627Snate.else 367627SnateINCLUDES+= -I/usr/include 377627Snate.endif 3825202SpeterCOPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h 39712SwollmanCFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 40974SdgLOAD_ADDRESS?= F0100000 4127065SbdeDEFINED_PROF= ${PROF} 4220395Sbde.if defined(PROF) 4327065SbdeCFLAGS+= -malign-functions=4 4420395Sbde.if ${PROFLEVEL} >= 2 4520395SbdeIDENT+= -DGPROF4 -DGUPROF 4620395SbdePROF+= -mprofiler-epilogue 4720395Sbde.endif 4820395Sbde.endif 494Srgrimes 504SrgrimesNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 514SrgrimesNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 522408Sbde# XXX LOCORE means "don't declare C stuff" not "for locore.s". 5316028SpeterNORMAL_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 544SrgrimesDRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 554SrgrimesDRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 5616028SpeterDRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< 573863SbdePROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< 582408Sbde 5925985Sjdp# ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally 6025985Sjdp# omitted from SYSTEM_CFILES. They depend on setdefs.h, a header which 6125985Sjdp# is generated from all of ${OBJS}. We don't want to have to compile 6225985Sjdp# everything just to do a make depend. 6325985SjdpSYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c 642408SbdeSYSTEM_SFILES= ${I386}/i386/locore.s 6513031SbdeSYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} 665908Sbde.if ${CFLAGS:M-g} == "" 675908SbdeSYMORDER_EXCLUDE=-x symbols.exclude 685908Sbde.endif 6925083SjdpSYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 7025083Sjdp.if ${BINFORMAT} == aout 7125985SjdpSYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 7225083SjdpSYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o 735908SbdeSYSTEM_LD_TAIL= @echo rearranging symbols; \ 746018Sphk symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \ 755908Sbde size $@; chmod 755 $@ 7625083Sjdp.endif 7725537Sdfr.if ${BINFORMAT} == aoutkld 7825985SjdpSYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o 7925537SdfrSYSTEM_LD= @${LD} -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o 8025537SdfrSYSTEM_LD_TAIL= @echo rearranging symbols; \ 8125537Sdfr symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \ 8225537Sdfr size $@; chmod 755 $@ 8325537Sdfr.endif 8425083Sjdp.if ${BINFORMAT} == elf 8525985SjdpSYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \ 8625985Sjdp setdef1.o 8725985SjdpSYSTEM_LD= @${LD} -Bstatic -Ttext ${LOAD_ADDRESS} -e btext -defsym _DYNAMIC=0 \ 8825985Sjdp -o $@ -X ${SYSTEM_OBJS} vers.o 8925083SjdpSYSTEM_LD_TAIL= @size $@; chmod 755 $@ 9025083Sjdp.endif 914Srgrimes 925327Sgibbs%BEFORE_DEPEND 935327Sgibbs 944Srgrimes%OBJS 954Srgrimes 964Srgrimes%CFILES 974Srgrimes 9811918Sdg%SFILES 9911918Sdg 1004Srgrimes%LOAD 1014Srgrimes 1026802Sgibbs%CLEAN 1036802Sgibbs 1044Srgrimesclean: 10525985Sjdp rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \ 10625985Sjdp makelinks param.c setdefs.h symbols.exclude symbols.sort tags \ 1079647Sbde vers.c vnode_if.c vnode_if.h ${CLEAN} 1084Srgrimes 109715Swollman#lint: /tmp param.c 1103863Sbde# @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ 111715Swollman# ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ 112715Swollman# grep -v 'struct/union .* never defined' | \ 113715Swollman# grep -v 'possible pointer alignment problem' 1144Srgrimes 1155908Sbdesymbols.exclude: Makefile 1165908Sbde echo "gcc2_compiled." >symbols.exclude 1175908Sbde echo "___gnu_compiled_c" >>symbols.exclude 1185908Sbde 1194Srgrimessymbols.sort: ${I386}/i386/symbols.raw 1204Srgrimes grep -v '^#' ${I386}/i386/symbols.raw \ 1214Srgrimes | sed 's/^ //' | sort -u > symbols.sort 1224Srgrimes 1232464Sbdelocore.o: ${I386}/i386/locore.s assym.s 1242408Sbde ${NORMAL_S} 1254Srgrimes 12625985Sjdpsetdef0.o: ${I386}/i386/setdef0.c setdefs.h 12725083Sjdp ${NORMAL_C} 12825083Sjdp 12925985Sjdpsetdef1.o: ${I386}/i386/setdef1.c setdefs.h 13025083Sjdp ${NORMAL_C} 13125083Sjdp 13225985Sjdpsetdefs.h: gensetdefs ${OBJS} 13325985Sjdp ./gensetdefs ${OBJS} >setdefs.h 13425985Sjdp 13525985Sjdpgensetdefs: gensetdefs.o 13625985Sjdp ${CC} ${CFLAGS} gensetdefs.o -o $@ 13725985Sjdp 13825985Sjdpgensetdefs.o: ${I386}/i386/gensetdefs.c 13925985Sjdp ${CC} -c ${CFLAGS} ${I386}/i386/gensetdefs.c 14025985Sjdp 1412408Sbde# everything potentially depends on the Makefile since everything potentially 1422408Sbde# depends on the options. Some things are more dependent on the Makefile for 1432408Sbde# historical reasons. 1442408Sbdemachdep.o: Makefile 145757Sdg 1464Srgrimes# the following is necessary because autoconf.o depends on #if GENERIC 1474Srgrimesautoconf.o: Makefile 1484Srgrimes 14913259Swollman# XXX - may no longer be needed 15013259Swollmanlocore.o: Makefile 1514Srgrimes 1524Srgrimes# depends on KDB (cons.o also depends on GENERIC) 1534Srgrimestrap.o cons.o: Makefile 1544Srgrimes 1552408Sbde# this rule stops ./assym.s in .depend from causing problems 1562408Sbde./assym.s: assym.s 1572408Sbde 158649Snateassym.s: genassym 1593863Sbde ./genassym >assym.s 1604Srgrimes 1618876Srgrimes# Some of the defines that genassym outputs may well depend on the 162715Swollman# value of kernel options. 16325202Spetergenassym.o: ${I386}/i386/genassym.c Makefile opt_global.h 1644508Sbde ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 1654Srgrimes 1663863Sbdegenassym: genassym.o 16719461Sbde ${CC} ${CFLAGS} ${PARAM} genassym.o -o $@ 1683863Sbde 16925202Speter${OBJS}: opt_global.h 17025202Speter 1712408Sbde# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. 1725327Sgibbsdepend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} 17314924Speter rm -f .newdep 17414924Speter mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} 17514924Speter mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c 17625083Sjdp MKDEP_CPP="${CC} -E -x assembler-with-cpp" ; export MKDEP_CPP ; \ 17714924Speter mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} 17814331Speter rm -f .depend 17915679Swosch mv -f .newdep .depend 1804Srgrimes 1814Srgrimeslinks: 1828457Swollman egrep '#if' ${CFILES:Nswapkernel.c} | sed -f $S/conf/defines | \ 1834Srgrimes sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1848457Swollman echo ${CFILES:Nswapkernel.c} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1854Srgrimes sort -u | comm -23 - dontlink | \ 1864Srgrimes sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 1874Srgrimes sh makelinks && rm -f dontlink 1884Srgrimes 1894Srgrimestags: 1904Srgrimes @echo "see $S/kern/Makefile for tags" 1914Srgrimes 19215558Sjoerginstall: 19315558Sjoerg @if [ ! -f kernel ] ; then \ 19415558Sjoerg echo "You must first build your kernel before trying to install." ; \ 19515558Sjoerg exit 1 ; \ 19615558Sjoerg fi 1972823Sjkh chflags noschg /kernel 1982627Swollman mv /kernel /kernel.old 19917742Sache if [ `/usr/sbin/sysctl -n kern.bootfile` = /kernel ] ; then \ 20017742Sache /usr/sbin/sysctl -w kern.bootfile=/kernel.old ; \ 20113330Speter mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ 20213321Sphk fi 2032627Swollman install -c -m 555 -o root -g wheel -fschg kernel / 2042627Swollman 20515543Sphkioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \ 2064Srgrimes ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h 2074Srgrimes ${CC} -c ${CFLAGS} ioconf.c 2084Srgrimes 209509Srgrimesparam.c: $S/conf/param.c 2104Srgrimes -rm -f param.c 2114Srgrimes cp $S/conf/param.c . 2124Srgrimes 2134Srgrimesparam.o: param.c Makefile 2144Srgrimes ${CC} -c ${CFLAGS} ${PARAM} param.c 2154Srgrimes 216509Srgrimesvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 2174Srgrimes sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 2184Srgrimes ${CC} ${CFLAGS} -c vers.c 2194Srgrimes 2201549Srgrimesvnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src 2211549Srgrimes sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 2221549Srgrimesvnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 2231549Srgrimes sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 2241549Srgrimes 22518820Sbde.include <bsd.kern.mk> 22618820Sbde 2274Srgrimes%RULES 2284Srgrimes 2294Srgrimes# DO NOT DELETE THIS LINE -- make depend uses it 230