Annotation of sys/arch/macppc/conf/Makefile.macppc, Revision 1.1
1.1 ! nbrk 1: # $OpenBSD: Makefile.macppc,v 1.25 2007/07/30 16:23:33 thib Exp $
! 2: #
! 3: # Makefile for OpenBSD PowerPC
! 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/macppc/conf/``machineid''
! 9: # after which you should do
! 10: # config machineid
! 11: # Machine generic makefile changes should be made in
! 12: # /sys/arch/macppc/conf/Makefile.macppc
! 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: .SUFFIXES: .S .c .o
! 22:
! 23: # DEBUG is set to -g if debugging.
! 24: # PROF is set to -pg if profiling.
! 25:
! 26: .include <bsd.own.mk>
! 27:
! 28: MKDEP?= mkdep
! 29: STRIP?= strip
! 30: SIZE?= size
! 31:
! 32: # source tree is located via $S relative to the compilation directory
! 33: .ifndef S
! 34: S!= cd ../../../..; pwd
! 35: .endif
! 36: MACPPC= $S/arch/macppc
! 37:
! 38: INCLUDES= -I. -I$S -I$S/arch -nostdinc
! 39: CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL \
! 40: -D__macppc__
! 41: CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
! 42: -Wno-uninitialized -Wno-format -Wno-main \
! 43: -Wstack-larger-than-2047
! 44: CMACHFLAGS= -msoft-float -Wa,-many -fno-builtin-printf -fno-builtin-log
! 45: .if ${IDENT:M-DNO_PROPOLICE}
! 46: CMACHFLAGS+= -fno-stack-protector
! 47: .endif
! 48: COPTS?= -O2
! 49: CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
! 50: AFLAGS= -D_LOCORE -Wa,-many
! 51: LINKFLAGS= -N -Ttext 100114 -e start --warn-common
! 52: STRIPFLAGS= -g -X -x
! 53:
! 54: HOSTCC?= ${CC}
! 55: HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
! 56: HOSTED_CFLAGS= ${CFLAGS}
! 57:
! 58: ### find out what to use for libkern
! 59: .include "$S/lib/libkern/Makefile.inc"
! 60: .ifndef PROF
! 61: LIBKERN= ${KERNLIB}
! 62: .else
! 63: LIBKERN= ${KERNLIB_PROF}
! 64: .endif
! 65:
! 66: ### find out what to use for libcompat
! 67: .include "$S/compat/common/Makefile.inc"
! 68: .ifndef PROF
! 69: LIBCOMPAT= ${COMPATLIB}
! 70: .else
! 71: LIBCOMPAT= ${COMPATLIB_PROF}
! 72: .endif
! 73:
! 74: # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
! 75: # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
! 76: # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
! 77: # is marked as config-dependent.
! 78:
! 79: USRLAND_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
! 80: USRLAND_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
! 81:
! 82: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
! 83: NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
! 84:
! 85: DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
! 86: DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
! 87:
! 88: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
! 89: NORMAL_S_C= ${AS} ${COPTS} ${PARAM} $< -o $@
! 90:
! 91:
! 92: %OBJS
! 93:
! 94: %CFILES
! 95:
! 96: %SFILES
! 97:
! 98: # load lines for config "xxx" will be emitted as:
! 99: # xxx: ${SYSTEM_DEP} swapxxx.o
! 100: # ${SYSTEM_LD_HEAD}
! 101: # ${SYSTEM_LD} swapxxx.o
! 102: # ${SYSTEM_LD_TAIL}
! 103: SYSTEM_OBJ= locore.o 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 ${MACPPC}/macppc/genassym.cf Makefile
! 124: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
! 125: < ${MACPPC}/macppc/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: clean::
! 143: rm -f eddep *bsd bsd.gdb tags *.[io] [a-z]*.s \
! 144: [Ee]rrs linterrs makelinks genassym genassym.o assym.h
! 145:
! 146: lint:
! 147: @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} -UKGDB ${CFILES} \
! 148: ioconf.c param.c | \
! 149: grep -v 'static function .* unused'
! 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= ${MACPPC}/macppc/locore.S \
! 163: param.c ioconf.c ${CFILES} ${SFILES}
! 164: depend:: .depend
! 165: .depend: ${SRCS} assym.h param.c
! 166: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MACPPC}/macppc/locore.S
! 167: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
! 168: .if ${SFILES} != ""
! 169: ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
! 170: .endif
! 171: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
! 172: ${CPPFLAGS} < ${MACPPC}/macppc/genassym.cf
! 173: @sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
! 174: @rm -f assym.dep
! 175:
! 176: # depend on root or device configuration
! 177: autoconf.o conf.o: Makefile
! 178:
! 179: # depend on network or filesystem configuration
! 180: uipc_proto.o vfs_conf.o: Makefile
! 181:
! 182: # depend on maxusers
! 183: genassym.o machdep.o: Makefile
! 184:
! 185: # depend on CPU configuration
! 186: locore.o machdep.o: Makefile
! 187:
! 188:
! 189: locore.o: ${MACPPC}/macppc/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