Annotation of sys/arch/mvme88k/conf/Makefile.mvme88k, Revision 1.1
1.1 ! nbrk 1: # $OpenBSD: Makefile.mvme88k,v 1.40 2007/07/30 16:23:33 thib Exp $
! 2: #
! 3: # Makefile for OpenBSD
! 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/mvme88k/conf/``machineid''
! 9: # after which you should do
! 10: # config machineid
! 11: # Machine generic makefile changes should be made in
! 12: # /sys/arch/mvme88k/conf/Makefile.mvme88k
! 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 by config if debugging is requested (config -g).
! 22: # PROF is set to -pg by config if profiling is requested (config -p).
! 23:
! 24: .include <bsd.own.mk>
! 25:
! 26: MKDEP?= mkdep
! 27: SIZE?= size
! 28: STRIP?= strip
! 29:
! 30: # source tree is located via $S relative to the compilation directory
! 31: .ifndef S
! 32: S!= cd ../../../..; pwd
! 33: .endif
! 34: MVME88K= $S/arch/mvme88k
! 35: M88K= $S/arch/m88k
! 36:
! 37: INCLUDES= -nostdinc -I. -I$S -I$S/arch
! 38: CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Dmvme88k -Dm88k
! 39: CWARNFLAGS= -Wall -Werror -Wmissing-prototypes \
! 40: -Wno-uninitialized -Wno-format -Wno-main -Wstrict-prototypes \
! 41: -Wstack-larger-than-2047
! 42: CMACHFLAGS= -mno-check-zero-division -mmemcpy \
! 43: -fno-builtin-printf -fno-builtin-log
! 44: .if ${IDENT:M-DNO_PROPOLICE}
! 45: CMACHFLAGS+= -fno-stack-protector
! 46: .endif
! 47: COPTS?= -O2
! 48: CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
! 49: AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE ${CMACHFLAGS}
! 50: LINKFLAGS= -Ttext 0x10000 -e start
! 51: STRIPFLAGS= -d
! 52:
! 53: HOSTCC?= ${CC}
! 54: HOSTED_CPPFLAGS?=${CPPFLAGS:S/^-nostdinc$//}
! 55: HOSTED_CFLAGS?= ${CFLAGS}
! 56:
! 57: ### CPU configuration
! 58:
! 59: ### find out what to use for libkern
! 60: .include "$S/lib/libkern/Makefile.inc"
! 61: .ifndef PROF
! 62: LIBKERN= ${KERNLIB}
! 63: .else
! 64: LIBKERN= ${KERNLIB_PROF}
! 65: .endif
! 66:
! 67: ### find out what to use for libcompat
! 68: .include "$S/compat/common/Makefile.inc"
! 69: .ifndef PROF
! 70: LIBCOMPAT= ${COMPATLIB}
! 71: .else
! 72: LIBCOMPAT= ${COMPATLIB_PROF}
! 73: .endif
! 74:
! 75: # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
! 76: # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
! 77: # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
! 78: # is marked as config-dependent.
! 79:
! 80: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
! 81: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
! 82:
! 83: HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
! 84:
! 85: PROFILE_C= ${CC} -S -c ${CFLAGS} ${CPPFLAGS} $<; \
! 86: sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \
! 87: ${AS} -o $@; \
! 88: rm -f $*.s
! 89:
! 90: %OBJS
! 91:
! 92: %CFILES
! 93:
! 94: %SFILES
! 95:
! 96: # load lines for config "xxx" will be emitted as:
! 97: # xxx: ${SYSTEM_DEP} swapxxx.o
! 98: # ${SYSTEM_LD_HEAD}
! 99: # ${SYSTEM_LD} swapxxx.o
! 100: # ${SYSTEM_LD_TAIL}
! 101: # Kernel is linked as a ZMAGIC executable, with start at 10020
! 102: SYSTEM_OBJ= locore.o \
! 103: param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
! 104: SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
! 105: SYSTEM_LD_HEAD= @rm -f $@
! 106: SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
! 107: ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
! 108: SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@;
! 109:
! 110: DEBUG?=
! 111: .if ${DEBUG} == "-g"
! 112: LINKFLAGS+= -X
! 113: SYSTEM_LD_TAIL+=; \
! 114: echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
! 115: echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
! 116: .else
! 117: LINKFLAGS+= -x
! 118: .endif
! 119:
! 120: %LOAD
! 121:
! 122: assym.h: $S/kern/genassym.sh ${M88K}/m88k/genassym.cf Makefile
! 123: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
! 124: ${PARAM} < ${M88K}/m88k/genassym.cf > assym.h.tmp && \
! 125: mv -f assym.h.tmp assym.h
! 126:
! 127: param.c: $S/conf/param.c
! 128: rm -f param.c
! 129: cp $S/conf/param.c .
! 130:
! 131: param.o: param.c Makefile
! 132: ${NORMAL_C}
! 133:
! 134: ioconf.o: ioconf.c
! 135: ${NORMAL_C}
! 136:
! 137: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
! 138: sh $S/conf/newvers.sh
! 139: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
! 140:
! 141: clean::
! 142: rm -f eddep *bsd bsd.gdb tags *.[io] [a-z]*.s \
! 143: [Ee]rrs linterrs makelinks assym.h
! 144:
! 145: lint:
! 146: @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
! 147: ${CFILES} ioconf.c param.c | \
! 148: grep -v 'struct/union .* never defined' | \
! 149: grep -v 'possible pointer alignment problem'
! 150:
! 151: tags:
! 152: @echo "see $S/kern/Makefile for tags"
! 153:
! 154: links:
! 155: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
! 156: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
! 157: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
! 158: sort -u | comm -23 - dontlink | \
! 159: sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
! 160: sh makelinks && rm -f dontlink
! 161:
! 162: SRCS= param.c ioconf.c ${CFILES} ${SFILES}
! 163:
! 164: depend:: .depend
! 165: .depend: ${SRCS} assym.h param.c
! 166: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
! 167: .if !empty(SFILES)
! 168: ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
! 169: .endif
! 170: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
! 171: ${CPPFLAGS} < ${M88K}/m88k/genassym.cf
! 172: @sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
! 173: @rm -f assym.dep
! 174:
! 175: # depend on root or device configuration
! 176: autoconf.o conf.o: Makefile
! 177:
! 178: # depend on network or filesystem configuration
! 179: uipc_domain.o uipc_proto.o vfs_conf.o: Makefile
! 180: if_tun.o if_loop.o if_ethersubr.o: Makefile
! 181: in_proto.o: Makefile
! 182:
! 183: # depend on maxusers
! 184: assym.h machdep.o: Makefile
! 185:
! 186: # depend on CPU configuration
! 187: locore.o machdep.o: Makefile
! 188:
! 189: locore.o: ${MVME88K}/mvme88k/locore.S assym.h
! 190: ${NORMAL_S}
! 191:
! 192: # The install target can be redefined by putting a
! 193: # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
! 194: MACHINE_NAME!= uname -n
! 195: install: install-kernel-${MACHINE_NAME}
! 196: .if !target(install-kernel-${MACHINE_NAME}})
! 197: install-kernel-${MACHINE_NAME}:
! 198: rm -f /obsd
! 199: ln /bsd /obsd
! 200: cp bsd /nbsd
! 201: mv /nbsd /bsd
! 202: .endif
! 203:
! 204: %RULES
CVSweb