5 # We get a lot of the std lib functions from here.
6 .PATH: ${.CURDIR}/../../at91/libat91
8 # Enable to get debug msgs
11 # Hack to search through the kernel for ufs:ad0s1a and replace it with
12 # the correct one for the active slice/partition.
17 SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c
18 SRCS+=memchr.c memcmp.c memcpy.c memmem.c memset.c printf.c strcmp.c strcpy.c
19 SRCS+=strlen.c ashldi3.c divsi3.S muldi3.c
20 .if ${MK_ARM_EABI} != "no"
26 KERNVIRTADDR=${KERNPHYSADDR}
29 LDFLAGS=-e ${KERNPHYSADDR} -EB -T ldscript.${M}
30 OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
31 S=${.CURDIR}/../../../..
34 -DBOOT_STACK=${BOOT_STACK} \
35 -I${.CURDIR}/../../../common \
38 .if defined(FIXUP_BOOT_DRV)
39 CFLAGS+=-DFIXUP_BOOT_DRV
45 ldscript.$M: $S/conf/ldscript.$M
46 cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \
47 sed s/KERNVIRTADDR/${KERNVIRTADDR}/g | \
48 sed s/" + SIZEOF_HEADERS"// > ldscript.$M
52 CLEANFILES+=ldscript.$M
54 memchr.c: $S/../lib/libc/string/memchr.c
55 sed -e 's/string\.h/lib.h/' < $S/../lib/libc/string/memchr.c > \
58 memmem.c: $S/../lib/libc/string/memmem.c
59 sed -e 's/string\.h/lib.h/' < $S/../lib/libc/string/memmem.c > \
62 CLEANFILES+=memchr.c memmem.c
64 ashldi3.o: $S/libkern/ashldi3.c
65 ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC}
67 divsi3.o: $S/libkern/${M}/divsi3.S
68 ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC}
70 muldi3.o: $S/libkern/${M}/muldi3.c
71 ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC}
73 inflate.c: $S/kern/inflate.c
74 sed -e 's/extern void putstr (char/extern void putstr (const char/' < \
75 $S/kern/inflate.c > ${.TARGET}
79 .include <bsd.prog.mk>