1 # $NetBSD: Makefile.mvme68k,v 1.27 1997/09/12 07:55:19 mycroft Exp $ 2 3 # Makefile for NetBSD 4 # 5 # This makefile is constructed from a machine description: 6 # config machineid 7 # Most changes should be made in the machine description 8 # /sys/arch/mvme68k/conf/``machineid'' 9 # after which you should do 10 # config machineid 11 # Machine generic makefile changes should be made in 12 # /sys/arch/mvme68k/conf/Makefile.mvme68k 13 # after which config should be rerun for all machines of that type. 14 # 15 # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 16 # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 17 # 18 # -DTRACE compile in kernel tracing hooks 19 # -DQUOTA compile in file system quotas 20 21 # DEBUG is set to -g if debugging. 22 # PROF is set to -pg if profiling. 23 24 CC?= cc 25 LD?= ld 26 MKDEP?= mkdep 27 STRIP?= strip 28 COPTS?= -O2 29 30 # source tree is located via $S relative to the compilation directory 31 .ifndef S 32 S!= cd ../../../..; pwd 33 .endif 34 MVME68K=$S/arch/mvme68k 35 36 # Override CPP defaults entirely, so cross-compilation works. 37 # Keep -nostdinc before all -I flags, similar for -undef ... 38 INCLUDES= -nostdinc -I. -I$S/arch -I$S 39 CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \ 40 -Dmc68020 -Dmvme68k -DFPCOPROC 41 CWARNFLAGS= -Werror 42 CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -msoft-float 43 AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 44 LINKFLAGS= -n -Ttext 8000 -e start 45 STRIPFLAGS= -d 46 47 HOSTED_CC= ${CC} 48 HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} 49 HOSTED_CFLAGS= ${CFLAGS} 50 51 ### find out what to use for libkern 52 .include "$S/lib/libkern/Makefile.inc" 53 .ifndef PROF 54 LIBKERN= ${KERNLIB} 55 .else 56 LIBKERN= ${KERNLIB_PROF} 57 .endif 58 59 ### find out what to use for libcompat 60 .include "$S/compat/common/Makefile.inc" 61 .ifndef PROF 62 LIBCOMPAT= ${COMPATLIB} 63 .else 64 LIBCOMPAT= ${COMPATLIB_PROF} 65 .endif 66 67 ### for the Motorola 68040 Floating Point Software Product 68 .include "$S/arch/m68k/fpsp/Makefile.inc" 69 70 # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 71 # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 72 73 NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 74 NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 75 76 HOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< 77 78 %OBJS 79 80 %CFILES 81 82 %SFILES 83 84 # load lines for config "xxx" will be emitted as: 85 # xxx: ${SYSTEM_DEP} swapxxx.o 86 # ${SYSTEM_LD_HEAD} 87 # ${SYSTEM_LD} swapxxx.o 88 # ${SYSTEM_LD_TAIL} 89 SYSTEM_OBJ= locore.o ${FPSP} \ 90 param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT} 91 SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 92 SYSTEM_LD_HEAD= @rm -f $@ 93 SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 94 ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 95 SYSTEM_LD_TAIL= @size $@; chmod 755 $@ 96 97 DEBUG?= 98 .if ${DEBUG} == "-g" 99 LINKFLAGS+= -X 100 SYSTEM_LD_TAIL+=; \ 101 echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 102 echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@ 103 .else 104 LINKFLAGS+= -S 105 .endif 106 107 %LOAD 108 109 assym.h: $S/kern/genassym.sh ${MVME68K}/mvme68k/genassym.cf 110 sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 111 < ${MVME68K}/mvme68k/genassym.cf > assym.h.tmp && \ 112 mv -f assym.h.tmp assym.h 113 114 param.c: $S/conf/param.c 115 rm -f param.c 116 cp $S/conf/param.c . 117 118 param.o: param.c Makefile 119 ${NORMAL_C} 120 121 ioconf.o: ioconf.c 122 ${NORMAL_C} 123 124 newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 125 sh $S/conf/newvers.sh 126 ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 127 128 129 clean: cleankernel 130 cleankernel: 131 rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 132 [Ee]rrs linterrs makelinks assym.h.tmp assym.h 133 134 lint: 135 @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 136 ${CFILES} ioconf.c param.c | \ 137 grep -v 'static function .* unused' 138 139 tags: 140 @echo "see $S/kern/Makefile for tags" 141 142 links: 143 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 144 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 145 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 146 sort -u | comm -23 - dontlink | \ 147 sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 148 sh makelinks && rm -f dontlink 149 150 SRCS= ${MVME68K}/mvme68k/locore.s \ 151 param.c ioconf.c ${CFILES} ${SFILES} 152 depend: .depend 153 .depend: ${SRCS} assym.h param.c 154 ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MVME68K}/mvme68k/locore.s 155 ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 156 -if test -n "${SFILES}"; then \ 157 ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}; \ 158 fi 159 sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 160 ${CPPFLAGS} < ${MVME68K}/mvme68k/genassym.cf 161 @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 162 @rm -f assym.dep 163 164 165 # depend on root or device configuration 166 autoconf.o conf.o: Makefile 167 168 # depend on network or filesystem configuration 169 uipc_proto.o vfs_conf.o: Makefile 170 171 # depend on maxusers 172 machdep.o: Makefile 173 174 # depend on CPU configuration 175 locore.o pmap.o sys_machdep.o trap.o: Makefile 176 177 178 locore.o: ${MVME68K}/mvme68k/locore.s assym.h 179 ${NORMAL_S} 180 181 %RULES 182