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