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