]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - sys/boot/arm/ixp425/boot2/Makefile
MFC r264400,r265836:
[FreeBSD/stable/10.git] / sys / boot / arm / ixp425 / boot2 / Makefile
1 #  $FreeBSD$
2
3 .include <bsd.own.mk>
4
5 # We get a lot of the std lib functions from here.
6 .PATH: ${.CURDIR}/../../at91/libat91
7
8 # Enable to get debug msgs
9 #DEBUG=yes
10
11 # Hack to search through the kernel for ufs:ad0s1a and replace it with
12 # the correct one for the active slice/partition.
13 FIXUP_BOOT_DRV=yes
14
15 P=boot2
16 FILES=${P}
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"
21 SRCS+=aeabi_unwind.c
22 .endif
23 MAN=
24
25 KERNPHYSADDR=0x180000
26 KERNVIRTADDR=${KERNPHYSADDR}
27 BOOT_STACK=0x200000-4
28 M=${MACHINE}
29 LDFLAGS=-e ${KERNPHYSADDR} -EB -T ldscript.${M}
30 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
31 S=${.CURDIR}/../../../..
32
33 CFLAGS+= \
34         -DBOOT_STACK=${BOOT_STACK} \
35         -I${.CURDIR}/../../../common \
36         -I${.CURDIR}
37
38 .if defined(FIXUP_BOOT_DRV)
39 CFLAGS+=-DFIXUP_BOOT_DRV
40 .endif
41 .if defined(DEBUG)
42 CFLAGS+=-DDEBUG
43 .endif
44
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
49
50 ${P}:   ldscript.$M
51
52 CLEANFILES+=ldscript.$M
53
54 memchr.c:       $S/../lib/libc/string/memchr.c
55         sed -e 's/string\.h/lib.h/' < $S/../lib/libc/string/memchr.c > \
56           ${.TARGET}
57
58 memmem.c:       $S/../lib/libc/string/memmem.c
59         sed -e 's/string\.h/lib.h/' < $S/../lib/libc/string/memmem.c > \
60           ${.TARGET}
61
62 CLEANFILES+=memchr.c memmem.c
63
64 ashldi3.o:      $S/libkern/ashldi3.c
65         ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC}
66
67 divsi3.o:       $S/libkern/${M}/divsi3.S
68         ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC}
69
70 muldi3.o:       $S/libkern/${M}/muldi3.c
71         ${CC} -c ${CFLAGS} -D_KERNEL -o ${.TARGET} ${.IMPSRC}
72
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}
76
77 CLEANFILES+=inflate.c
78
79 .include <bsd.prog.mk>
80