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