Makefile.i386 revision 1.103
11.103Stsutsui# $NetBSD: Makefile.i386,v 1.103 2000/02/01 05:25:32 tsutsui 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.97Schristos.include <bsd.own.mk> 221.97Schristos 231.62Smycroft# DEBUG is set to -g if debugging. 241.62Smycroft# PROF is set to -pg if profiling. 251.62Smycroft 261.88SthorpejAR?= ar 271.88SthorpejAS?= as 281.65SmycroftCC?= cc 291.88SthorpejCPP?= cpp 301.65SmycroftLD?= ld 311.87SthorpejLORDER?=lorder 321.68SmycroftMKDEP?= mkdep 331.87SthorpejNM?= nm 341.88SthorpejRANLIB?=ranlib 351.85SlukemSIZE?= size 361.103StsutsuiSTRIP?= strip 371.87SthorpejTSORT?= tsort -q 381.88Sthorpej 391.85SlukemCOPTS?= -O2 401.1Scgd 411.42Smycroft# source tree is located via $S relative to the compilation directory 421.73Smycroft.ifndef S 431.68SmycroftS!= cd ../../../..; pwd 441.73Smycroft.endif 451.68SmycroftI386= $S/arch/i386 461.1Scgd 471.92SenamiHAVE_GCC28!= ${CC} --version | egrep "^(2\.8|egcs)" ; echo 481.69SmycroftINCLUDES= -I. -I$S/arch -I$S -nostdinc 491.96SthorpejCPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Di386 501.95SaugustssCWARNFLAGS?= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes \ 511.95Saugustss -Wpointer-arith 521.90Stv.if (${HAVE_GCC28} != "") 531.90StvCWARNFLAGS+= -Wno-main 541.90Stv.endif 551.77SjonathanCFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} 561.64SmycroftAFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 571.97SchristosLINKFLAGS= -Ttext F0100000 -e start 581.97Schristos.if (${OBJECT_FMT} == "ELF") 591.97Schristos#LINKFLAGS+= -N 601.97Schristos.else 611.97SchristosLINKFLAGS+= -z 621.97Schristos.endif 631.100StsutsuiSTRIPFLAGS= -g 641.98Smrg 651.98Smrg%INCLUDES 661.74Smycroft 671.33Scgd### find out what to use for libkern 681.94SdrochnerKERN_AS= obj 691.33Scgd.include "$S/lib/libkern/Makefile.inc" 701.33Scgd.ifndef PROF 711.33ScgdLIBKERN= ${KERNLIB} 721.33Scgd.else 731.33ScgdLIBKERN= ${KERNLIB_PROF} 741.33Scgd.endif 751.33Scgd 761.56Schristos### find out what to use for libcompat 771.56Schristos.include "$S/compat/common/Makefile.inc" 781.56Schristos.ifndef PROF 791.56SchristosLIBCOMPAT= ${COMPATLIB} 801.56Schristos.else 811.56SchristosLIBCOMPAT= ${COMPATLIB_PROF} 821.56Schristos.endif 831.56Schristos 841.71Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 851.71Smycroft# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 861.42Smycroft 871.62SmycroftNORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 881.91SthorpejNOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< 891.64SmycroftNORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 901.42Smycroft 911.1Scgd%OBJS 921.1Scgd 931.1Scgd%CFILES 941.1Scgd 951.62Smycroft%SFILES 961.62Smycroft 971.42Smycroft# load lines for config "xxx" will be emitted as: 981.42Smycroft# xxx: ${SYSTEM_DEP} swapxxx.o 991.42Smycroft# ${SYSTEM_LD_HEAD} 1001.42Smycroft# ${SYSTEM_LD} swapxxx.o 1011.42Smycroft# ${SYSTEM_LD_TAIL} 1021.62SmycroftSYSTEM_OBJ= locore.o \ 1031.94Sdrochner param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN} 1041.42SmycroftSYSTEM_DEP= Makefile ${SYSTEM_OBJ} 1051.42SmycroftSYSTEM_LD_HEAD= rm -f $@ 1061.62SmycroftSYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 1071.62Smycroft ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 1081.85SlukemSYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 1091.62Smycroft 1101.62SmycroftDEBUG?= 1111.62Smycroft.if ${DEBUG} == "-g" 1121.62SmycroftLINKFLAGS+= -X 1131.62SmycroftSYSTEM_LD_TAIL+=; \ 1141.99Scgd echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \ 1151.103Stsutsui echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ 1161.103Stsutsui ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb 1171.62Smycroft.else 1181.89SmrgLINKFLAGS+= -X 1191.62Smycroft.endif 1201.42Smycroft 1211.1Scgd%LOAD 1221.50Smycroft 1231.82Smycroftassym.h: $S/kern/genassym.sh ${I386}/i386/genassym.cf 1241.82Smycroft sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 1251.82Smycroft < ${I386}/i386/genassym.cf > assym.h.tmp && \ 1261.82Smycroft mv -f assym.h.tmp assym.h 1271.1Scgd 1281.62Smycroftparam.c: $S/conf/param.c 1291.62Smycroft rm -f param.c 1301.62Smycroft cp $S/conf/param.c . 1311.1Scgd 1321.62Smycroftparam.o: param.c Makefile 1331.71Smycroft ${NORMAL_C} 1341.1Scgd 1351.62Smycroftioconf.o: ioconf.c 1361.62Smycroft ${NORMAL_C} 1371.42Smycroft 1381.62Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1391.62Smycroft sh $S/conf/newvers.sh 1401.62Smycroft ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 1411.1Scgd 1421.1Scgd 1431.84Schristos__CLEANKERNEL: .USE 1441.84Schristos @echo "${.TARGET}ing the kernel objects" 1451.66Scgd rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 1461.82Smycroft [Ee]rrs linterrs makelinks assym.h.tmp assym.h 1471.84Schristos 1481.84Schristos__CLEANDEPEND: .USE 1491.84Schristos rm -f .depend 1501.84Schristos 1511.84Schristosclean: __CLEANKERNEL 1521.84Schristos 1531.93Slukemcleandir distclean: __CLEANKERNEL __CLEANDEPEND 1541.1Scgd 1551.62Smycroftlint: 1561.79Sperry @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 1571.80Sperry ${I386}/i386/Locore.c ${CFILES} \ 1581.62Smycroft ioconf.c param.c | \ 1591.62Smycroft grep -v 'static function .* unused' 1601.1Scgd 1611.62Smycrofttags: 1621.62Smycroft @echo "see $S/kern/Makefile for tags" 1631.1Scgd 1641.1Scgdlinks: 1651.1Scgd egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1661.1Scgd sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1671.1Scgd echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1681.1Scgd sort -u | comm -23 - dontlink | \ 1691.62Smycroft sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 1701.1Scgd sh makelinks && rm -f dontlink 1711.1Scgd 1721.62SmycroftSRCS= ${I386}/i386/locore.s \ 1731.66Scgd param.c ioconf.c ${CFILES} ${SFILES} 1741.78Scgddepend: .depend 1751.75Sjtk.depend: ${SRCS} assym.h param.c 1761.68Smycroft ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s 1771.68Smycroft ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 1781.68Smycroft ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 1791.83Sleo sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 1801.83Sleo ${CPPFLAGS} < ${I386}/i386/genassym.cf 1811.83Sleo @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 1821.83Sleo @rm -f assym.dep 1831.102Stron 1841.102Strondependall: depend all 1851.62Smycroft 1861.62Smycroft 1871.62Smycroft# depend on root or device configuration 1881.62Smycroftautoconf.o conf.o: Makefile 1891.92Senami 1901.92Senami# depend on network or filesystem configuration 1911.92Senamiuipc_proto.o vfs_conf.o: Makefile 1921.1Scgd 1931.62Smycroft# depend on maxusers 1941.82Smycroftmachdep.o: Makefile 1951.1Scgd 1961.92Senami# depend on CPU configuration 1971.62Smycroftlocore.o machdep.o: Makefile 1981.1Scgd 1991.2Scgd 2001.62Smycroftlocore.o: ${I386}/i386/locore.s assym.h 2011.62Smycroft ${NORMAL_S} 2021.1Scgd 2031.1Scgd%RULES 204