]> CyberLeo.Net >> Repos - FreeBSD/releng/8.0.git/blob - sys/boot/i386/loader/Makefile
Adjust to reflect 8.0-RELEASE.
[FreeBSD/releng/8.0.git] / sys / boot / i386 / loader / Makefile
1 # $FreeBSD$
2
3 .include <bsd.own.mk>
4 MK_SSP=         no
5
6 PROG=           loader.sym
7 INTERNALPROG=
8 NEWVERSWHAT=    "bootstrap loader" i386
9
10 # architecture-specific loader code
11 SRCS=           main.c conf.c vers.c
12
13 # Put LOADER_FIREWIRE_SUPPORT=yes in /etc/make.conf for FireWire/dcons support
14 .if defined(LOADER_FIREWIRE_SUPPORT)
15 CFLAGS+=        -DLOADER_FIREWIRE_SUPPORT
16 LIBFIREWIRE=    ${.OBJDIR}/../libfirewire/libfirewire.a
17 .endif
18
19 # Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support
20 .if defined(LOADER_ZFS_SUPPORT)
21 CFLAGS+=        -DLOADER_ZFS_SUPPORT
22 LIBZFS=         ${.OBJDIR}/../../zfs/libzfsboot.a
23 .else
24 LIBZFS=
25 .endif
26
27 # Enable PXE TFTP or NFS support, not both.
28 .if defined(LOADER_TFTP_SUPPORT)
29 CFLAGS+=        -DLOADER_TFTP_SUPPORT
30 .else
31 CFLAGS+=        -DLOADER_NFS_SUPPORT
32 .endif
33
34 # Include bcache code.
35 HAVE_BCACHE=    yes
36
37 # Enable PnP and ISA-PnP code.
38 HAVE_PNP=       yes
39 HAVE_ISABUS=    yes
40
41 .if ${MK_FORTH} != "no"
42 # Enable BootForth
43 BOOT_FORTH=     yes
44 CFLAGS+=        -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
45 LIBFICL=        ${.OBJDIR}/../../ficl/libficl.a
46 .endif
47
48 .if defined(LOADER_BZIP2_SUPPORT)
49 CFLAGS+=        -DLOADER_BZIP2_SUPPORT
50 .endif
51 .if !defined(LOADER_NO_GZIP_SUPPORT)
52 CFLAGS+=        -DLOADER_GZIP_SUPPORT
53 .endif
54 .if !defined(LOADER_NO_GPT_SUPPORT)
55 CFLAGS+=        -DLOADER_GPT_SUPPORT
56 .endif
57
58 # Always add MI sources 
59 .PATH:          ${.CURDIR}/../../common
60 .include        "${.CURDIR}/../../common/Makefile.inc"
61 CFLAGS+=        -I${.CURDIR}/../../common
62 CFLAGS+=        -I.
63
64 CLEANFILES=     vers.c loader loader.bin loader.help
65
66 CFLAGS+=        -Wall
67 LDFLAGS=        -static -Ttext 0x0
68
69 # i386 standalone support library
70 LIBI386=        ${.OBJDIR}/../libi386/libi386.a
71 CFLAGS+=        -I${.CURDIR}/..
72
73 # BTX components
74 CFLAGS+=        -I${.CURDIR}/../btx/lib
75
76 # Debug me!
77 #CFLAGS+=       -g
78 #LDFLAGS+=      -g
79
80 # Pick up ../Makefile.inc early.
81 .include <bsd.init.mk>
82
83 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
84         sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
85
86 loader: loader.bin ${BTXLDR} ${BTXKERN}
87         btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
88                 -b ${BTXKERN} loader.bin
89
90 loader.bin: loader.sym
91         cp ${.ALLSRC} ${.TARGET}
92         strip -R .comment -R .note ${.TARGET}
93
94 loader.help: help.common help.i386
95         cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
96
97 .PATH: ${.CURDIR}/../../forth 
98 FILES=  loader loader.help loader.4th support.4th loader.conf
99 FILES+= screen.4th frames.4th beastie.4th
100 # XXX INSTALLFLAGS_loader= -b
101 FILESMODE_loader= ${BINMODE} -b
102 FILESDIR_loader.conf=   /boot/defaults
103
104 .if !exists(${DESTDIR}/boot/loader.rc)
105 FILES+= loader.rc
106 .endif
107
108 # XXX crt0.o needs to be first for pxeboot(8) to work
109 OBJS=   ${BTXCRT} 
110
111 DPADD=  ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND}
112 LDADD=  ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} -lstand
113
114 .include <bsd.prog.mk>
115
116 .if ${MACHINE_ARCH} == "amd64"
117 beforedepend ${OBJS}: machine
118 CLEANFILES+=    machine
119 machine:
120         ln -sf ${.CURDIR}/../../../i386/include machine
121 .endif