Annotation of sys/arch/jornada/conf/Makefile.jornada, Revision 1.1
1.1 ! nbrk 1: # $OpenBSD: Makefile.armish,v 1.5 2007/07/30 16:23:33 thib Exp $
! 2: # $NetBSD: Makefile.i386,v 1.67 1996/05/11 16:12:11 mycroft Exp $
! 3:
! 4: # Makefile for OpenBSD
! 5: #
! 6: # This makefile is constructed from a machine description:
! 7: # config machineid
! 8: # Most changes should be made in the machine description
! 9: # /sys/arch/armish/conf/``machineid''
! 10: # after which you should do
! 11: # config machineid
! 12: # Machine generic makefile changes should be made in
! 13: # /sys/arch/armish/conf/Makefile.armish
! 14: # after which config should be rerun for all machines of that type.
! 15: #
! 16: # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
! 17: # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
! 18: #
! 19: # -DTRACE compile in kernel tracing hooks
! 20: # -DQUOTA compile in file system quotas
! 21:
! 22: # DEBUG is set to -g if debugging.
! 23: # PROF is set to -pg if profiling.
! 24:
! 25: .include <bsd.own.mk>
! 26:
! 27: MKDEP?= mkdep
! 28: SIZE?= size
! 29: STRIP?= strip
! 30:
! 31: # source tree is located via $S relative to the compilation directory
! 32: .ifndef S
! 33: S!= cd ../../../..; pwd
! 34: .endif
! 35: THISARM= $S/arch/jornada
! 36: ARM= $S/arch/arm
! 37:
! 38: INCLUDES= -nostdinc -I. -I$S -I$S/arch
! 39: CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -D__armish__
! 40: CDIAGFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
! 41: -Wno-uninitialized -Wno-format -Wno-main \
! 42: -Wstack-larger-than-2047
! 43:
! 44: CMACHFLAGS= -ffreestanding
! 45: #CMACHFLAGS= -march=armv4 -mtune=strongarm -ffreestanding
! 46: .if ${IDENT:M-DNO_PROPOLICE}
! 47: CMACHFLAGS+= -fno-stack-protector
! 48: .endif
! 49: CMACHFLAGS+= -msoft-float -fno-builtin-printf -fno-builtin-log
! 50:
! 51: COPTS?= -O2
! 52: CFLAGS= ${DEBUG} ${CDIAGFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE}
! 53: AFLAGS= -x assembler-with-cpp -D_LOCORE ${CMACHFLAGS}
! 54: #LINKFLAGS= -Ttext 0xF0000020 -e start --warn-common
! 55: #LINKFLAGS= -T ${THISARM}/conf/kern.ldscript
! 56: LINKFLAGS= -T ldscript
! 57: LINKFLAGS+= --warn-common
! 58: STRIPFLAGS= -g -X -x
! 59:
! 60: HOSTCC= ${CC}
! 61: HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
! 62: HOSTED_CFLAGS= ${CFLAGS}
! 63:
! 64: ### find out what to use for libkern
! 65: .include "$S/lib/libkern/Makefile.inc"
! 66: .ifndef PROF
! 67: LIBKERN= ${KERNLIB}
! 68: .else
! 69: LIBKERN= ${KERNLIB_PROF}
! 70: .endif
! 71:
! 72: ### find out what to use for libcompat
! 73: .include "$S/compat/common/Makefile.inc"
! 74: .ifndef PROF
! 75: LIBCOMPAT= ${COMPATLIB}
! 76: .else
! 77: LIBCOMPAT= ${COMPATLIB_PROF}
! 78: .endif
! 79:
! 80: # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
! 81: # where TYPE is NORMAL, DRIVER, or PROFILE; SUFFIX is the file suffix,
! 82: # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
! 83: # is marked as config-dependent.
! 84:
! 85: NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
! 86: NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
! 87:
! 88: DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
! 89: DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
! 90:
! 91: NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
! 92: NORMAL_S_C= ${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
! 93:
! 94: HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
! 95:
! 96: %OBJS
! 97:
! 98: %CFILES
! 99:
! 100: %SFILES
! 101:
! 102: # load lines for config "xxx" will be emitted as:
! 103: # xxx: ${SYSTEM_DEP} swapxxx.o
! 104: # ${SYSTEM_LD_HEAD}
! 105: # ${SYSTEM_LD} swapxxx.o
! 106: # ${SYSTEM_LD_TAIL}
! 107: SYSTEM_OBJ= ${BOARDTYPE}_start.o locore.o \
! 108: param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
! 109: SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
! 110: SYSTEM_LD_HEAD= rm -f $@
! 111: SYSTEM_LD_HEAD+=; \
! 112: cat ${ARM}/conf/ldscript.head ${ARM}/conf/ldscript.tail | \
! 113: sed -e 's/@KERNEL_BASE_PHYS@/${KERNEL_BASE_PHYS}/' \
! 114: -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' \
! 115: > ldscript
! 116:
! 117: SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
! 118: ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
! 119: SYSTEM_LD_TAIL= @dd if=/dev/zero of=bsd bs=1 count=1 seek=95 conv=notrunc 2>/dev/null; \
! 120: dd if=/dev/zero of=bsd bs=1 count=1 seek=127 conv=notrunc 2>/dev/null; \
! 121: dd if=/dev/zero of=bsd bs=1 count=1 seek=159 conv=notrunc 2>/dev/null; \
! 122: ${SIZE} $@; chmod 755 $@
! 123:
! 124: DEBUG?=
! 125: .if ${DEBUG} == "-g"
! 126: LINKFLAGS+= -X
! 127: SYSTEM_LD_TAIL+=; \
! 128: echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
! 129: echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@
! 130: .else
! 131: LINKFLAGS+= -x
! 132: .endif
! 133:
! 134: %LOAD
! 135:
! 136: assym.h: $S/kern/genassym.sh ${ARM}/arm/genassym.cf Makefile
! 137: cat ${ARM}/arm/genassym.cf | \
! 138: sh $S/kern/genassym.sh ${CC} ${CFLAGS} \
! 139: ${CPPFLAGS} ${PARAM} > assym.h.tmp && \
! 140: mv -f assym.h.tmp assym.h
! 141:
! 142: param.c: $S/conf/param.c
! 143: rm -f param.c
! 144: cp $S/conf/param.c .
! 145:
! 146: param.o: param.c Makefile
! 147: ${NORMAL_C_C}
! 148:
! 149: ioconf.o: ioconf.c
! 150: ${NORMAL_C}
! 151:
! 152: newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
! 153: sh $S/conf/newvers.sh
! 154: ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
! 155:
! 156:
! 157: clean::
! 158: rm -f eddep *bsd bsd.gdb tags *.[io] [a-z]*.s \
! 159: [Ee]rrs linterrs makelinks assym.h
! 160:
! 161: lint:
! 162: @lint -hbxncez -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
! 163: ${CFILES} ioconf.c param.c | \
! 164: grep -v 'static function .* unused'
! 165:
! 166: tags:
! 167: @echo "see $S/kern/Makefile for tags"
! 168:
! 169: links:
! 170: egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
! 171: sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
! 172: echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
! 173: sort -u | comm -23 - dontlink | \
! 174: sed 's,.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
! 175: sh makelinks && rm -f dontlink makelinks
! 176:
! 177: SRCS= ${ARM}/arm/locore.S \
! 178: param.c ioconf.c ${CFILES} ${SFILES}
! 179: depend:: .depend
! 180: .depend: ${SRCS} assym.h param.c ${APMINC}
! 181: ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${ARM}/arm/locore.S
! 182: ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
! 183: .if ${SFILES} != ""
! 184: ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
! 185: .endif
! 186: cat ${ARM}/arm/genassym.cf | \
! 187: sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
! 188: ${CPPFLAGS}
! 189: @sed -e 's/.*\.o:.* /assym.h: /' < assym.dep >> .depend
! 190: @rm -f assym.dep
! 191:
! 192:
! 193: # depend on root or device configuration
! 194: autoconf.o conf.o: Makefile
! 195:
! 196: # depend on network or filesystem configuration
! 197: uipc_domain.o uipc_proto.o vfs_conf.o: Makefile
! 198: if.o if_tun.o if_loop.o if_ethersubr.o: Makefile
! 199: if_arp.o if_ether.o: Makefile
! 200: ip_input.o ip_output.o in_pcb.o in_proto.o: Makefile
! 201: tcp_subr.o tcp_timer.o tcp_output.o: Makefile
! 202:
! 203: # depend on maxusers
! 204: machdep.o: Makefile
! 205:
! 206: # depend on CPU configuration
! 207: locore.o machdep.o: Makefile
! 208:
! 209: ${BOARDTYPE}_start.o: ${THISARM}/jornada/${BOARDTYPE}_start.S assym.h
! 210: ${NORMAL_S}
! 211:
! 212: locore.o: ${ARM}/arm/locore.S assym.h
! 213: ${NORMAL_S}
! 214:
! 215: # The install target can be redefined by putting a
! 216: # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
! 217: MACHINE_NAME!= uname -n
! 218: install: install-kernel-${MACHINE_NAME}
! 219: .if !target(install-kernel-${MACHINE_NAME}})
! 220: install-kernel-${MACHINE_NAME}:
! 221: rm -f /obsd
! 222: ln /bsd /obsd
! 223: cp bsd /nbsd
! 224: mv /nbsd /bsd
! 225: .endif
! 226:
! 227: %RULES
CVSweb