Makefile.powerpc revision 1.14
11.14Smatt# $NetBSD: Makefile.powerpc,v 1.14 2001/08/26 02:47:38 matt Exp $ 21.1Sws# 31.1Sws# Makefile for NetBSD 41.1Sws# 51.1Sws# This makefile is constructed from a machine description: 61.1Sws# config machineid 71.1Sws# Most changes should be made in the machine description 81.1Sws# /sys/arch/powerpc/conf/``machineid'' 91.1Sws# after which you should do 101.1Sws# config machineid 111.1Sws# Machine generic makefile changes should be made in 121.1Sws# /sys/arch/powerpc/conf/Makefile.powerpc 131.1Sws# after which config should be rerun for all machines of that type. 141.1Sws# 151.1Sws# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 161.1Sws# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 171.1Sws# 181.1Sws# -DTRACE compile in kernel tracing hooks 191.1Sws# -DQUOTA compile in file system quotas 201.14Smatt 211.1Sws.SUFFIXES: .S .c .o 221.1Sws 231.1Sws# DEBUG is set to -g if debugging. 241.1Sws# PROF is set to -pg if profiling. 251.1Sws 261.14SmattAR?= ar 271.14SmattAS?= as 281.14SmattCC?= cc 291.14SmattCPP?= cpp 301.14SmattLD?= ld 311.14SmattLORDER?= lorder 321.14SmattMKDEP?= mkdep 331.14SmattNM?= nm 341.14SmattOBJCOPY?= objcopy 351.14SmattOBJDUMP?= objdump 361.14SmattRANLIB?= ranlib 371.14SmattSIZE?= size 381.14SmattSTRIP?= strip 391.14SmattTSORT?= tsort -q 401.11Sthorpej 411.14SmattCOPTS?= -O2 421.14SmattTEXTADDR?= 0x100000 431.1Sws 441.1Sws# source tree is located via $S relative to the compilation directory 451.14Smatt.ifndef S 461.14SmattS!= cd ../../../..; pwd 471.1Sws.endif 481.14SmattTHISPPC= $S/arch/${TARGET_MACHINE} 491.14SmattPOWERPC= $S/arch/powerpc 501.1Sws 511.1SwsINCLUDES= -I. -I$S/arch -I$S -nostdinc 521.14SmattCPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} \ 531.14Smatt -D_KERNEL -D_KERNEL_OPT -D${TARGET_MACHINE} 541.14SmattCWARNFLAGS?= -Werror -Wall -Wreturn-type -Wpointer-arith -Wno-main \ 551.14Smatt -Wmissing-prototypes -Wstrict-prototypes 561.14Smatt# XXX Delete -Wuninitialized for now, since the compiler doesn't 571.14Smatt# XXX always get it right. --thorpej 581.14SmattCWARNFLAGS+= -Wno-uninitialized 591.14SmattCFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -msoft-float ${CCPUOPTS} 601.14SmattAFLAGS= -D_LOCORE ${AOPTS} 611.14SmattLINKFLAGS= -N -Ttext ${TEXTADDR} -e __start 621.6SthorpejSTRIPFLAGS= --strip-debug 631.1Sws 641.14Smatt%INCLUDES 651.14Smatt 661.1Sws### find out what to use for libkern 671.1Sws.include "$S/lib/libkern/Makefile.inc" 681.1Sws.ifndef PROF 691.1SwsLIBKERN= ${KERNLIB} 701.1Sws.else 711.1SwsLIBKERN= ${KERNLIB_PROF} 721.1Sws.endif 731.1Sws 741.1Sws### find out what to use for libcompat 751.1Sws.include "$S/compat/common/Makefile.inc" 761.1Sws.ifndef PROF 771.1SwsLIBCOMPAT= ${COMPATLIB} 781.1Sws.else 791.1SwsLIBCOMPAT= ${COMPATLIB_PROF} 801.1Sws.endif 811.1Sws 821.1Sws# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 831.1Sws# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 841.1Sws 851.1SwsNORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 861.14SmattNOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< 871.1SwsNORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 881.1Sws 891.1Sws%OBJS 901.1Sws 911.1Sws%CFILES 921.1Sws 931.1Sws%SFILES 941.1Sws 951.1Sws# load lines for config "xxx" will be emitted as: 961.1Sws# xxx: ${SYSTEM_DEP} swapxxx.o 971.1Sws# ${SYSTEM_LD_HEAD} 981.1Sws# ${SYSTEM_LD} swapxxx.o 991.1Sws# ${SYSTEM_LD_TAIL} 1001.1SwsSYSTEM_OBJ= locore.o \ 1011.14Smatt param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN} 1021.1SwsSYSTEM_DEP= Makefile ${SYSTEM_OBJ} 1031.1SwsSYSTEM_LD_HEAD= rm -f $@ 1041.1SwsSYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 1051.1Sws ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 1061.1SwsSYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 1071.1Sws 1081.1SwsDEBUG?= 1091.1Sws.if ${DEBUG} == "-g" 1101.1SwsLINKFLAGS+= -X 1111.1SwsSYSTEM_LD_TAIL+=; \ 1121.14Smatt echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \ 1131.14Smatt echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ 1141.14Smatt ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb 1151.1Sws.else 1161.1SwsLINKFLAGS+= -S 1171.1Sws.endif 1181.14Smatt.if defined(NEED_SREC) 1191.14SmattSYSTEM_LD_TAIL+=; \ 1201.14Smatt ${OBJCOPY} -v -O srec $@ $@.srec 1211.14Smatt.endif 1221.1Sws 1231.1Sws%LOAD 1241.1Sws 1251.14Smattassym.h: $S/kern/genassym.sh ${THISPPC}/${TARGET_MACHINE}/genassym.cf 1261.6Sthorpej sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 1271.14Smatt < ${THISPPC}/${TARGET_MACHINE}/genassym.cf > assym.h.tmp && \ 1281.6Sthorpej mv -f assym.h.tmp assym.h 1291.1Sws 1301.1Swsparam.c: $S/conf/param.c 1311.1Sws rm -f param.c 1321.1Sws cp $S/conf/param.c . 1331.1Sws 1341.1Swsparam.o: param.c Makefile 1351.1Sws ${NORMAL_C} 1361.1Sws 1371.1Swsioconf.o: ioconf.c 1381.1Sws ${NORMAL_C} 1391.1Sws 1401.1Swsnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1411.1Sws sh $S/conf/newvers.sh 1421.1Sws ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 1431.1Sws 1441.9Schristos__CLEANKERNEL: .USE 1451.9Schristos @echo "${.TARGET}ing the kernel objects" 1461.1Sws rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 1471.9Schristos [Ee]rrs linterrs makelinks assym.h.tmp assym.h 1481.9Schristos 1491.9Schristos__CLEANDEPEND: .USE 1501.9Schristos rm -f .depend 1511.9Schristos 1521.9Schristosclean: __CLEANKERNEL 1531.9Schristos 1541.14Smattcleandir distclean: __CLEANKERNEL __CLEANDEPEND 1551.1Sws 1561.1Swslint: 1571.3Sperry @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 1581.14Smatt ${THISPPC}/${TARGET_MACHINE}/Locore.c ${CFILES} \ 1591.14Smatt ioconf.c param.c | \ 1601.14Smatt grep -v 'static function .* unused' 1611.1Sws 1621.1Swstags: 1631.1Sws @echo "see $S/kern/Makefile for tags" 1641.1Sws 1651.1Swslinks: 1661.1Sws egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1671.1Sws sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1681.1Sws echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1691.1Sws sort -u | comm -23 - dontlink | \ 1701.1Sws sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 1711.1Sws sh makelinks && rm -f dontlink 1721.1Sws 1731.14SmattSRCS= ${THISPPC}/${TARGET_MACHINE}/locore.S \ 1741.1Sws param.c ioconf.c ${CFILES} ${SFILES} 1751.6Sthorpejdepend: .depend 1761.1Sws.depend: ${SRCS} assym.h param.c 1771.14Smatt ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${THISPPC}/${TARGET_MACHINE}/locore.S 1781.1Sws ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 1791.1Sws.if ${SFILES} != "" 1801.1Sws ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 1811.1Sws.endif 1821.8Sleo sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 1831.14Smatt ${CPPFLAGS} < ${THISPPC}/${TARGET_MACHINE}/genassym.cf 1841.8Sleo @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 1851.8Sleo @rm -f assym.dep 1861.1Sws 1871.14Smattdependall: depend all 1881.14Smatt 1891.1Sws# depend on root or device configuration 1901.1Swsautoconf.o conf.o: Makefile 1911.1Sws 1921.1Sws# depend on network or filesystem configuration 1931.1Swsuipc_proto.o vfs_conf.o: Makefile 1941.1Sws 1951.1Sws# depend on maxusers 1961.6Sthorpejmachdep.o: Makefile 1971.1Sws 1981.1Sws# depend on CPU configuration 1991.1Swslocore.o machdep.o: Makefile 2001.1Sws 2011.14Smattlocore.o: ${THISPPC}/${TARGET_MACHINE}/locore.S assym.h 2021.14Smatt ${NORMAL_S} 2031.1Sws 2041.14Smatt# The install target can be redefined by putting a 2051.14Smatt# install-kernel-${MACHINE_NAME} target into /etc/mk.conf 2061.14SmattMACHINE_NAME!= uname -n 2071.14Smattinstall: install-kernel-${MACHINE_NAME} 2081.14Smatt.if !target(install-kernel-${MACHINE_NAME}}) 2091.14Smattinstall-kernel-${MACHINE_NAME}: 2101.14Smatt rm -f /onetbsd 2111.14Smatt ln /netbsd /onetbsd 2121.14Smatt cp netbsd /nnetbsd 2131.14Smatt mv /nnetbsd /netbsd 2141.14Smatt.endif 2151.1Sws 2161.1Sws%RULES 217