Annotation of sys/arch/hppa/conf/Makefile.hppa, Revision 1.1
1.1 ! nbrk 1: # $OpenBSD: Makefile.hppa,v 1.28 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/hppa/conf/``machineid''
! 9: # after which you should do
! 10: # config machineid
! 11: # Machine generic makefile changes should be made in
! 12: # /sys/arch/hppa/conf/Makefile.hppa
! 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: HPPA= $S/arch/hppa
! 35:
! 36: INCLUDES= -I. -I$S -I$S/arch -nostdinc
! 37: CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
! 38: -Dhppa
! 39: CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wno-uninitialized \
! 40: -Wno-format -Wno-main \
! 41: -Wstack-larger-than-2047
! 42: CMACHFLAGS= -mfast-indirect-calls -mportable-runtime -mno-space-regs \
! 43: -fno-stack-protector -fno-builtin-printf -fno-builtin-log
! 44: COPTS?= -Os
! 45: CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} ${CMACHFLAGS} ${PIPE}
! 46: AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
! 47: LINKFLAGS= -X -T ${HPPA}/conf/ld.script -Ttext 80000 --warn-common
! 48: STRIPFLAGS= -g -x
! 49:
! 50: .if ${IDENT:M-DDDB} != ""
! 51: CFLAGS+= -fno-omit-frame-pointer
! 52: .endif
! 53:
! 54: .if ${IDENT:M-DHP7000_CPU} != ""
! 55: CFLAGS+= -mpa-risc-1-0
! 56: .elif ${IDENT:M-DHP8*_CPU} != ""
! 57: CFLAGS+= -mpa-risc-2-0
! 58: .else
! 59: CFLAGS+= -mpa-risc-1-1
! 60: .endif
! 61:
! 62: .if ${IDENT:M-DFPEMUL} != ""
! 63: CFLAGS+= -msoft-float -mdisable-fpregs
! 64: .include "${HPPA}/spmath/Makefile.inc"
! 65: .ifndef PROF
! 66: LIBSPMATH= ${SPMATH}
! 67: .else
! 68: LIBSPMATH= ${SPMATH_PROF}
! 69: .endif
! 70: .endif
! 71:
! 72: HOSTCC?= ${CC}
! 73: HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
! 74: HOSTED_CFLAGS= ${CFLAGS}
! 75:
! 76: # this line must be there because libkern needs assym.h generated early
! 77: depend:: .NOTMAIN .depend
! 78:
! 79: ### find out what to use for libkern
! 80: .include "$S/lib/libkern/Makefile.inc"
! 81: .ifndef PROF
! 82: LIBKERN= ${KERNLIB}
! 83: .else
! 84: LIBKERN= ${KERNLIB_PROF}
! 85: .endif
! 86:
! 87: ### find out what to use for libcompat
! 88: .include "$S/compat/common/Makefile.inc"
! 89: .ifndef PROF
! 90: LIBCOMPAT= ${COMPATLIB}
! 91: .else
! 92: LIBCOMPAT= ${COMPATLIB_PROF}
! 93: .endif
! 94:
! 95: # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
! 96: # HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
! 97:
! 98: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
! 99: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
! 100:
! 101: HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
! 102:
! 103: %OBJS
! 104:
! 105: %CFILES
! 106:
! 107: %SFILES
! 108:
! 109: SYSTEM_OBJ= locore.o param.o ioconf.o ${OBJS} \
! 110: ${LIBKERN} ${LIBCOMPAT} ${LIBSPMATH}
! 111: SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
! 112: SYSTEM_LD_HEAD= @rm -f $@
! 113: SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
! 114: ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
! 115: SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
! 116:
! 117: DEBUG?=
! 118: .if ${DEBUG} == "-g"
! 119: SYSTEM_LD_TAIL+=; \
! 120: echo mv $@ $@.gdb; rm -f $@.gdb; mv $@ $@.gdb; \
! 121: echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
! 122: ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
! 123: .else
! 124: LINKFLAGS+= -S -x
! 125: .endif
! 126:
! 127: %LOAD
! 128:
! 129: assym.h: $S/kern/genassym.sh ${HPPA}/hppa/genassym.cf Makefile
! 130: sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
! 131: < ${HPPA}/hppa/genassym.cf > assym.h.tmp && \
! 132: mv -f assym.h.tmp assym.h
! 133:
! 134: param.c: $S/conf/param.c
! 135: rm -f param.c
! 136: cp $S/conf/param.c .
! 137:
! 138: param.o: param.c Makefile
! 139: ${NORMAL_C}
! 140:
! 141: ioconf.o: ioconf.c
! 142: ${NORMAL_C}
! 143:
! 144: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
! 145: sh $S/conf/newvers.sh
! 146: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
! 147:
! 148:
! 149: clean::
! 150: rm -f eddep *bsd bsd.map bsd.gdb tags *.[io] [a-z]*.s \
! 151: [Ee]rrs linterrs makelinks assym.h
! 152:
! 153: lint:
! 154: @lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} -UKGDB \
! 155: ${CFILES} ioconf.c param.c | \
! 156: grep -v 'static function .* unused'
! 157:
! 158: tags:
! 159: @echo "see $S/kern/Makefile for tags"
! 160:
! 161: links:
! 162: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
! 163: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
! 164: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
! 165: sort -u | comm -23 - dontlink | \
! 166: sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
! 167: sh makelinks && rm -f dontlink
! 168:
! 169: SRCS= ${HPPA}/hppa/locore.S \
! 170: param.c ioconf.c ${CFILES} ${SFILES}
! 171: .depend: ${SRCS} assym.h param.c
! 172: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${HPPA}/hppa/locore.S
! 173: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
! 174: -if test -n "${SFILES}"; then \
! 175: ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}; \
! 176: fi
! 177: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
! 178: ${CPPFLAGS} < ${HPPA}/hppa/genassym.cf
! 179: @sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
! 180: @rm -f assym.dep
! 181:
! 182: # depend on root or device configuration
! 183: autoconf.o conf.o: Makefile
! 184:
! 185: # depend on network or filesystem configuration
! 186: uipc_proto.o vfs_conf.o: Makefile
! 187:
! 188: # depend on maxusers
! 189: assym.h machdep.o: Makefile
! 190:
! 191: # depend on CPU configuration
! 192: locore.o machdep.o trap.o: Makefile
! 193:
! 194:
! 195: locore.o: ${HPPA}/hppa/locore.S assym.h
! 196: ${NORMAL_S}
! 197: fpemu.o: assym.h
! 198:
! 199: # The install target can be redefined by putting a
! 200: # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
! 201: MACHINE_NAME!= uname -n
! 202: install: install-kernel-${MACHINE_NAME}
! 203: .if !target(install-kernel-${MACHINE_NAME}})
! 204: install-kernel-${MACHINE_NAME}:
! 205: rm -f /obsd
! 206: ln /bsd /obsd
! 207: cp bsd /nbsd
! 208: mv /nbsd /bsd
! 209: .endif
! 210:
! 211: %RULES
CVSweb