Makefile revision 1.17
1#	$NetBSD: Makefile,v 1.17 2003/10/08 01:36:19 simonb Exp $
2
3S= ${.CURDIR}/../../../..
4
5BOOTPROG= boot
6NEWVERSWHAT= "BOOT"
7
8ASRCS+= srt0.s
9CSRCS+= boot.c clock.c com.c conf.c cons.c cpu.c devopen.c
10CSRCS+= fd.c filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
11CSRCS+= kbd.c ns16550.c vreset.c vga.c video.c
12
13CLEANFILES+= vers.c vers.o ${BOOTPROG}
14
15COPTS+= -ffreestanding
16CPPFLAGS= -I${.CURDIR} -I${.CURDIR}/../elf2pef -I${.CURDIR}/../../..
17CPPFLAGS+= -I${S} -I${S}/lib/libsa
18CPPFLAGS+= -D_STANDALONE -DDBMONITOR -DRELOC=${RELOC}
19CPPFLAGS+= -DUSE_SCAN
20#CPPFLAGS+= -DCONS_BE
21CPPFLAGS+= -DCONS_VGA
22#CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3F8
23
24AOBJS=	${ASRCS:.s=.o}
25COBJS=	${CSRCS:.c=.o}
26OBJS=	${AOBJS} ${COBJS}
27CFLAGS= -Wno-main
28AFLAGS= -x assembler-with-cpp -traditional-cpp
29NOMAN=	# defined
30STRIPFLAG=
31BINMODE= 444
32
33RELOC= 0x700000
34
35.BEGIN:
36	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
37	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
38.NOPATH: machine powerpc
39CLEANFILES+= machine powerpc
40
41### find out what to use for libkern
42KERN_AS=	library
43.include "${S}/lib/libkern/Makefile.inc"
44LIBKERN=	${KERNLIB}
45
46### find out what to use for libz
47Z_AS=		library
48.include "${S}/lib/libz/Makefile.inc"
49LIBZ=		${ZLIB}
50
51### find out what to use for libsa
52SA_AS=		library
53SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
54.include "${S}/lib/libsa/Makefile.inc"
55LIBSA=		${SALIB}
56
57.PHONY: vers.c
58vers.c: version
59	sh ${S}/conf/newvers_stand.sh ${.CURDIR}/version "bebox" ${NEWVERSWHAT}
60
61realall: ${BOOTPROG}
62
63${BOOTPROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} vers.o
64	${LD} -o ${BOOTPROG} -s -N -T ${.CURDIR}/ld.script -Ttext ${RELOC} ${OBJS} \
65		${LIBSA} ${LIBZ} ${LIBKERN} vers.o
66
67cleandir distclean: cleanlibdir
68
69cleanlibdir:
70	rm -rf lib
71
72.include <bsd.prog.mk>
73