1 # $NetBSD: Makefile.cesfic,v 1.5 2001/10/26 06:45:36 jmc 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/hp300/conf/``machineid'' 9 # after which you should do 10 # config machineid 11 # Machine generic makefile changes should be made in 12 # /sys/arch/hp300/conf/Makefile.hp300 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 19 MACHINE_ARCH=m68k 20 USETOOLS?= no 21 22 .include <bsd.own.mk> 23 24 # DEBUG is set to -g if debugging. 25 # PROF is set to -pg if profiling. 26 27 CC?= cc 28 LD?= ld 29 MKDEP?= mkdep 30 STRIP?= strip 31 SIZE?= size 32 COPTS?= -O2 33 34 # source tree is located via $S relative to the compilation directory 35 .ifndef S 36 S!= cd ../../../..; pwd 37 .endif 38 CESFIC= $S/arch/cesfic 39 40 HAVE_GCC28!= ${CC} --version | egrep "^(2\.8|egcs)" ; echo 41 INCLUDES= -I. -I$S/arch -I$S -nostdinc 42 CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT 43 CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-format 44 .if (${HAVE_GCC28} != "") 45 CWARNFLAGS+= -Wno-main 46 .endif 47 CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -msoft-float 48 AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -Wa,-m68030 -Wa,-m68851 -Wa,-m68040 49 LINKFLAGS= -n -Ttext 2000 -e start 50 STRIPFLAGS?= -d 51 52 HOSTED_CC= ${CC} 53 HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} 54 HOSTED_CFLAGS= ${CFLAGS} 55 56 ### find out what to use for libkern 57 KERN_AS= obj 58 .include "$S/lib/libkern/Makefile.inc" 59 .ifndef PROF 60 LIBKERN= ${KERNLIB} 61 .else 62 LIBKERN= ${KERNLIB_PROF} 63 .endif 64 65 ### find out what to use for libcompat 66 .include "$S/compat/common/Makefile.inc" 67 .ifndef PROF 68 LIBCOMPAT= ${COMPATLIB} 69 .else 70 LIBCOMPAT= ${COMPATLIB_PROF} 71 .endif 72 73 ### for the Motorola 68040 Floating Point Software Product 74 .include "$S/arch/m68k/fpsp/Makefile.inc" 75 76 # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 77 # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 78 79 NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 80 NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 81 82 HOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< 83 84 %OBJS 85 86 %CFILES 87 88 #%SFILES 89 90 # load lines for config "xxx" will be emitted as: 91 # xxx: ${SYSTEM_DEP} swapxxx.o 92 # ${SYSTEM_LD_HEAD} 93 # ${SYSTEM_LD} swapxxx.o 94 # ${SYSTEM_LD_TAIL} 95 SYSTEM_OBJ= locore.o ${FPSP} \ 96 param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN} 97 SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 98 SYSTEM_LD_HEAD= @rm -f $@ 99 SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 100 ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 101 SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 102 103 DEBUG?= 104 .if ${DEBUG} == "-g" 105 LINKFLAGS+= -X 106 SYSTEM_LD_TAIL+=; \ 107 echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 108 echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@ 109 .else 110 LINKFLAGS+= -S 111 .endif 112 113 %LOAD 114 115 assym.h: $S/kern/genassym.sh ${CESFIC}/cesfic/genassym.cf 116 sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 117 < ${CESFIC}/cesfic/genassym.cf > assym.h.tmp && \ 118 mv -f assym.h.tmp assym.h 119 120 param.c: $S/conf/param.c 121 rm -f param.c 122 cp $S/conf/param.c . 123 124 param.o: param.c Makefile 125 ${NORMAL_C} 126 127 ioconf.o: ioconf.c 128 ${NORMAL_C} 129 130 newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 131 sh $S/conf/newvers.sh 132 ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 133 134 clean: cleankernel 135 cleankernel: 136 rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 137 [Ee]rrs linterrs makelinks assym.h.tmp assym.h 138 139 lint: 140 @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 141 ioconf.c param.c | \ 142 grep -v 'static function .* unused' 143 144 tags: 145 @echo "see $S/kern/Makefile for tags" 146 147 links: 148 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 149 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 150 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 151 sort -u | comm -23 - dontlink | \ 152 sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 153 sh makelinks && rm -f dontlink 154 155 SRCS= ${CESFIC}/cesfic/locore.s \ 156 param.c ioconf.c ${CFILES} ${SFILES} 157 depend: .depend 158 .depend: ${SRCS} assym.h param.c 159 ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${CESFIC}/cesfic/locore.s 160 ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 161 -if test -n "${SFILES}"; then \ 162 ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}; \ 163 fi 164 165 166 # depend on root or device configuration 167 autoconf.o conf.o: Makefile 168 169 # depend on network or filesystem configuration 170 uipc_proto.o vfs_conf.o: Makefile 171 172 # depend on maxusers 173 machdep.o: Makefile 174 175 # depend on CPU configuration 176 dma.o hpux_machdep.o locore.o machdep.o pmap.o pmap_boostrap.o sys_machdep.o trap.o: Makefile 177 178 179 locore.o: ${CESFIC}/cesfic/locore.s assym.h 180 ${NORMAL_S} 181 182 %RULES 183