Makefile.i386 revision 1.89
11.89Smrg# $NetBSD: Makefile.i386,v 1.89 1998/02/06 07:21:48 mrg Exp $ 21.62Smycroft 31.8Scgd# Makefile for NetBSD 41.1Scgd# 51.1Scgd# This makefile is constructed from a machine description: 61.1Scgd# config machineid 71.1Scgd# Most changes should be made in the machine description 81.36Sderaadt# /sys/arch/i386/conf/``machineid'' 91.1Scgd# after which you should do 101.62Smycroft# config machineid 111.62Smycroft# Machine generic makefile changes should be made in 121.36Sderaadt# /sys/arch/i386/conf/Makefile.i386 131.42Smycroft# after which config should be rerun for all machines of that type. 141.1Scgd# 151.42Smycroft# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 161.1Scgd# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 171.1Scgd# 181.1Scgd# -DTRACE compile in kernel tracing hooks 191.1Scgd# -DQUOTA compile in file system quotas 201.42Smycroft 211.62Smycroft# DEBUG is set to -g if debugging. 221.62Smycroft# PROF is set to -pg if profiling. 231.62Smycroft 241.88SthorpejAR?= ar 251.88SthorpejAS?= as 261.65SmycroftCC?= cc 271.88SthorpejCPP?= cpp 281.65SmycroftLD?= ld 291.87SthorpejLORDER?=lorder 301.68SmycroftMKDEP?= mkdep 311.87SthorpejNM?= nm 321.88SthorpejRANLIB?=ranlib 331.85SlukemSIZE?= size 341.74SmycroftSTRIP?= strip 351.87SthorpejTSORT?= tsort -q 361.88Sthorpej 371.85SlukemCOPTS?= -O2 381.1Scgd 391.42Smycroft# source tree is located via $S relative to the compilation directory 401.73Smycroft.ifndef S 411.68SmycroftS!= cd ../../../..; pwd 421.73Smycroft.endif 431.68SmycroftI386= $S/arch/i386 441.1Scgd 451.69SmycroftINCLUDES= -I. -I$S/arch -I$S -nostdinc 461.71SmycroftCPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \ 471.71Smycroft -Di386 481.76SchristosCWARNFLAGS= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes 491.77SjonathanCFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} 501.64SmycroftAFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 511.86SfvdlLINKFLAGS= -z -Ttext F0100000 -e start 521.74SmycroftSTRIPFLAGS= -d 531.74Smycroft 541.33Scgd### find out what to use for libkern 551.33Scgd.include "$S/lib/libkern/Makefile.inc" 561.33Scgd.ifndef PROF 571.33ScgdLIBKERN= ${KERNLIB} 581.33Scgd.else 591.33ScgdLIBKERN= ${KERNLIB_PROF} 601.33Scgd.endif 611.33Scgd 621.56Schristos### find out what to use for libcompat 631.56Schristos.include "$S/compat/common/Makefile.inc" 641.56Schristos.ifndef PROF 651.56SchristosLIBCOMPAT= ${COMPATLIB} 661.56Schristos.else 671.56SchristosLIBCOMPAT= ${COMPATLIB_PROF} 681.56Schristos.endif 691.56Schristos 701.71Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 711.71Smycroft# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 721.42Smycroft 731.62SmycroftNORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 741.64SmycroftNORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 751.42Smycroft 761.1Scgd%OBJS 771.1Scgd 781.1Scgd%CFILES 791.1Scgd 801.62Smycroft%SFILES 811.62Smycroft 821.42Smycroft# load lines for config "xxx" will be emitted as: 831.42Smycroft# xxx: ${SYSTEM_DEP} swapxxx.o 841.42Smycroft# ${SYSTEM_LD_HEAD} 851.42Smycroft# ${SYSTEM_LD} swapxxx.o 861.42Smycroft# ${SYSTEM_LD_TAIL} 871.62SmycroftSYSTEM_OBJ= locore.o \ 881.66Scgd param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT} 891.42SmycroftSYSTEM_DEP= Makefile ${SYSTEM_OBJ} 901.42SmycroftSYSTEM_LD_HEAD= rm -f $@ 911.62SmycroftSYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 921.62Smycroft ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 931.85SlukemSYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 941.62Smycroft 951.62SmycroftDEBUG?= 961.62Smycroft.if ${DEBUG} == "-g" 971.62SmycroftLINKFLAGS+= -X 981.62SmycroftSYSTEM_LD_TAIL+=; \ 991.62Smycroft echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 1001.74Smycroft echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@ 1011.62Smycroft.else 1021.89SmrgLINKFLAGS+= -X 1031.62Smycroft.endif 1041.42Smycroft 1051.1Scgd%LOAD 1061.50Smycroft 1071.82Smycroftassym.h: $S/kern/genassym.sh ${I386}/i386/genassym.cf 1081.82Smycroft sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 1091.82Smycroft < ${I386}/i386/genassym.cf > assym.h.tmp && \ 1101.82Smycroft mv -f assym.h.tmp assym.h 1111.1Scgd 1121.62Smycroftparam.c: $S/conf/param.c 1131.62Smycroft rm -f param.c 1141.62Smycroft cp $S/conf/param.c . 1151.1Scgd 1161.62Smycroftparam.o: param.c Makefile 1171.71Smycroft ${NORMAL_C} 1181.1Scgd 1191.62Smycroftioconf.o: ioconf.c 1201.62Smycroft ${NORMAL_C} 1211.42Smycroft 1221.62Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1231.62Smycroft sh $S/conf/newvers.sh 1241.62Smycroft ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 1251.1Scgd 1261.1Scgd 1271.84Schristos__CLEANKERNEL: .USE 1281.84Schristos @echo "${.TARGET}ing the kernel objects" 1291.66Scgd rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 1301.82Smycroft [Ee]rrs linterrs makelinks assym.h.tmp assym.h 1311.84Schristos 1321.84Schristos__CLEANDEPEND: .USE 1331.84Schristos rm -f .depend 1341.84Schristos 1351.84Schristosclean: __CLEANKERNEL 1361.84Schristos 1371.84Schristoscleandir: __CLEANKERNEL __CLEANDEPEND 1381.1Scgd 1391.62Smycroftlint: 1401.79Sperry @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 1411.80Sperry ${I386}/i386/Locore.c ${CFILES} \ 1421.62Smycroft ioconf.c param.c | \ 1431.62Smycroft grep -v 'static function .* unused' 1441.1Scgd 1451.62Smycrofttags: 1461.62Smycroft @echo "see $S/kern/Makefile for tags" 1471.1Scgd 1481.1Scgdlinks: 1491.1Scgd egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1501.1Scgd sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1511.1Scgd echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1521.1Scgd sort -u | comm -23 - dontlink | \ 1531.62Smycroft sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 1541.1Scgd sh makelinks && rm -f dontlink 1551.1Scgd 1561.62SmycroftSRCS= ${I386}/i386/locore.s \ 1571.66Scgd param.c ioconf.c ${CFILES} ${SFILES} 1581.78Scgddepend: .depend 1591.75Sjtk.depend: ${SRCS} assym.h param.c 1601.68Smycroft ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s 1611.68Smycroft ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 1621.68Smycroft ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 1631.83Sleo sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 1641.83Sleo ${CPPFLAGS} < ${I386}/i386/genassym.cf 1651.83Sleo @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 1661.83Sleo @rm -f assym.dep 1671.62Smycroft 1681.62Smycroft 1691.62Smycroft# depend on root or device configuration 1701.62Smycroftautoconf.o conf.o: Makefile 1711.62Smycroft 1721.62Smycroft# depend on network or filesystem configuration 1731.62Smycroftuipc_proto.o vfs_conf.o: Makefile 1741.1Scgd 1751.62Smycroft# depend on maxusers 1761.82Smycroftmachdep.o: Makefile 1771.1Scgd 1781.62Smycroft# depend on CPU configuration 1791.62Smycroftlocore.o machdep.o: Makefile 1801.1Scgd 1811.2Scgd 1821.62Smycroftlocore.o: ${I386}/i386/locore.s assym.h 1831.62Smycroft ${NORMAL_S} 1841.1Scgd 1851.1Scgd%RULES 186