1 # $NetBSD: Makefile.atari,v 1.4 1995/06/24 20:42:10 christos Exp $ 2 # 3 # Makefile for NetBSD Atari-TT 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/conf/``machineid'' 9 # after which you should do 10 # config machineid 11 # Machine generic makefile changes should be made in 12 # /sys/conf/Makefile.``machinetype'' 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 22 # DEBUG is set to -g by config if debugging is requested (config -g). 23 # PROF is set to -pg by config if profiling is requested (config -p). 24 AS= as ${DEBUG} 25 CC= cc ${DEBUG} 26 CPP= cpp 27 LD= ld 28 TOUCH= touch -f -c 29 30 # source tree is located via $S relative to the compilation directory 31 S= ../../../.. 32 ATARI= ../.. 33 34 INCLUDES= -I. -I$S/arch -I$S -I$S/sys 35 COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -Dmc68020 -Datari 36 CFLAGS= -O -mc68020 -m68881 ${COPTS} 37 38 ### find out what to use for libkern 39 .include "$S/lib/libkern/Makefile.inc" 40 .ifndef PROF 41 LIBKERN= ${KERNLIB} 42 .else 43 LIBKERN= ${KERNLIB_PROF} 44 .endif 45 46 ### find out what to use for libcompat 47 .include "$S/compat/common/Makefile.inc" 48 .ifndef PROF 49 LIBCOMPAT= ${COMPATLIB} 50 .else 51 LIBCOMPAT= ${COMPATLIB_PROF} 52 .endif 53 54 ### for the Motorola 68040 Floating Point Software Product 55 .include "$S/arch/m68k/fpsp/Makefile.inc" 56 57 # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} 58 # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, 59 # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file 60 # is marked as config-dependent. 61 62 NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 63 NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 64 65 DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 66 DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 67 68 PROFILE_C= ${CC} -S -c ${COPTS} $<; \ 69 sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \ 70 ${AS} -o $@; \ 71 rm -f $*.s 72 73 NORMAL_S= ${CPP} ${COPTS} $< | ${AS} -o $@ 74 NORMAL_S_C= ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@ 75 76 %OBJS 77 78 %CFILES 79 80 # load lines for config "xxx" will be emitted as: 81 # xxx: ${SYSTEM_DEP} swapxxx.o 82 # ${SYSTEM_LD_HEAD} 83 # ${SYSTEM_LD} swapxxx.o 84 # ${SYSTEM_LD_TAIL} 85 SYSTEM_OBJ= locore.o ${FPSP} vnode_if.o ${OBJS} param.o ioconf.o \ 86 ${LIBKERN} ${LIBCOMPAT} 87 SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 88 SYSTEM_LD_HEAD= rm -f $@ 89 SYSTEM_LD= -@if [ X${DEBUG} = X-g ]; \ 90 then strip=-X; \ 91 else strip=-x; \ 92 fi; \ 93 echo ${LD} $$strip -n -T 0 -o $@ -e start '$${SYSTEM_OBJ}' vers.o; \ 94 ${LD} $$strip -n -T 0 -o $@ -e start ${SYSTEM_OBJ} vers.o 95 SYSTEM_LD_TAIL= @size $@; chmod 755 $@; \ 96 [ X${DEBUG} = X-g ] && { \ 97 echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 98 echo strip -d $@; strip -d $@; } || true 99 100 %LOAD 101 102 vers.o: newvers 103 104 newvers: 105 sh $S/conf/newvers.sh ${KERN_IDENT} 106 ${CC} $(CFLAGS) -c vers.c 107 108 clean:: 109 rm -f eddep *netbsd netbsd.gdb tags *.o locore.i [a-z]*.s \ 110 Errs errs linterrs makelinks genassym 111 112 lint: /tmp param.c 113 @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \ 114 ${ATARI}/atari/Locore.c ${CFILES} ${ATARI}/atari/swapgeneric.c \ 115 ioconf.c param.c| \ 116 grep -v 'struct/union .* never defined' | \ 117 grep -v 'possible pointer alignment problem' 118 119 locore.o: assym.s ${ATARI}/atari/vectors.s ${ATARI}/atari/locore.s 120 locore.o: machine/trap.h machine/psl.h machine/pte.h machine/cpu.h 121 ${CPP} -DLOCORE ${COPTS} ${ATARI}/atari/locore.s | ${AS} -o locore.o 122 123 # the following is necessary because autoconf.o depends on #if GENERIC 124 autoconf.o: Makefile 125 126 # the following are necessary because the files depend on the types of 127 # hp cpu's included in the system configuration 128 machdep.o sys_machdep.o pmap.o pmap_bootstrap.o trap.o dma.o: Makefile 129 130 # depend on network or filesystem configuration 131 uipc_proto.o vfs_conf.o locore.o: Makefile 132 133 # depend on maxusers 134 assym.s: Makefile 135 136 assym.s: genassym 137 ./genassym >assym.s 138 139 genassym: 140 ${CC} -static ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Datari \ 141 -o genassym ${ATARI}/atari/genassym.c 142 143 depend: assym.s param.c vnode_if.h 144 mkdep ${COPTS} ${CFILES} ioconf.c param.c 145 mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${ATARI}/atari/genassym.c 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 tags: 156 @echo "see $S/kern/Makefile for tags" 157 158 ioconf.o: ioconf.c 159 ${CC} -c ${CFLAGS} ioconf.c 160 161 param.c: $S/conf/param.c 162 rm -f param.c 163 cp $S/conf/param.c . 164 165 param.o: param.c Makefile 166 ${CC} -c ${CFLAGS} ${PARAM} param.c 167 vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 168 AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 169 170 %RULES 171