Remove FICL code from sys/boot and clean up some more.
[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.2 2005/07/07 11:49:57 corecode 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 BOOT_DLOADER=   yes
49 CFLAGS+=        -I${.CURDIR}/../../dloader -I${.CURDIR}/../../dloader/sparc64
50 .if exists(${.OBJDIR}/../../dloader/libdloader.a)
51 LIBDLOADER=     ${.OBJDIR}/../../dloader/libdloader.a
52 .else
53 LIBDLOADER=     ${.CURDIR}/../../dloader/libdloader.a
54 .endif
55
56 # Always add MI sources 
57 .PATH:          ${.CURDIR}/../../common
58 .include        <${.CURDIR}/../../common/Makefile.inc>
59 CFLAGS+=        -I${.CURDIR}/../../common
60 CFLAGS+=        -I${.CURDIR}/../../.. -I.
61
62 CLEANFILES+=    vers.c ${BASE}.help
63
64 CFLAGS+=        -ffreestanding
65 LDFLAGS=        -nostdlib -static
66
67 # Openfirmware standalone support library
68 LIBOFW=         ${.OBJDIR}/../../ofw/libofw/libofw.a
69 CFLAGS+=        -I${.CURDIR}/../../ofw/libofw/
70
71 # where to get libstand from
72 #XXX need a better way to do this
73 LIBSTAND=       ${.CURDIR}/../../../../lib/libstand/libstand.a
74 .if !exists(${LIBSTAND})
75 LIBSTAND=       ${.OBJDIR}/../../../../lib/libstand/libstand.a
76 .if !exists(${LIBSTAND})
77 LIBSTAND=       -lstand
78 .endif
79 .endif
80 CFLAGS+=        -I${.CURDIR}/../../../../lib/libstand/
81
82 LDADD=          ${LIBDLOADER} ${LIBOFW} ${LIBSTAND}
83
84 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
85         sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
86
87 ${BASE}.help: help.common help.sparc64
88         cat ${.ALLSRC} | \
89             awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
90
91 .PATH: ${.CURDIR}/../../dloader
92 FILES=  ${BASE}.help dloader.conf
93 FILESDIR_loader.conf=   /boot/defaults
94
95 .if !exists(${DESTDIR}/boot/rloader.rc)
96 FILES+= rloader.rc
97 .endif
98
99 # There are no things relevant to all boot parts of FreeBSD/sparc64 yet.
100 #.include <${.CURDIR}/../Makefile.inc>
101
102 .include <bsd.prog.mk>
103
104 .if exists(${.CURDIR}/../../../sparc64/include)
105 beforedepend ${OBJS}: machine
106
107 machine:
108         ${LN} -sf ${.CURDIR}/../../../sparc64/include machine
109 .endif
110
111 CLEANFILES+=    machine