]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/boot/powerpc/ofw/Makefile
add -n option to suppress clearing the build tree and add -DNO_CLEAN
[FreeBSD/FreeBSD.git] / sys / boot / powerpc / ofw / Makefile
1 # $FreeBSD$
2
3 WITHOUT_SSP=
4
5 .include <bsd.own.mk>
6
7 PROG=           loader
8 NEWVERSWHAT=    "Open Firmware loader" ${MACHINE_ARCH}
9 BINDIR?=        /boot
10 INSTALLFLAGS=   -b
11
12 # Architecture-specific loader code
13 SRCS=           conf.c metadata.c vers.c start.c
14
15 LOADER_DISK_SUPPORT?=   yes
16 LOADER_UFS_SUPPORT?=    yes
17 LOADER_CD9660_SUPPORT?= yes
18 LOADER_EXT2FS_SUPPORT?= no
19 LOADER_NET_SUPPORT?=    yes
20 LOADER_NFS_SUPPORT?=    yes
21 LOADER_TFTP_SUPPORT?=   no
22 LOADER_GZIP_SUPPORT?=   yes
23 LOADER_BZIP2_SUPPORT?=  no
24
25 .if ${LOADER_DISK_SUPPORT} == "yes"
26 CFLAGS+=        -DLOADER_DISK_SUPPORT
27 .endif
28 .if ${LOADER_UFS_SUPPORT} == "yes"
29 CFLAGS+=        -DLOADER_UFS_SUPPORT
30 .endif
31 .if ${LOADER_CD9660_SUPPORT} == "yes"
32 CFLAGS+=        -DLOADER_CD9660_SUPPORT
33 .endif
34 .if ${LOADER_EXT2FS_SUPPORT} == "yes"
35 CFLAGS+=        -DLOADER_EXT2FS_SUPPORT
36 .endif
37 .if ${LOADER_GZIP_SUPPORT} == "yes"
38 CFLAGS+=        -DLOADER_GZIP_SUPPORT
39 .endif
40 .if ${LOADER_BZIP2_SUPPORT} == "yes"
41 CFLAGS+=        -DLOADER_BZIP2_SUPPORT
42 .endif
43 .if ${LOADER_NET_SUPPORT} == "yes"
44 CFLAGS+=        -DLOADER_NET_SUPPORT
45 .endif
46 .if ${LOADER_NFS_SUPPORT} == "yes"
47 CFLAGS+=        -DLOADER_NFS_SUPPORT
48 .endif
49 .if ${LOADER_TFTP_SUPPORT} == "yes"
50 CFLAGS+=        -DLOADER_TFTP_SUPPORT
51 .endif
52
53 .if ${MK_FORTH} != "no"
54 # Enable BootForth
55 BOOT_FORTH=     yes
56 CFLAGS+=        -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
57 LIBFICL=        ${.OBJDIR}/../../ficl/libficl.a
58 .endif
59
60 # Always add MI sources
61 .PATH:          ${.CURDIR}/../../common
62 .include        "${.CURDIR}/../../common/Makefile.inc"
63 CFLAGS+=        -I${.CURDIR}/../../common
64 CFLAGS+=        -I.
65
66 CLEANFILES+=    vers.c loader.help
67
68 CFLAGS+=        -ffreestanding -msoft-float
69 # load address. set in linker script
70 RELOC?=         0x1C00000
71 CFLAGS+=        -DRELOC=${RELOC}
72
73 LDFLAGS=        -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
74
75 # 64-bit bridge extensions
76 CFLAGS+= -Wa,-mppc64bridge
77
78 # Pull in common loader code
79 .PATH:          ${.CURDIR}/../../ofw/common
80 .include        "${.CURDIR}/../../ofw/common/Makefile.inc"
81
82 # Open Firmware standalone support library
83 LIBOFW=         ${.OBJDIR}/../../ofw/libofw/libofw.a
84 CFLAGS+=        -I${.CURDIR}/../../ofw/libofw
85
86 # where to get libstand from
87 CFLAGS+=        -I${.CURDIR}/../../../../lib/libstand/
88
89 DPADD=          ${LIBFICL} ${LIBOFW} ${LIBSTAND}
90 LDADD=          ${LIBFICL} ${LIBOFW} -lstand
91
92 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
93         sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
94
95 loader.help: help.common help.ofw
96         cat ${.ALLSRC} | \
97             awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
98
99 .PATH: ${.CURDIR}/../../forth
100 FILES=  loader.help loader.4th support.4th loader.conf
101 FILESDIR_loader.conf=   /boot/defaults
102
103 .if !exists(${DESTDIR}/boot/loader.rc)
104 FILES+= loader.rc
105 .endif
106
107 .include <bsd.prog.mk>