Makefile revision 1.15
1#	$NetBSD: Makefile,v 1.15 2005/05/11 20:19:24 jmc Exp $
2
3NOMAN= # defined
4
5.include <bsd.own.mk>
6
7COMMON= ${.CURDIR}/../common
8COMMONOBJ!=	cd ${COMMON} && ${PRINTOBJDIR}
9
10.PATH: ${.CURDIR}/../boot ${COMMONOBJ}
11
12S= ${.CURDIR}/../../../..
13L= ${COMMONOBJ}/lib
14
15BASE?=		boot
16PROG=		${BASE}
17NEWVERSWHAT=	"BOOT"
18
19SRCS= srt0.s
20SRCS+= boot.c clock.c com.c conf.c cons.c devopen.c fd.c
21SRCS+= filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
22SRCS+= kbd.c ns16550.c vers.c vreset.c vga.c video.c
23
24CFLAGS= -Os -mmultiple -ffreestanding
25AFLAGS= -x assembler-with-cpp -traditional-cpp
26
27CPPFLAGS= -nostdinc -I${.OBJDIR} -I${.CURDIR}/../mkbootimage -I${S}
28CPPFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes
29CPPFLAGS+= -D_STANDALONE -DDBMONITOR -DRELOC=${RELOC} -DUSE_SCAN
30CPPFLAGS+= -D__daddr_t=int32_t
31
32.if (${BASE} == "boot")
33CPPFLAGS+= -DCONS_VGA
34#CPPFLAGS+= -DCONS_FB
35.elif (${BASE} == "boot_com0")
36CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8
37.endif
38
39STRIPFLAG=
40BINMODE= 444
41
42# XXX SHOULD NOT NEED TO DEFINE THESE!
43LIBCRT0=
44LIBC=
45LIBCRTBEGIN=
46LIBCRTEND=
47
48RELOC= 0x800000
49
50CLEANFILES+= vers.c machine powerpc
51
52LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
53
54.BEGIN: machine powerpc
55.NOPATH: machine powerpc
56
57machine::
58	-rm -f $@
59	ln -s ${S}/arch/${MACHINE}/include $@
60
61powerpc::
62	-rm -f $@
63	ln -s ${S}/arch/powerpc/include $@
64
65vers.c: ${.CURDIR}/../boot/version
66	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT}
67
68${PROG}: ${OBJS} ${LIBS}
69	${LD} -o ${PROG} -s -N -T ${.CURDIR}/../boot/ld.script \
70		-Ttext ${RELOC} ${OBJS} ${LIBS}
71
72.include <bsd.prog.mk>
73