Merge from vendor branch GDB:
[dragonfly.git] / sys / boot / sparc64 / loader / Makefile
1 # $FreeBSD: src/sys/boot/sparc64/loader/Makefile,v 1.15 2002/12/20 04:32:10 jake Exp $
2 # $DragonFly: src/sys/boot/sparc64/loader/Makefile,v 1.1 2003/11/10 06:08:40 dillon Exp $
3
4 BASE=           loader
5 PROG=           ${BASE}
6 STRIP=
7 NEWVERSWHAT=    "bootstrap loader" sparc64
8 BINDIR?=        /boot
9 INSTALLFLAGS=   -b
10
11 # Architecture-specific loader code
12 SRCS=           locore.S main.c metadata.c vers.c
13
14 LOADER_DISK_SUPPORT?=   yes
15 LOADER_UFS_SUPPORT?=    yes
16 LOADER_CD9660_SUPPORT?= yes
17 LOADER_NET_SUPPORT?=    yes
18 LOADER_NFS_SUPPORT?=    yes
19 LOADER_TFTP_SUPPORT?=   yes
20 LOADER_GZIP_SUPPORT?=   yes
21 LOADER_BZIP2_SUPPORT?=  no
22
23 .if ${LOADER_DISK_SUPPORT} == "yes"
24 CFLAGS+=        -DLOADER_DISK_SUPPORT
25 .endif
26 .if ${LOADER_UFS_SUPPORT} == "yes"
27 CFLAGS+=        -DLOADER_UFS_SUPPORT
28 .endif
29 .if ${LOADER_CD9660_SUPPORT} == "yes"
30 CFLAGS+=        -DLOADER_CD9660_SUPPORT
31 .endif
32 .if ${LOADER_GZIP_SUPPORT} == "yes"
33 CFLAGS+=        -DLOADER_GZIP_SUPPORT
34 .endif
35 .if ${LOADER_BZIP2_SUPPORT} == "yes"
36 CFLAGS+=        -DLOADER_BZIP2_SUPPORT
37 .endif
38 .if ${LOADER_NET_SUPPORT} == "yes"
39 CFLAGS+=        -DLOADER_NET_SUPPORT
40 .endif
41 .if ${LOADER_NFS_SUPPORT} == "yes"
42 CFLAGS+=        -DLOADER_NFS_SUPPORT
43 .endif
44 .if ${LOADER_TFTP_SUPPORT} == "yes"
45 CFLAGS+=        -DLOADER_TFTP_SUPPORT
46 .endif
47
48 .if !defined(NOFORTH)
49 # Enable BootForth
50 BOOT_FORTH=     yes
51 CFLAGS+=        -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/sparc64
52 .if exists(${.OBJDIR}/../../ficl/libficl.a)
53 LIBFICL=        ${.OBJDIR}/../../ficl/libficl.a
54 .else
55 LIBFICL=        ${.CURDIR}/../../ficl/libficl.a
56 .endif
57 .endif
58
59 # Always add MI sources 
60 .PATH:          ${.CURDIR}/../../common
61 .include        <${.CURDIR}/../../common/Makefile.inc>
62 CFLAGS+=        -I${.CURDIR}/../../common
63 CFLAGS+=        -I${.CURDIR}/../../.. -I.
64
65 CLEANFILES+=    vers.c ${BASE}.help
66
67 CFLAGS+=        -ffreestanding
68 LDFLAGS=        -nostdlib -static
69
70 # Openfirmware standalone support library
71 LIBOFW=         ${.OBJDIR}/../../ofw/libofw/libofw.a
72 CFLAGS+=        -I${.CURDIR}/../../ofw/libofw/
73
74 # where to get libstand from
75 #XXX need a better way to do this
76 LIBSTAND=       ${.CURDIR}/../../../../lib/libstand/libstand.a
77 .if !exists(${LIBSTAND})
78 LIBSTAND=       ${.OBJDIR}/../../../../lib/libstand/libstand.a
79 .if !exists(${LIBSTAND})
80 LIBSTAND=       -lstand
81 .endif
82 .endif
83 CFLAGS+=        -I${.CURDIR}/../../../../lib/libstand/
84
85 LDADD=          ${LIBFICL} ${LIBOFW} ${LIBSTAND}
86
87 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
88         sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
89
90 ${BASE}.help: help.common help.sparc64
91         cat ${.ALLSRC} | \
92             awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
93
94 .PATH: ${.CURDIR}/../../forth
95 FILES=  ${BASE}.help loader.4th support.4th loader.conf
96 FILESDIR_loader.conf=   /boot/defaults
97
98 .if !exists(${DESTDIR}/boot/loader.rc)
99 FILES+= loader.rc
100 .endif
101
102 # There are no things relevant to all boot parts of FreeBSD/sparc64 yet.
103 #.include <${.CURDIR}/../Makefile.inc>
104
105 .include <bsd.prog.mk>
106
107 .if exists(${.CURDIR}/../../../sparc64/include)
108 beforedepend ${OBJS}: machine
109
110 machine:
111         ln -sf ${.CURDIR}/../../../sparc64/include machine
112 .endif
113
114 CLEANFILES+=    machine