Makefile revision 1.9
1#	$NetBSD: Makefile,v 1.9 2003/09/30 18:58:39 matt 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+= -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
30
31.if (${BASE} == "boot")
32CPPFLAGS+= -DCONS_VGA
33#CPPFLAGS+= -DCONS_FB
34.elif (${BASE} == "boot_com0")
35CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3f8
36.endif
37
38OBJDUMP?= objdump
39STRIPFLAG=
40BINMODE= 444
41
42RELOC= 0x800000
43HEAD_SIZE= `${OBJDUMP} -h ${.OBJDIR}/${PROG} | grep \.text | awk '{print $$6}'`
44KERN_OFFSET= `ls -l ${.OBJDIR}/${PROG} | awk '{print $$5}'`
45
46CLEANFILES+= vers.c machine powerpc
47
48LIBS= ${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
49
50.BEGIN: machine powerpc
51.NOPATH: machine powerpc
52realdepend realall: machine powerpc
53
54machine::
55	-rm -f $@
56	ln -s ${S}/arch/${MACHINE}/include $@
57
58powerpc::
59	-rm -f $@
60	ln -s ${S}/arch/powerpc/include $@
61
62vers.c: ${.CURDIR}/../boot/version
63	sh ${S}/conf/newvers_stand.sh ${.CURDIR}/../boot/version "prep" ${NEWVERSWHAT}
64
65${PROG}: ${OBJS} machine powerpc
66	${LD} -o ${PROG} -s -N -T ${.CURDIR}/../boot/ld.script \
67		-Ttext ${RELOC} ${OBJS} ${LIBS}
68	${COMPILE.c} -DKERN_OFFSET=${KERN_OFFSET} -DHEAD_SIZE=0x${HEAD_SIZE} \
69		${.CURDIR}/../boot/inkernel.c
70	${LD} -o ${PROG} -s -N -T ${.CURDIR}/../boot/ld.script \
71		-Ttext ${RELOC} ${OBJS} ${LIBS}
72
73.include <bsd.prog.mk>
74