Annotation of sys/arch/solbourne/conf/Makefile.solbourne, Revision 1.1
1.1 ! nbrk 1: # $OpenBSD: Makefile.solbourne,v 1.4 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/solbourne/conf/``machineid''
! 9: # after which you should do
! 10: # config machineid
! 11: # Machine generic makefile changes should be made in
! 12: # /sys/arch/solbourne/conf/Makefile.solbourne
! 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: .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: SOLBOURNE= $S/arch/solbourne
! 35:
! 36: INCLUDES= -nostdinc -I. -I$S -I$S/arch
! 37: CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Dsparc -Dsolbourne
! 38:
! 39: CDIAGFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
! 40: -Wno-uninitialized -Wno-format -Wno-main \
! 41: -Wstack-larger-than-2047
! 42:
! 43: CMACHFLAGS= -fno-builtin-printf -fno-builtin-log
! 44: .if ${IDENT:M-DNO_PROPOLICE}
! 45: CMACHFLAGS+= -fno-stack-protector
! 46: .endif
! 47:
! 48: CFLAGS= ${DEBUG} -O2 ${CDIAGFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
! 49: # add `-mno-fpu' to work around gcc (last noticed in v2.7.2) bug
! 50: CFLAGS+= -mno-fpu
! 51: AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
! 52: LINKFLAGS= -N -e start -T ${SOLBOURNE}/conf/ld.script -Ttext FD084000
! 53: STRIPFLAGS= -g -X -x
! 54:
! 55: HOSTCC= ${CC}
! 56: HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
! 57: HOSTED_CFLAGS= ${CFLAGS}
! 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_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
! 82:
! 83: DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
! 84: DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
! 85:
! 86: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
! 87: NORMAL_S_C= ${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
! 88:
! 89: HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
! 90:
! 91: %OBJS
! 92:
! 93: %CFILES
! 94:
! 95: %SFILES
! 96:
! 97: # load lines for config "xxx" will be emitted as:
! 98: # xxx: ${SYSTEM_DEP} swapxxx.o
! 99: # ${SYSTEM_LD_HEAD}
! 100: # ${SYSTEM_LD} swapxxx.o
! 101: # ${SYSTEM_LD_TAIL}
! 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 mv $@ $@.gdb; rm -f $@.gdb; mv $@ $@.gdb; \
! 115: echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
! 116: ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
! 117: .else
! 118: LINKFLAGS+= -S -x
! 119: .endif
! 120:
! 121: %LOAD
! 122:
! 123: assym.h: $S/kern/genassym.sh ${SOLBOURNE}/solbourne/genassym.cf Makefile
! 124: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
! 125: ${PARAM} < ${SOLBOURNE}/solbourne/genassym.cf > assym.h.tmp && \
! 126: mv -f assym.h.tmp assym.h
! 127:
! 128: param.c: $S/conf/param.c
! 129: rm -f param.c
! 130: cp $S/conf/param.c .
! 131:
! 132: param.o: param.c Makefile
! 133: ${NORMAL_C_C}
! 134:
! 135: ioconf.o: ioconf.c
! 136: ${NORMAL_C}
! 137:
! 138: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
! 139: sh $S/conf/newvers.sh
! 140: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
! 141:
! 142:
! 143: clean::
! 144: rm -f eddep *bsd *bsd.gdb tags *.[io] [a-z]*.s \
! 145: [Ee]rrs linterrs makelinks genassym genassym.o assym.h
! 146:
! 147: lint:
! 148: @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
! 149: ${CFILES} ioconf.c param.c | \
! 150: grep -v 'static function .* unused'
! 151:
! 152: tags:
! 153: @echo "see $S/kern/Makefile for tags"
! 154:
! 155: links:
! 156: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
! 157: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
! 158: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
! 159: sort -u | comm -23 - dontlink | \
! 160: sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
! 161: sh makelinks && rm -f dontlink
! 162:
! 163: SRCS= ${SOLBOURNE}/solbourne/locore.s \
! 164: param.c ioconf.c ${CFILES} ${SFILES}
! 165: depend:: .depend
! 166: .depend: ${SRCS} assym.h param.c
! 167: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${SOLBOURNE}/solbourne/locore.s
! 168: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
! 169: .if !empty(SFILES)
! 170: ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
! 171: .endif
! 172: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
! 173: ${CPPFLAGS} < ${SOLBOURNE}/solbourne/genassym.cf
! 174: @sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
! 175: @rm -f assym.dep
! 176:
! 177:
! 178: locore.o: ${SOLBOURNE}/solbourne/locore.s assym.h
! 179: ${NORMAL_S}
! 180:
! 181: # The install target can be redefined by putting a
! 182: # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
! 183: MACHINE_NAME!= uname -n
! 184: install: install-kernel-${MACHINE_NAME}
! 185: .if !target(install-kernel-${MACHINE_NAME}})
! 186: install-kernel-${MACHINE_NAME}:
! 187: rm -f /obsd
! 188: ln /bsd /obsd
! 189: cp bsd /nbsd
! 190: mv /nbsd /bsd
! 191: .endif
! 192:
! 193: %RULES
CVSweb