Makefile.i386 revision 1.56
11.56Schristos# $NetBSD: Makefile.i386,v 1.56 1995/06/24 20:39:42 christos Exp $ 21.46Scgd# @(#)Makefile.hp300 8.2 (Berkeley) 1/23/94 31.9Scgd# 41.8Scgd# Makefile for NetBSD 51.1Scgd# 61.1Scgd# This makefile is constructed from a machine description: 71.1Scgd# config machineid 81.1Scgd# Most changes should be made in the machine description 91.36Sderaadt# /sys/arch/i386/conf/``machineid'' 101.1Scgd# after which you should do 111.1Scgd# config machineid 121.1Scgd# Generic makefile changes should be made in 131.36Sderaadt# /sys/arch/i386/conf/Makefile.i386 141.42Smycroft# after which config should be rerun for all machines of that type. 151.1Scgd# 161.42Smycroft# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 171.1Scgd# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 181.1Scgd# 191.1Scgd# -DTRACE compile in kernel tracing hooks 201.1Scgd# -DQUOTA compile in file system quotas 211.1Scgd# 221.42Smycroft 231.42Smycroft# DEBUG is set to -g by config if debugging is requested (config -g). 241.42Smycroft# PROF is set to -pg by config if profiling is requested (config -p). 251.53ScgdAS?= as 261.53ScgdAS+= ${DEBUG} 271.53ScgdCC?= cc 281.53ScgdCC+= ${DEBUG} 291.53ScgdCPP?= cpp 301.53ScgdLD?= ld 311.53ScgdTOUCH?= touch -f -c 321.53ScgdAWK?= awk 331.1Scgd 341.42Smycroft# source tree is located via $S relative to the compilation directory 351.11ScgdS= ../../../.. 361.11ScgdI386= ../.. 371.1Scgd 381.11ScgdINCLUDES= -I. -I$S/arch -I$S -I$S/sys 391.55SjtcCOPTS= ${INCLUDES} ${IDENT} -D_KERNEL -Di386 401.42SmycroftCFLAGS= -O6 ${COPTS} 411.39SmycroftLOAD_ADDRESS= F8100000 421.1Scgd 431.33Scgd### find out what to use for libkern 441.33Scgd.include "$S/lib/libkern/Makefile.inc" 451.33Scgd.ifndef PROF 461.33ScgdLIBKERN= ${KERNLIB} 471.33Scgd.else 481.33ScgdLIBKERN= ${KERNLIB_PROF} 491.33Scgd.endif 501.33Scgd 511.56Schristos### find out what to use for libcompat 521.56Schristos.include "$S/compat/common/Makefile.inc" 531.56Schristos.ifndef PROF 541.56SchristosLIBCOMPAT= ${COMPATLIB} 551.56Schristos.else 561.56SchristosLIBCOMPAT= ${COMPATLIB_PROF} 571.56Schristos.endif 581.56Schristos 591.42Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} 601.53Scgd# where TYPE is NORMAL, DRIVER, or PROFILE; SUFFIX is the file suffix, 611.42Smycroft# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file 621.42Smycroft# is marked as config-dependent. 631.42Smycroft 641.42SmycroftNORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 651.42SmycroftNORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 661.42Smycroft 671.42SmycroftDRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 681.42SmycroftDRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 691.1Scgd 701.2ScgdPROFILE_C= ${CC} -S -c ${CFLAGS} $< ; \ 711.42Smycroft sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \ 721.42Smycroft ${AS} -o $@; \ 731.2Scgd rm -f $*.s 741.2Scgd 751.42SmycroftNORMAL_S= ${CPP} -DLOCORE ${COPTS} $< | ${AS} -o $@ 761.42SmycroftNORMAL_S_C= ${CPP} -DLOCORE ${COPTS} ${PARAM} $< | ${AS} -o $@ 771.42Smycroft 781.1Scgd%OBJS 791.1Scgd 801.1Scgd%CFILES 811.1Scgd 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.56SchristosSYSTEM_OBJ= locore.o vnode_if.o ${OBJS} param.o ioconf.o ${LIBKERN} \ 881.56Schristos ${LIBCOMPAT} 891.42SmycroftSYSTEM_DEP= Makefile ${SYSTEM_OBJ} 901.42SmycroftSYSTEM_LD_HEAD= rm -f $@ 911.51SmycroftSYSTEM_LD= @if [ X${DEBUG} = X-g ]; then \ 921.51Smycroft strip=-X; \ 931.51Smycroft else \ 941.51Smycroft strip=-x; \ 951.42Smycroft fi; \ 961.42Smycroft echo ${LD} $$strip -z -T ${LOAD_ADDRESS} -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \ 971.42Smycroft ${LD} $$strip -z -T ${LOAD_ADDRESS} -o $@ -e start ${SYSTEM_OBJ} vers.o 981.42SmycroftSYSTEM_LD_TAIL= @size $@; chmod 755 $@; \ 991.51Smycroft if [ X${DEBUG} = X-g ]; then \ 1001.51Smycroft echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 1011.51Smycroft echo strip -d $@; strip -d $@; \ 1021.51Smycroft fi 1031.42Smycroft 1041.1Scgd%LOAD 1051.50Smycroft 1061.50Smycroftnewvers: vers.o 1071.1Scgd 1081.42Smycroftvers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1091.42Smycroft sh $S/conf/newvers.sh 1101.42Smycroft ${CC} ${CFLAGS} -c vers.c 1111.42Smycroft 1121.56Schristosclean:: 1131.47Smycroft rm -f eddep *netbsd netbsd.gdb tags vnode_if.[ch] *.o locore.i \ 1141.56Schristos [a-z]*.s [Ee]rrs linterrs makelinks genassym 1151.1Scgd 1161.1Scgdlint: /tmp param.c 1171.42Smycroft @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \ 1181.42Smycroft ${I386}/i386/Locore.c ${CFILES} ${I386}/i386/swapgeneric.c \ 1191.42Smycroft ioconf.c param.c | \ 1201.1Scgd grep -v 'struct/union .* never defined' | \ 1211.1Scgd grep -v 'possible pointer alignment problem' 1221.1Scgd 1231.42Smycroftlocore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h 1241.42Smycroftlocore.o: machine/pte.h ${I386}/isa/vector.s ${I386}/isa/icu.s 1251.42Smycroftlocore.o: $S/sys/errno.h machine/specialreg.h ${I386}/isa/debug.h 1261.54Scgdlocore.o: ${I386}/isa/icu.h $S/dev/isa/isareg.h $S/net/netisr.h 1271.42Smycroft ${CPP} -DLOCORE ${COPTS} ${I386}/i386/locore.s | ${AS} -o locore.o 1281.1Scgd 1291.1Scgd# the following is necessary because autoconf.o depends on #if GENERIC 1301.1Scgdautoconf.o: Makefile 1311.1Scgd 1321.42Smycroft# the following are necessary because the files depend on the types of 1331.42Smycroft# cpu's included in the system configuration 1341.42Smycroftlocore.o machdep.o: Makefile 1351.42Smycroft 1361.42Smycroft# depend on network or filesystem configuration 1371.42Smycroftuipc_proto.o vfs_conf.o locore.o: Makefile 1381.1Scgd 1391.1Scgd# depend on maxusers 1401.31Scgdassym.s: Makefile 1411.1Scgd 1421.1Scgd# depends on KDB (cons.o also depends on GENERIC) 1431.1Scgdtrap.o cons.o: Makefile 1441.1Scgd 1451.1Scgdassym.s: genassym 1461.1Scgd ./genassym >assym.s 1471.1Scgd 1481.32Scgdgenassym: ${I386}/i386/genassym.c 1491.42Smycroft ${CC} ${INCLUDES} ${IDENT} ${PARAM} -Di386 -o genassym \ 1501.42Smycroft ${I386}/i386/genassym.c 1511.1Scgd 1521.43Smycroftdepend: assym.s param.c vnode_if.h 1531.42Smycroft mkdep ${COPTS} ${CFILES} ioconf.c param.c 1541.42Smycroft mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${I386}/i386/genassym.c 1551.1Scgd 1561.1Scgdlinks: 1571.1Scgd egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1581.1Scgd sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1591.1Scgd echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1601.1Scgd sort -u | comm -23 - dontlink | \ 1611.1Scgd sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 1621.1Scgd sh makelinks && rm -f dontlink 1631.1Scgd 1641.1Scgdtags: 1651.1Scgd @echo "see $S/kern/Makefile for tags" 1661.1Scgd 1671.42Smycroftioconf.o: ioconf.c 1681.1Scgd ${CC} -c ${CFLAGS} ioconf.c 1691.1Scgd 1701.1Scgdparam.c: $S/conf/param.c 1711.42Smycroft rm -f param.c 1721.1Scgd cp $S/conf/param.c . 1731.1Scgd 1741.1Scgdparam.o: param.c Makefile 1751.1Scgd ${CC} -c ${CFLAGS} ${PARAM} param.c 1761.2Scgd 1771.45Smycroftvnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 1781.45Smycroft AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 1791.1Scgd 1801.1Scgd%RULES 181