Annotation of src/sys/arch/hpcarm/conf/Makefile.hpcarm, Revision 1.1.4.2
1.1.4.2 ! bouyer 1: # $NetBSD: Makefile.hpcarm,v 1.1.4.1 2001/03/12 13:28:19 bouyer 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/hpcarm/conf/``machineid''
! 9: # after which you should do
! 10: # config machineid
! 11: # Machine generic makefile changes should be made in
! 12: # /sys/arch/hpcarm/conf/Makefile.hpcarm
! 13: # after which config should be rerun for all machines of that type.
! 14:
! 15: # DEBUG is set to -g if debugging.
! 16: # PROF is set to -pg if profiling.
! 17:
! 18: AR?= ar
! 19: AS?= as
! 20: CC?= cc
! 21: CPP?= cpp
! 22: LD?= ld
! 23: LORDER?=lorder
! 24: MKDEP?= mkdep
! 25: NM?= nm
! 26: RANLIB?=ranlib
! 27: SIZE?= size
! 28: STRIP?= strip
! 29: TSORT?= tsort -q
! 30:
! 31: COPTS?= -O2
! 32:
! 33: # source tree is located via $S relative to the compilation directory
! 34: .ifndef S
! 35: S!= cd ../../../..; pwd
! 36: .endif
! 37: HPCARM= $S/arch/hpcarm
! 38:
! 39: HAVE_EGCS!= ${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
! 40: INCLUDES= -I. -I$S/arch -I$S -nostdinc
! 41: CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Dhpcarm -Darm32
! 42: CWARNFLAGS?= -Werror -Wall -Wcomment -Wpointer-arith
! 43: # XXX Delete -Wuninitialized for now, since the compiler doesn't
! 44: # XXX always get it right. --thorpej
! 45: CWARNFLAGS+= -Wno-uninitialized
! 46: .if (${HAVE_EGCS} != "")
! 47: CWARNFLAGS+= -Wno-main
! 48: .endif
! 49: CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS}
! 50: AFLAGS= -x assembler-with-cpp -D_LOCORE
! 51: LINKFLAGS= -Ttext C0100000 -e start
! 52: STRIPFLAGS= -g
! 53:
! 54: %INCLUDES
! 55:
! 56: HOSTED_CC= ${CC}
! 57: HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
! 58: HOSTED_CFLAGS= ${CFLAGS}
! 59:
! 60: ### find out what to use for libkern
! 61: KERN_AS= obj
! 62: .include "$S/lib/libkern/Makefile.inc"
! 63: .ifndef PROF
! 64: LIBKERN= ${KERNLIB}
! 65: .else
! 66: LIBKERN= ${KERNLIB_PROF}
! 67: .endif
! 68:
! 69: ### find out what to use for libcompat
! 70: .include "$S/compat/common/Makefile.inc"
! 71: .ifndef PROF
! 72: LIBCOMPAT= ${COMPATLIB}
! 73: .else
! 74: LIBCOMPAT= ${COMPATLIB_PROF}
! 75: .endif
! 76:
! 77: # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
! 78: # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
! 79:
! 80: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
! 81: NOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
! 82: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
! 83:
! 84: HOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
! 85:
! 86: %OBJS
! 87:
! 88: %CFILES
! 89:
! 90: %SFILES
! 91:
! 92: # load lines for config "xxx" will be emitted as:
! 93: # xxx: ${SYSTEM_DEP} swapxxx.o
! 94: # ${SYSTEM_LD_HEAD}
! 95: # ${SYSTEM_LD} swapxxx.o
! 96: # ${SYSTEM_LD_TAIL}
! 97: SYSTEM_OBJ= locore.o \
! 98: param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
! 99: SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
! 100: SYSTEM_LD_HEAD= rm -f $@
! 101: SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
! 102: ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
! 103: SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
! 104:
! 105: DEBUG?=
! 106: .if ${DEBUG} == "-g"
! 107: LINKFLAGS+= -X
! 108: SYSTEM_LD_TAIL+=; \
! 109: echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
! 110: echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
! 111: ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
! 112: .else
! 113: #LINKFLAGS+= -S
! 114: LINKFLAGS+= -x
! 115: .endif
! 116:
! 117: %LOAD
! 118:
! 119: assym.h: $S/kern/genassym.sh ${HPCARM}/hpcarm/genassym.cf
! 120: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
! 121: < ${HPCARM}/hpcarm/genassym.cf > assym.h.tmp && \
! 122: mv -f assym.h.tmp assym.h
! 123:
! 124: param.c: $S/conf/param.c
! 125: rm -f param.c
! 126: cp $S/conf/param.c .
! 127:
! 128: param.o: param.c Makefile
! 129: ${NORMAL_C}
! 130:
! 131: ioconf.o: ioconf.c
! 132: ${NORMAL_C}
! 133:
! 134: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
! 135: sh $S/conf/newvers.sh
! 136: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
! 137:
! 138: __CLEANKERNEL: .USE
! 139: @echo "${.TARGET}ing the kernel objects"
! 140: rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
! 141: [Ee]rrs linterrs makelinks assym.h.tmp assym.h modedefs.c
! 142:
! 143: __CLEANDEPEND: .USE
! 144: rm -f .depend
! 145:
! 146: clean: __CLEANKERNEL
! 147:
! 148: cleandir distclean: __CLEANKERNEL __CLEANDEPEND
! 149:
! 150: lint:
! 151: @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
! 152: ${HPCARM}/hpcarm/Locore.c ${CFILES} \
! 153: ioconf.c param.c | \
! 154: grep -v 'static function .* unused'
! 155:
! 156: tags:
! 157: @echo "see $S/kern/Makefile for tags"
! 158:
! 159: links:
! 160: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
! 161: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
! 162: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
! 163: sort -u | comm -23 - dontlink | \
! 164: sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
! 165: sh makelinks && rm -f dontlink
! 166:
! 167: SRCS= ${HPCARM}/hpcarm/locore.S param.c ioconf.c ${CFILES} ${SFILES}
! 168: depend: .depend
! 169: .depend: ${SRCS} assym.h param.c
! 170: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${HPCARM}/hpcarm/locore.S
! 171: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
! 172: test -z "${SFILES}" || ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
! 173: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
! 174: ${CPPFLAGS} < ${HPCARM}/hpcarm/genassym.cf
! 175: @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
! 176: @rm -f assym.dep
! 177:
! 178: dependall: depend all
! 179:
! 180:
! 181: # depend on root or device configuration
! 182: autoconf.o conf.o: Makefile
! 183:
! 184: # depend on network
! 185: uipc_proto.o: Makefile
! 186:
! 187: # depend on maxusers
! 188: assym.h: Makefile
! 189:
! 190: # depend on CPU configuration
! 191: cpufunc.o cpufunc_asm.o: Makefile
! 192:
! 193: # depend on DIAGNOSTIC etc.
! 194: cpuswitch.o fault.o machdep.o: Makefile
! 195:
! 196:
! 197: locore.o: ${HPCARM}/hpcarm/locore.S assym.h
! 198: ${NORMAL_S}
! 199:
! 200: # The install target can be redefined by putting a
! 201: # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
! 202: MACHINE_NAME!= uname -n
! 203: install: install-kernel-${MACHINE_NAME}
! 204: .if !target(install-kernel-${MACHINE_NAME}})
! 205: install-kernel-${MACHINE_NAME}:
! 206: rm -f /onetbsd
! 207: ln /netbsd /onetbsd
! 208: cp netbsd /nnetbsd
! 209: mv /nnetbsd /netbsd
! 210: .endif
! 211:
! 212: %RULES
CVSweb <webmaster@jp.NetBSD.org>