xref: /netbsd-src/sys/arch/prep/stand/boot/Makefile (revision 4b896b232495b7a9b8b94a1cf1e21873296d53b8)
1#	$NetBSD: Makefile,v 1.14 2004/03/10 15:17:01 nonaka 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
56realdepend realall: machine powerpc
57
58machine::
59	-rm -f $@
60	ln -s ${S}/arch/${MACHINE}/include $@
61
62powerpc::
63	-rm -f $@
64	ln -s ${S}/arch/powerpc/include $@
65
66vers.c: ${.CURDIR}/../boot/version
67	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT}
68
69${PROG}: ${OBJS} machine powerpc
70	${LD} -o ${PROG} -s -N -T ${.CURDIR}/../boot/ld.script \
71		-Ttext ${RELOC} ${OBJS} ${LIBS}
72
73.include <bsd.prog.mk>
74