Deleted Added
sdiff udiff text old ( 116003 ) new ( 125563 )
full compact
1# $FreeBSD: head/sys/boot/pc98/loader/Makefile 116003 2003-06-08 03:34:49Z nyan $
2
3PROG= loader
4STRIP=
5NEWVERSWHAT= "bootstrap loader" pc98
6BINDIR?= /boot
7INSTALLFLAGS= -b
8
9CFLAGS+= -DPC98
10
11# architecture-specific loader code
12SRCS= main.c conf.c
13.PATH: ${.CURDIR}/../../i386/loader
14
15CFLAGS+= -ffreestanding
16# Enable PXE TFTP or NFS support, not both.
17.if defined(LOADER_TFTP_SUPPORT)
18CFLAGS+= -DLOADER_TFTP_SUPPORT
19.else
20CFLAGS+= -DLOADER_NFS_SUPPORT

--- 18 unchanged lines hidden (view full) ---

39CFLAGS+= -DLOADER_BZIP2_SUPPORT
40.endif
41.if !defined(LOADER_NO_GZIP_SUPPORT)
42CFLAGS+= -DLOADER_GZIP_SUPPORT
43.endif
44
45# Always add MI sources
46.PATH: ${.CURDIR}/../../common
47.include <${.CURDIR}/../../common/Makefile.inc>
48CFLAGS+= -I${.CURDIR}/../../common
49CFLAGS+= -I${.CURDIR}/../../.. -I. -I${.CURDIR}/../../i386
50
51CLEANFILES+= vers.c vers.o ${PROG}.list ${PROG}.bin ${PROG}.sym ${PROG}.help
52
53CFLAGS+= -Wall
54LDFLAGS= -nostdlib -static -Ttext 0x0
55
56# pc98 standalone support library
57LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a
58CFLAGS+= -I${.CURDIR}/..
59
60# where to get libstand from
61#XXX need a better way to do this
62LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
63.if !exists(${LIBSTAND})
64LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
65.if !exists(${LIBSTAND})
66LIBSTAND= -lstand
67.endif
68.endif
69CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
70
71# BTX components
72.if exists(${.OBJDIR}/../btx)
73BTXDIR= ${.OBJDIR}/../btx
74.else
75BTXDIR= ${.CURDIR}/../btx
76.endif
77BTXLDR= ${BTXDIR}/btxldr/btxldr
78BTXKERN= ${BTXDIR}/btx/btx
79BTXCRT= ${BTXDIR}/lib/crt0.o
80CFLAGS+= -I${.CURDIR}/../btx/lib
81
82# BTX is expecting ELF components
83CFLAGS+= -elf
84
85# Debug me!
86#CFLAGS+= -g
87#LDFLAGS+= -g
88
89vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version
90 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT}
91 ${CC} -c vers.c
92
93${PROG}: ${PROG}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
94 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
95 -b ${BTXKERN} ${PROG}.bin
96# /usr/bin/kzip ${.TARGET}
97# mv ${.TARGET}.kz ${.TARGET}
98
99${PROG}.bin: ${PROG}.sym
100 cp ${.ALLSRC} ${.TARGET}
101 strip -R .comment -R .note ${.TARGET}
102
103${PROG}.help: help.common help.pc98
104 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
105
106.PATH: ${.CURDIR}/../../forth
107FILES= ${PROG}.help loader.4th support.4th loader.conf
108FILES+= screen.4th frames.4th beastie.4th
109FILESDIR_loader.conf= /boot/defaults
110
111.if !exists(${DESTDIR}/boot/loader.rc)
112FILES+= ${.CURDIR}/../../i386/loader/loader.rc
113.endif
114
115.include <${.CURDIR}/../Makefile.inc>
116
117# Cannot use ${OBJS} above this line
118.include <bsd.prog.mk>
119
120${PROG}.sym: ${OBJS} ${LIBPC98} ${LIBSTAND} ${LIBFICL} vers.o
121 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
122 ${LIBFICL} ${LIBPC98} ${LIBSTAND}
123
124# If it's not there, don't consider it a target
125.if exists(${.CURDIR}/../../../i386/include)
126beforedepend ${OBJS}: machine
127
128machine:
129 ln -sf ${.CURDIR}/../../../i386/include machine
130
131.endif
132
133CLEANFILES+= machine