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