Makefile.alpha revision 1.43
1# $NetBSD: Makefile.alpha,v 1.43 1998/05/31 23:25:41 thorpej 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/alpha/conf/``machineid'' 9# after which you should do 10# config machineid 11# Machine generic makefile changes should be made in 12# /sys/arch/alpha/conf/Makefile.alpha 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 24AR?= ar 25AS?= as 26CC?= cc 27CPP?= cpp 28LD?= ld 29LORDER?=lorder 30MKDEP?= mkdep 31NM?= nm 32RANLIB?=ranlib 33SIZE?= size 34STRIP?= strip 35TSORT?= tsort -q 36 37# source tree is located via $S relative to the compilation directory 38.ifndef S 39S!= cd ../../../..; pwd 40.endif 41ALPHA= $S/arch/alpha 42 43HAVE_GCC28!= ${CC} --version | egrep "^(2\.8|egcs)" ; echo 44INCLUDES= -I. -I$S/arch -I$S -nostdinc 45CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \ 46 -Dalpha 47COPTS?= -O2 48CWARNFLAGS?= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ 49 -Wno-format 50.if (${HAVE_GCC28} != "") 51CWARNFLAGS+= -Wno-main 52.endif 53CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -mno-fp-regs 54AFLAGS= -traditional -D_LOCORE 55LOADADDRESS?= fffffc0000300000 56LINKFLAGS= -N -Ttext ${LOADADDRESS} -e __transfer -G 4 57STRIPFLAGS= -g -X -x 58 59### find out what to use for libkern 60.include "$S/lib/libkern/Makefile.inc" 61.ifndef PROF 62LIBKERN= ${KERNLIB} 63.else 64LIBKERN= ${KERNLIB_PROF} 65.endif 66 67### find out what to use for libcompat 68.include "$S/compat/common/Makefile.inc" 69.ifndef PROF 70LIBCOMPAT= ${COMPATLIB} 71.else 72LIBCOMPAT= ${COMPATLIB_PROF} 73.endif 74 75# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 76# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 77 78NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 79NOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< 80NORMAL_S= ${CPP} ${AFLAGS} ${CPPFLAGS} $< | sed -e 's,^\#.*,,' | ${AS} -o ${.TARGET} 81 82%OBJS 83 84%CFILES 85 86%SFILES 87 88# load lines for config "xxx" will be emitted as: 89# xxx: ${SYSTEM_DEP} swapxxx.o 90# ${SYSTEM_LD_HEAD} 91# ${SYSTEM_LD} swapxxx.o 92# ${SYSTEM_LD_TAIL} 93SYSTEM_OBJ= locore.o transfer.o \ 94 param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT} 95SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 96SYSTEM_LD_HEAD= @rm -f $@ 97SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 98 ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 99SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 100 101DEBUG?= 102.if ${DEBUG} == "-g" 103LINKFLAGS+= -X 104SYSTEM_LD_TAIL+=; \ 105 echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 106 echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@ 107.else 108LINKFLAGS+= -S 109.endif 110 111%LOAD 112 113# Use awk to cross-build assym.h from the genassym.s file. 114assym.h: genassym.o $S/kern/genassym.awk 115 awk -f $S/kern/genassym.awk < genassym.s > $@ 116 117# The above rule lists genassym.o as a prerequisite so that the 118# generated .depend rule is effective, even though we actually 119# use genassym.s instead. This always creates both. 120genassym.o: ${ALPHA}/alpha/genassym.c 121 ${CC} ${CPPFLAGS} -S $< 122 ${CC} -c $*.s 123 124param.c: $S/conf/param.c 125 rm -f param.c 126 cp $S/conf/param.c . 127 128param.o: param.c Makefile 129 ${NORMAL_C} 130 131ioconf.o: ioconf.c 132 ${NORMAL_C} 133 134newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 135 sh $S/conf/newvers.sh 136 ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 137 138 139__CLEANKERNEL: .USE 140 @echo "${.TARGET}ing the kernel objects" 141 rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 142 [Ee]rrs linterrs makelinks assym.h.tmp assym.h 143 144__CLEANDEPEND: .USE 145 rm -f .depend 146 147clean: __CLEANKERNEL 148 149cleandir: __CLEANKERNEL __CLEANDEPEND 150 151lint: 152 @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 153 ${ALPHA}/alpha/Locore.c ${CFILES} \ 154 ioconf.c param.c | \ 155 grep -v 'static function .* unused' 156 157tags: 158 @echo "see $S/kern/Makefile for tags" 159 160links: 161 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 162 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 163 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 164 sort -u | comm -23 - dontlink | \ 165 sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 166 sh makelinks && rm -f dontlink 167 168SRCS= ${ALPHA}/alpha/locore.s ${ALPHA}/alpha/transfer.s \ 169 param.c ioconf.c ${CFILES} ${SFILES} 170depend: .depend 171.depend: ${SRCS} assym.h param.c 172 ${MKDEP} -x assembler-with-cpp ${AFLAGS} ${CPPFLAGS} \ 173 ${ALPHA}/alpha/locore.s 174 ${MKDEP} -x assembler-with-cpp ${AFLAGS} ${CPPFLAGS} \ 175 ${ALPHA}/alpha/transfer.s 176 ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 177 ${MKDEP} -a -x assembler-with-cpp ${AFLAGS} ${CPPFLAGS} ${SFILES} 178 ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} ${ALPHA}/alpha/genassym.c 179 180 181# depend on root or device configuration 182autoconf.o conf.o: Makefile 183 184# depend on network or filesystem configuration 185uipc_proto.o vfs_conf.o: Makefile 186 187# depend on maxusers 188genassym.o machdep.o: Makefile 189 190# depend on CPU configuration 191clock.o machdep.o apecs.o cia.o lca.o ioasic.o scc.o icasic.o: Makefile 192 193locore.o: ${ALPHA}/alpha/locore.s assym.h 194 ${NORMAL_S} 195 196transfer.o: ${ALPHA}/alpha/transfer.s 197 ${NORMAL_S} 198 199%RULES 200