Makefile revision 1.18
1#	$NetBSD: Makefile,v 1.18 2006/04/10 17:58:59 garbled 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
21SRCS+= filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
22SRCS+= kbd.c ns16550.c vers.c vreset.c vga.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 -DRELOC=${RELOC} -DUSE_SCAN
30CPPFLAGS+= -D__daddr_t=int32_t
31#CPPFLAGS+= -DDBMONITOR
32
33.if (${BASE} == "boot")
34CPPFLAGS+= -DCONS_VGA
35#CPPFLAGS+= -DCONS_FB
36.elif (${BASE} == "boot_com0")
37CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8
38.endif
39
40STRIPFLAG=
41BINMODE= 444
42
43# XXX SHOULD NOT NEED TO DEFINE THESE!
44LIBCRT0=
45LIBC=
46LIBCRTBEGIN=
47LIBCRTEND=
48
49RELOC= 0x800000
50
51CLEANFILES+= vers.c machine powerpc
52
53LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
54
55.if !make(obj) && !make(clean) && !make(cleandir)
56.BEGIN: machine powerpc
57.NOPATH: machine powerpc
58
59machine::
60	-rm -f $@
61	ln -s ${S}/arch/${MACHINE}/include $@
62
63powerpc::
64	-rm -f $@
65	ln -s ${S}/arch/powerpc/include $@
66.endif
67
68vers.c: ${.CURDIR}/../boot/version
69	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT}
70
71${PROG}: ${OBJS} ${LIBS}
72	${LD} -o ${PROG} -s -N -T ${.CURDIR}/../boot/ld.script \
73		-Ttext ${RELOC} ${OBJS} ${LIBS}
74
75.include <bsd.prog.mk>
76