Makefile.next68k revision 1.5
11.5Sdbj# $NetBSD: Makefile.next68k,v 1.5 1998/11/16 04:37:56 dbj Exp $ 21.1Sdbj 31.1Sdbj# Makefile for NetBSD 41.1Sdbj# 51.1Sdbj# This makefile is constructed from a machine description: 61.1Sdbj# config machineid 71.1Sdbj# Most changes should be made in the machine description 81.1Sdbj# /sys/arch/next68k/conf/``machineid'' 91.1Sdbj# after which you should do 101.1Sdbj# config machineid 111.1Sdbj# Machine generic makefile changes should be made in 121.1Sdbj# /sys/arch/next68k/conf/Makefile.next68k 131.1Sdbj# after which config should be rerun for all machines of that type. 141.1Sdbj# 151.1Sdbj# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 161.1Sdbj# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 171.1Sdbj# 181.1Sdbj# -DTRACE compile in kernel tracing hooks 191.1Sdbj# -DQUOTA compile in file system quotas 201.1Sdbj 211.1Sdbj# DEBUG is set to -g if debugging. 221.1Sdbj# PROF is set to -pg if profiling. 231.1Sdbj 241.1Sdbj# since we are cross compiling, these get set wrong 251.1Sdbj# if we don't put them here. 261.1SdbjMACHINE=next68k 271.1SdbjMACHINE_ARCH=m68k 281.1Sdbj 291.1SdbjAR?= ar 301.1SdbjAS?= as 311.1SdbjCC?= cc 321.1SdbjCPP?= cpp 331.1SdbjLD?= ld 341.1SdbjLORDER?=lorder 351.1SdbjMKDEP?= mkdep 361.1SdbjNM?= nm 371.1SdbjRANLIB?=ranlib 381.1SdbjSIZE?= size 391.1SdbjSTRIP?= strip 401.1SdbjTSORT?= tsort -q 411.1Sdbj 421.1SdbjDEBUG=-g 431.1SdbjCOPTS?= -O2 441.1Sdbj 451.1Sdbj# source tree is located via $S relative to the compilation directory 461.1Sdbj.ifndef S 471.1SdbjS!= cd ../../../..; pwd 481.1Sdbj.endif 491.1SdbjNEXT68K= $S/arch/next68k 501.1Sdbj 511.5SdbjHAVE_GCC28!= ${CC} --version | egrep "^(2\.8|egcs)" ; echo 521.1SdbjINCLUDES= -I. -I$S/arch -I$S -nostdinc 531.1SdbjCPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \ 541.1Sdbj -undef -Dmc68020 -Dnext68k -D__NetBSD__ 551.1Sdbj# -U__NeXT__ -UNeXT -U__NeXT -U_NEXT_SOURCE -U__MACH__ \ 561.1Sdbj# -DCROSS_COMPILE_NEXTSTEP 571.1SdbjCWARNFLAGS= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-format 581.5Sdbj.if (${HAVE_GCC28} != "") 591.5SdbjCWARNFLAGS+= -Wno-main 601.5Sdbj.endif 611.1SdbjCFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -msoft-float 621.1SdbjAFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 631.1SdbjLINKFLAGS= -n -Ttext 0 -e start 641.1Sdbj#LINKFLAGS= -seg1addr 0x4000000 651.2SdbjSTRIPFLAGS?= -d 661.1Sdbj# -S is used in gnu strip, rather than -d: 671.1Sdbj#STRIPFLAGS= -S 681.1Sdbj 691.1Sdbj### Find out what to use for libkern. 701.4SdrochnerKERN_AS= obj 711.1Sdbj.include "$S/lib/libkern/Makefile.inc" 721.1Sdbj.ifndef PROF 731.1SdbjLIBKERN=${KERNLIB} 741.1Sdbj.else 751.1SdbjLIBKERN=${KERNLIB_PROF} 761.1Sdbj.endif 771.1Sdbj 781.1Sdbj### Find out what to use for libcompat. 791.1Sdbj.include "$S/compat/common/Makefile.inc" 801.1Sdbj.ifndef PROF 811.1SdbjLIBCOMPAT=${COMPATLIB} 821.1Sdbj.else 831.1SdbjLIBCOMPAT=${COMPATLIB_PROF} 841.1Sdbj.endif 851.1Sdbj 861.1Sdbj### for the Motorola 68040 Floating Point Software Product 871.1Sdbj.include "$S/arch/m68k/fpsp/Makefile.inc" 881.1Sdbj 891.1Sdbj# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 901.1Sdbj# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 911.1Sdbj 921.1SdbjNORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 931.1SdbjNORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 941.1Sdbj#NORMAL_S= ${CPP} ${AFLAGS} ${CPPFLAGS} $< | sed -e 's/^\#.*//' | ${AS} -o ${.TARGET} 951.1Sdbj 961.1Sdbj%OBJS 971.1Sdbj 981.1Sdbj%CFILES 991.1Sdbj 1001.1Sdbj%SFILES 1011.1Sdbj 1021.1Sdbj# load lines for config "xxx" will be emitted as: 1031.1Sdbj# xxx: ${SYSTEM_DEP} swapxxx.o 1041.1Sdbj# ${SYSTEM_LD_HEAD} 1051.1Sdbj# ${SYSTEM_LD} swapxxx.o 1061.1Sdbj# ${SYSTEM_LD_TAIL} 1071.1SdbjSYSTEM_OBJ= locore.o ${FPSP} \ 1081.4Sdrochner param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN} 1091.1SdbjSYSTEM_DEP= Makefile ${SYSTEM_OBJ} 1101.1SdbjSYSTEM_LD_HEAD= @rm -f $@ 1111.1SdbjSYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 1121.1Sdbj ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 1131.1SdbjSYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 1141.1Sdbj 1151.1SdbjDEBUG?= 1161.1Sdbj.if ${DEBUG} == "-g" 1171.1SdbjLINKFLAGS+= -X 1181.1SdbjSYSTEM_LD_TAIL+=; \ 1191.1Sdbj echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 1201.1Sdbj echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@ 1211.1Sdbj.else 1221.1SdbjLINKFLAGS+= -S 1231.1Sdbj.endif 1241.1Sdbj 1251.1Sdbj%LOAD 1261.1Sdbj 1271.1Sdbjassym.h: $S/kern/genassym.sh ${NEXT68K}/next68k/genassym.cf 1281.1Sdbj sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 1291.1Sdbj < ${NEXT68K}/next68k/genassym.cf > assym.h.tmp && \ 1301.1Sdbj mv -f assym.h.tmp assym.h 1311.1Sdbj 1321.1Sdbjparam.c: $S/conf/param.c 1331.1Sdbj rm -f param.c 1341.1Sdbj cp $S/conf/param.c . 1351.1Sdbj 1361.1Sdbjparam.o: param.c Makefile 1371.1Sdbj ${NORMAL_C} 1381.1Sdbj 1391.1Sdbjioconf.o: ioconf.c 1401.1Sdbj ${NORMAL_C} 1411.1Sdbj 1421.1Sdbjnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1431.1Sdbj sh $S/conf/newvers.sh 1441.1Sdbj ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 1451.1Sdbj 1461.1Sdbj__CLEANKERNEL: .USE 1471.1Sdbj @echo "${.TARGET}ing the kernel objects" 1481.1Sdbj rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 1491.1Sdbj [Ee]rrs linterrs makelinks assym.h.tmp assym.h 1501.1Sdbj 1511.1Sdbj__CLEANDEPEND: .USE 1521.1Sdbj rm -f .depend 1531.1Sdbj 1541.1Sdbjclean: __CLEANKERNEL 1551.1Sdbj 1561.3Slukemcleandir distclean: __CLEANKERNEL __CLEANDEPEND 1571.1Sdbj 1581.1Sdbjlint: 1591.1Sdbj @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 1601.1Sdbj ${CFILES} ioconf.c param.c | \ 1611.1Sdbj grep -v 'static function .* unused' 1621.1Sdbj 1631.1Sdbjtags: 1641.1Sdbj @echo "see $S/kern/Makefile for tags" 1651.1Sdbj 1661.1Sdbjlinks: 1671.1Sdbj egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1681.1Sdbj sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1691.1Sdbj echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1701.1Sdbj sort -u | comm -23 - dontlink | \ 1711.1Sdbj sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 1721.1Sdbj sh makelinks && rm -f dontlink 1731.1Sdbj 1741.1SdbjSRCS= ${NEXT68K}/next68k/locore.s \ 1751.1Sdbj param.c ioconf.c ${CFILES} ${SFILES} 1761.1Sdbjdepend: .depend 1771.1Sdbj.depend: ${SRCS} assym.h param.c 1781.1Sdbj ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${NEXT68K}/next68k/locore.s 1791.1Sdbj ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 1801.1Sdbj ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 1811.1Sdbj sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 1821.1Sdbj ${CPPFLAGS} < ${NEXT68K}/next68k/genassym.cf 1831.1Sdbj @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 1841.1Sdbj @rm -f assym.dep 1851.1Sdbj 1861.1Sdbj 1871.1Sdbj# depend on root or device configuration 1881.1Sdbjautoconf.o conf.o: Makefile 1891.1Sdbj 1901.1Sdbj# depend on network or filesystem configuration 1911.1Sdbjuipc_proto.o vfs_conf.o: Makefile 1921.1Sdbj 1931.1Sdbj# depend on maxusers 1941.1Sdbjgenassym.o machdep.o: Makefile 1951.1Sdbj 1961.1Sdbj# depend on CPU configuration 1971.1Sdbjlocore.o pmap.o trap.o: Makefile 1981.1Sdbj 1991.1Sdbj 2001.1Sdbjlocore.o: ${NEXT68K}/next68k/locore.s assym.h 2011.1Sdbj ${NORMAL_S} 2021.1Sdbj 2031.1Sdbj%RULES 204