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