Makefile revision 1.7
1#	$NetBSD: Makefile,v 1.7 1999/06/24 01:10:31 sakamoto Exp $
2
3S= ${.CURDIR}/../../../..
4
5BASE= boot
6BOOTPROG= ${BASE}.pef
7NEWVERSWHAT= "BOOT"
8
9ASRCS+= srt0.s
10CSRCS+= boot.c clock.c com.c conf.c cons.c cpu.c devopen.c
11CSRCS+= fd.c filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
12CSRCS+= kbd.c ns16550.c vreset.c vga.c video.c
13
14CLEANFILES+= vers.c vers.o netbsd.gz ${BASE} ${BOOTPROG} elf2pef
15
16CPPFLAGS= -I${.CURDIR} -I${.CURDIR}/../../.. -I${S} -I${S}/lib/libsa
17CPPFLAGS+= -D_STANDALONE -DDBMONITOR -DRELOC=${RELOC} -DENTRY=${ENTRY}
18#CPPFLAGS+= -DUSE_SCAN
19#CPPFLAGS+= -DCONS_BE
20#CPPFLAGS+= -DCONS_VGA
21CPPFLAGS+= -DCONS_SERIAL -DCOMSPEED=9600 -DCOMPORT=0x3F8
22
23AOBJS=	${ASRCS:.s=.o}
24COBJS=	${CSRCS:.c=.o}
25OBJS=	${AOBJS} ${COBJS}
26AFLAGS= -x assembler-with-cpp -traditional-cpp
27MKMAN=	no
28STRIPFLAG=
29BINMODE= 444
30
31ENTRY= 0x3100
32RELOC= 0x700000
33
34CLEANFILES+= ${.OBJDIR}/machine ${.OBJDIR}/powerpc
35
36.BEGIN:
37	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
38	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
39
40KERNEL?= ${S}/arch/bebox/compile/GENERIC/netbsd
41
42### find out what to use for libkern
43KERN_AS=	library
44.include "${S}/lib/libkern/Makefile.inc"
45LIBKERN=	${KERNLIB}
46
47### find out what to use for libz
48Z_AS=		library
49.include "${S}/lib/libz/Makefile.inc"
50LIBZ=		${ZLIB}
51
52### find out what to use for libsa
53SA_AS=		library
54SAMISCMAKEFLAGS= SA_USE_CREAD=yes
55.include "${S}/lib/libsa/Makefile.inc"
56LIBSA=		${SALIB}
57
58all: ${BOOTPROG}
59
60${BOOTPROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} elf2pef
61	sh ${.CURDIR}/../newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
62	${COMPILE.c} vers.c
63	${LD} -o ${BASE} -s -N -T ld.script -Ttext ${RELOC} ${OBJS} \
64		${LIBSA} ${LIBZ} ${LIBKERN} vers.o
65.if exists (${KERNEL})
66	cat ${KERNEL} | gzip -9 > ${.CURDIR}/netbsd.gz
67	${.CURDIR}/elf2pef ${BASE} $@ ${.CURDIR}/netbsd.gz
68.else
69	${.CURDIR}/elf2pef ${BASE} $@
70.endif
71
72
73elf2pef: elf2pef.c pef.h
74	${HOST_LINK.c} -I/usr/include -I${.CURDIR} \
75		-DENTRY=${ENTRY} -o ${.TARGET} ${.IMPSRC}
76
77.include <bsd.prog.mk>
78