3 # We get a lot of the std lib functions from here.
4 .PATH: ${.CURDIR}/../../at91/libat91
6 # Enable to get debug msgs
9 # Hack to search through the kernel for ufs:ad0s1a and replace it with
10 # the correct one for the active slice/partition.
15 SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:L}_board.c
16 SRCS+=memchr.c memcmp.c memcpy.c memmem.c memset.c printf.c strcmp.c strcpy.c
17 SRCS+=strlen.c ashldi3.c divsi3.S muldi3.c
21 KERNVIRTADDR=${KERNPHYSADDR}
24 LDFLAGS=-e ${KERNPHYSADDR} -EB -T ldscript.${M}
25 OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
26 S=${.CURDIR}/../../../..
29 -DBOOT_STACK=${BOOT_STACK} \
30 -I${.CURDIR}/../../../common \
33 .if defined(FIXUP_BOOT_DRV)
34 CFLAGS+=-DFIXUP_BOOT_DRV
40 ldscript.$M: $S/conf/ldscript.$M
41 cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \
42 sed s/KERNVIRTADDR/${KERNVIRTADDR}/g | \
43 sed s/" + SIZEOF_HEADERS"// > ldscript.$M
47 CLEANFILES+=ldscript.$M
49 memchr.c: $S/../lib/libc/string/memchr.c
50 sed -e 's/string\.h/lib.h/' < $S/../lib/libc/string/memchr.c > \
53 memmem.c: $S/../lib/libc/string/memmem.c
54 sed -e 's/string\.h/lib.h/' < $S/../lib/libc/string/memmem.c > \
57 CLEANFILES+=memchr.c memmem.c
59 ashldi3.o: $S/libkern/ashldi3.c
60 ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC}
62 divsi3.o: $S/libkern/${M}/divsi3.S
63 ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC}
65 muldi3.o: $S/libkern/${M}/muldi3.c
66 ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC}
68 inflate.c: $S/kern/inflate.c
69 sed -e 's/extern void putstr (char/extern void putstr (const char/' < \
70 $S/kern/inflate.c > ${.TARGET}
74 .include <bsd.prog.mk>