Deleted Added
sdiff udiff text old ( 125516 ) new ( 125517 )
full compact
1# $FreeBSD: head/sys/boot/i386/loader/Makefile 125517 2004-02-06 12:58:32Z ru $
2
3PROG= loader
4STRIP=
5NEWVERSWHAT= "bootstrap loader" i386
6INSTALLFLAGS= -b
7
8# architecture-specific loader code
9SRCS= main.c conf.c
10
11CFLAGS+= -ffreestanding
12# Enable PXE TFTP or NFS support, not both.
13.if defined(LOADER_TFTP_SUPPORT)
14CFLAGS+= -DLOADER_TFTP_SUPPORT
15.else
16CFLAGS+= -DLOADER_NFS_SUPPORT
17.endif
18
19# Enable PnP and ISA-PnP code.
20HAVE_PNP= yes
21HAVE_ISABUS= yes
22
23.if !defined(NOFORTH)
24# Enable BootForth
25BOOT_FORTH= yes
26CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
27.if exists(${.OBJDIR}/../../ficl/libficl.a)
28LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
29.else
30LIBFICL= ${.CURDIR}/../../ficl/libficl.a
31.endif
32.endif
33
34.if defined(LOADER_BZIP2_SUPPORT)
35CFLAGS+= -DLOADER_BZIP2_SUPPORT
36.endif
37.if !defined(LOADER_NO_GZIP_SUPPORT)
38CFLAGS+= -DLOADER_GZIP_SUPPORT
39.endif
40
41# Always add MI sources
42.PATH: ${.CURDIR}/../../common
43.include "${.CURDIR}/../../common/Makefile.inc"
44CFLAGS+= -I${.CURDIR}/../../common
45CFLAGS+= -I${.CURDIR}/../../.. -I.
46
47CLEANFILES+= vers.c vers.o ${PROG}.list ${PROG}.bin ${PROG}.sym ${PROG}.help
48
49CFLAGS+= -Wall
50LDFLAGS= -nostdlib -static -Ttext 0x0
51
52# i386 standalone support library
53LIBI386= ${.OBJDIR}/../libi386/libi386.a
54CFLAGS+= -I${.CURDIR}/..
55
56# where to get libstand from
57#XXX need a better way to do this
58LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
59.if !exists(${LIBSTAND})
60LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
61.if !exists(${LIBSTAND})
62LIBSTAND= -lstand
63.endif
64.endif
65CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
66
67# BTX components
68.if exists(${.OBJDIR}/../btx)
69BTXDIR= ${.OBJDIR}/../btx
70.else
71BTXDIR= ${.CURDIR}/../btx
72.endif
73BTXLDR= ${BTXDIR}/btxldr/btxldr
74BTXKERN= ${BTXDIR}/btx/btx
75BTXCRT= ${BTXDIR}/lib/crt0.o
76CFLAGS+= -I${.CURDIR}/../btx/lib
77
78# BTX is expecting ELF components
79CFLAGS+= -elf
80
81# Debug me!
82#CFLAGS+= -g
83#LDFLAGS+= -g
84
85vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
86 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
87 ${CC} ${CFLAGS} -c vers.c
88
89${PROG}: ${PROG}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
90 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
91 -b ${BTXKERN} ${PROG}.bin
92# /usr/bin/kzip ${.TARGET}
93# mv ${.TARGET}.kz ${.TARGET}
94
95${PROG}.bin: ${PROG}.sym
96 cp ${.ALLSRC} ${.TARGET}
97 strip -R .comment -R .note ${.TARGET}
98
99${PROG}.help: help.common help.i386
100 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
101
102.PATH: ${.CURDIR}/../../forth
103FILES= ${PROG}.help loader.4th support.4th loader.conf
104FILES+= screen.4th frames.4th beastie.4th
105FILESDIR_loader.conf= /boot/defaults
106
107.if !exists(${DESTDIR}/boot/loader.rc)
108FILES+= ${.CURDIR}/loader.rc
109.endif
110
111# Cannot use ${OBJS} above this line
112.include <bsd.prog.mk>
113
114${PROG}.sym: ${OBJS} ${LIBI386} ${LIBSTAND} ${LIBFICL} vers.o
115 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
116 ${LIBFICL} ${LIBI386} ${LIBSTAND}
117
118# If it's not there, don't consider it a target
119.if exists(${.CURDIR}/../../../i386/include)
120beforedepend ${OBJS}: machine
121
122machine:
123 ln -sf ${.CURDIR}/../../../i386/include machine
124
125.endif
126
127CLEANFILES+= machine