Makefile.i386 revision 1.69
11.69Smycroft# $NetBSD: Makefile.i386,v 1.69 1996/08/10 06:09:00 mycroft 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.65SmycroftCC?= cc 251.65SmycroftLD?= ld 261.68SmycroftMKDEP?= mkdep 271.65SmycroftSTRIP?= strip -d 281.65SmycroftTOUCH?= touch -f -c 291.1Scgd 301.42Smycroft# source tree is located via $S relative to the compilation directory 311.68SmycroftS!= cd ../../../..; pwd 321.68SmycroftI386= $S/arch/i386 331.1Scgd 341.69SmycroftINCLUDES= -I. -I$S/arch -I$S -nostdinc 351.62SmycroftCPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Di386 361.68SmycroftCWARNFLAGS= -Werror -Wreturn-type 371.68SmycroftCFLAGS= ${DEBUG} ${CWARNFLAGS} -O2 381.64SmycroftAFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 391.62SmycroftLINKFLAGS= -z -Ttext F8100000 -e start 401.1Scgd 411.33Scgd### find out what to use for libkern 421.33Scgd.include "$S/lib/libkern/Makefile.inc" 431.33Scgd.ifndef PROF 441.33ScgdLIBKERN= ${KERNLIB} 451.33Scgd.else 461.33ScgdLIBKERN= ${KERNLIB_PROF} 471.33Scgd.endif 481.33Scgd 491.56Schristos### find out what to use for libcompat 501.56Schristos.include "$S/compat/common/Makefile.inc" 511.56Schristos.ifndef PROF 521.56SchristosLIBCOMPAT= ${COMPATLIB} 531.56Schristos.else 541.56SchristosLIBCOMPAT= ${COMPATLIB_PROF} 551.56Schristos.endif 561.56Schristos 571.42Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} 581.53Scgd# where TYPE is NORMAL, DRIVER, or PROFILE; SUFFIX is the file suffix, 591.42Smycroft# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file 601.42Smycroft# is marked as config-dependent. 611.42Smycroft 621.62SmycroftNORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 631.62SmycroftNORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $< 641.1Scgd 651.62SmycroftDRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 661.62SmycroftDRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $< 671.2Scgd 681.64SmycroftNORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 691.64SmycroftNORMAL_S_C= ${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $< 701.42Smycroft 711.69SmycroftHOSTED_C_C= ${NORMAL_C_C:S/^-pg$//:S/^-p$//:S/^-nostdinc$//} 721.69Smycroft 731.1Scgd%OBJS 741.1Scgd 751.1Scgd%CFILES 761.1Scgd 771.62Smycroft%SFILES 781.62Smycroft 791.42Smycroft# load lines for config "xxx" will be emitted as: 801.42Smycroft# xxx: ${SYSTEM_DEP} swapxxx.o 811.42Smycroft# ${SYSTEM_LD_HEAD} 821.42Smycroft# ${SYSTEM_LD} swapxxx.o 831.42Smycroft# ${SYSTEM_LD_TAIL} 841.62SmycroftSYSTEM_OBJ= locore.o \ 851.66Scgd param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT} 861.42SmycroftSYSTEM_DEP= Makefile ${SYSTEM_OBJ} 871.42SmycroftSYSTEM_LD_HEAD= rm -f $@ 881.62SmycroftSYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 891.62Smycroft ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 901.62SmycroftSYSTEM_LD_TAIL= @size $@; chmod 755 $@ 911.62Smycroft 921.62SmycroftDEBUG?= 931.62Smycroft.if ${DEBUG} == "-g" 941.62SmycroftLINKFLAGS+= -X 951.62SmycroftSYSTEM_LD_TAIL+=; \ 961.62Smycroft echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 971.62Smycroft echo ${STRIP} $@; ${STRIP} $@ 981.62Smycroft.else 991.68SmycroftLINKFLAGS+= -S 1001.62Smycroft.endif 1011.42Smycroft 1021.1Scgd%LOAD 1031.50Smycroft 1041.62Smycroftassym.h: genassym 1051.62Smycroft ./genassym >assym.h 1061.1Scgd 1071.62Smycroftgenassym: genassym.o 1081.62Smycroft ${CC} -o $@ genassym.o 1091.42Smycroft 1101.62Smycroftgenassym.o: ${I386}/i386/genassym.c 1111.69Smycroft ${HOSTED_C_C} 1121.1Scgd 1131.62Smycroftparam.c: $S/conf/param.c 1141.62Smycroft rm -f param.c 1151.62Smycroft cp $S/conf/param.c . 1161.1Scgd 1171.62Smycroftparam.o: param.c Makefile 1181.62Smycroft ${NORMAL_C_C} 1191.1Scgd 1201.62Smycroftioconf.o: ioconf.c 1211.62Smycroft ${NORMAL_C} 1221.42Smycroft 1231.62Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1241.62Smycroft sh $S/conf/newvers.sh 1251.62Smycroft ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 1261.1Scgd 1271.1Scgd 1281.62Smycroftclean:: 1291.66Scgd rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 1301.62Smycroft [Ee]rrs linterrs makelinks genassym genassym.o assym.h 1311.1Scgd 1321.62Smycroftlint: 1331.62Smycroft @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \ 1341.62Smycroft ${I386}/i386/Locore.c ${CFILES} ${I386}/i386/swapgeneric.c \ 1351.62Smycroft ioconf.c param.c | \ 1361.62Smycroft grep -v 'static function .* unused' 1371.1Scgd 1381.62Smycrofttags: 1391.62Smycroft @echo "see $S/kern/Makefile for tags" 1401.1Scgd 1411.1Scgdlinks: 1421.1Scgd egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1431.1Scgd sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1441.1Scgd echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1451.1Scgd sort -u | comm -23 - dontlink | \ 1461.62Smycroft sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 1471.1Scgd sh makelinks && rm -f dontlink 1481.1Scgd 1491.62SmycroftSRCS= ${I386}/i386/locore.s \ 1501.66Scgd param.c ioconf.c ${CFILES} ${SFILES} 1511.67Smycroftdepend:: .depend 1521.66Scgd.depend: ${SRCS} assym.h param.c 1531.68Smycroft ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s 1541.68Smycroft ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 1551.68Smycroft ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 1561.68Smycroft ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} ${PARAM} ${I386}/i386/genassym.c 1571.62Smycroft 1581.62Smycroft 1591.62Smycroft# depend on root or device configuration 1601.62Smycroftautoconf.o conf.o: Makefile 1611.62Smycroft 1621.62Smycroft# depend on network or filesystem configuration 1631.62Smycroftuipc_proto.o vfs_conf.o: Makefile 1641.1Scgd 1651.62Smycroft# depend on maxusers 1661.62Smycroftgenassym.o machdep.o: Makefile 1671.1Scgd 1681.62Smycroft# depend on CPU configuration 1691.62Smycroftlocore.o machdep.o: Makefile 1701.1Scgd 1711.2Scgd 1721.62Smycroftlocore.o: ${I386}/i386/locore.s assym.h 1731.62Smycroft ${NORMAL_S} 1741.1Scgd 1751.1Scgd%RULES 1761.59Smycroft 1771.59Smycroft### add microcode dependencies 1781.59Smycroft.include "$S/dev/microcode/Makefile.inc" 179