Makefile revision 40884
1# $Id: Makefile,v 1.17 1998/11/04 02:36:18 jkh Exp $
2
3BASE=		loader
4PROG=		${BASE}
5NOMAN=
6STRIP=
7NEWVERSWHAT=	"bootstrap loader"
8BINDIR?=	/boot
9
10# architecture-specific loader code
11SRCS=		main.c conf.c
12
13# Enable PnP and ISA-PnP code.
14HAVE_PNP=	yes
15HAVE_ISABUS=	yes
16
17# Enable BootForth
18#BOOT_FORTH=	yes
19#CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl
20#.if exists(${.OBJDIR}/../../ficl/libficl.a)
21#LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
22#.else
23#LIBFICL=	${.CURDIR}/../../ficl/libficl.a
24#.endif
25
26# Always add MI sources 
27.PATH:		${.CURDIR}/../../common
28.include	<${.CURDIR}/../../common/Makefile.inc>
29CFLAGS+=	-I${.CURDIR}/../../common
30CFLAGS+=	-I${.CURDIR}/../../.. -I.
31
32CLEANFILES+=	vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym
33
34CFLAGS+=	-Wall
35LDFLAGS=	-nostdlib -static -Ttext 0x1000
36
37# i386 standalone support library
38LIBI386=	${.OBJDIR}/../libi386/libi386.a
39CFLAGS+=	-I${.CURDIR}/..
40
41# where to get libstand from
42LIBSTAND=	-lstand
43#LIBSTAND=	${.CURDIR}/../../../lib/libstand/libstand.a
44#CFLAGS+=	-I${.CURDIR}/../../../lib/libstand/
45
46# BTX components
47.if exists(${.OBJDIR}/../btx)
48BTXDIR=		${.OBJDIR}/../btx
49.else
50BTXDIR=		${.CURDIR}/../btx
51.endif
52BTXLDR=		${BTXDIR}/btxldr/btxldr
53BTXKERN=	${BTXDIR}/btx/btx
54BTXCRT=		${BTXDIR}/lib/crt0.o
55CFLAGS+=	-I${.CURDIR}/../btx/lib
56
57# BTX is expecting ELF components
58CFLAGS+=	-elf
59
60# New linker set code
61CFLAGS+=	-DNEW_LINKER_SET
62
63# Debug me!
64#CFLAGS+=	-g
65#LDFLAGS+=	-g
66
67vers.o:
68	sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
69	${CC} -c vers.c
70
71${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
72	btxld -v -f aout -e 0x100000 -o ${.TARGET} -l ${BTXLDR} -b ${BTXKERN} \
73		${BASE}.bin
74
75${BASE}.bin: ${BASE}.sym
76	cp ${.ALLSRC} ${.TARGET}
77	strip ${.TARGET}
78
79# Cannot use ${OBJS} above this line
80.include <bsd.prog.mk>
81
82${BASE}.sym: ${OBJS} ${LIBI386} ${LIBSTAND} ${LIBFICL} vers.o
83	${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
84		${LIBFICL} ${LIBSTAND} ${LIBI386} ${LIBSTAND}
85
86# If it's not there, don't consider it a target
87.if exists(${.CURDIR}/../../../i386/include)
88beforedepend ${OBJS}: machine
89
90machine:
91	ln -sf ${.CURDIR}/../../../i386/include machine
92
93.endif
94
95CLEANFILES+=	machine
96
97
98