Makefile.buildboot revision 1.3
1#	$NetBSD: Makefile.buildboot,v 1.3 2003/09/21 14:17:13 matt Exp $
2
3S?=	${.CURDIR}/../../../..
4
5.PATH: ${.CURDIR}/../lib
6
7SRCS=	${PROGSOURCE}
8NOMAN=# defined
9BINDIR=/usr/mdec
10BINMODE=444
11FILESDIR=/usr/mdec
12
13RISCOSTYPE ?= ff8
14
15SRCS+=		vers.c
16CLEANFILES+=	vers.c
17.PHONY: vers.c
18vers.c: ${.CURDIR}/version
19	sh ${S}/conf/newvers_stand.sh ${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT}
20
21CPPFLAGS+=	-D_STANDALONE 
22CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../.. 
23CPPFLAGS+=	-I${.CURDIR}/../lib
24CFLAGS=		-O2
25CFLAGS+=	-ffreestanding
26CFLAGS+=	-Wall -Wstrict-prototypes -Wmissing-prototypes
27
28.if !make(obj) && !make(clean) && !make(cleandir)
29.BEGIN: machine ${MACHINE_ARCH}
30.NOPATH: machine ${MACHINE_ARCH}
31.endif
32
33realdepend realall: machine ${MACHINE_ARCH}
34CLEANFILES+= machine ${MACHINE_ARCH}
35
36machine::
37	-rm -f $@
38	ln -s $S/arch/acorn32/include $@
39
40${MACHINE_ARCH}::
41	-rm -f $@
42	ln -s $S/arch/${MACHINE_ARCH}/include $@
43
44${OBJS}: machine ${MACHINE_ARCH}
45
46### find out what to use for libkern
47KERN_AS=	library
48.include "${S}/lib/libkern/Makefile.inc"
49LIBKERN=	${KERNLIB}
50
51### find out what to use for libz
52Z_AS=		library
53.include "${S}/lib/libz/Makefile.inc"
54LIBZ=		${ZLIB}
55
56### find out what to use for libsa
57SA_AS=		library
58SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no SA_USE_LOADFILE=yes SA_USE_CREAD=yes
59CPPFLAGS+=	-DLIBSA_NO_RAW_ACCESS \
60		-DLIBSA_SINGLE_FILESYSTEM=riscos \
61		-DLIBSA_NO_FS_WRITE \
62		-DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET \
63		-DHEAP_VARIABLE
64.include "${S}/lib/libsa/Makefile.inc"
65LIBSA=		${SALIB}
66
67### find out what to use for libriscos
68RISCOS_AS=		library
69.include "${S}/arch/acorn32/stand/lib/Makefile.inc"
70LIBRISCOS=		${RISCOSLIB}
71
72RELOC=8000
73# -N (OMAGIC) since we don't need a gap between text and data.
74LINKFLAGS=-N
75
76${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS}
77	${LD} -o ${.TARGET} ${LINKFLAGS} -Ttext ${RELOC} ${OBJS} \
78	    ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS} ${LIBSA}
79	${SIZE} ${.TARGET}
80
81${PROG},${RISCOSTYPE}: ${PROG}
82	${OBJCOPY} --output-target=binary ${.ALLSRC} ${.TARGET}
83
84realall: ${PROG},${RISCOSTYPE}
85
86CLEANFILES+=	${PROG},${RISCOSTYPE}
87FILES+=		${PROG},${RISCOSTYPE}
88
89.include <bsd.prog.mk>
90