Makefile.buildboot revision 1.1
1#	$NetBSD: Makefile.buildboot,v 1.1 2002/12/28 23:57:36 reinoud 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+=	-Wall -Wstrict-prototypes -Wmissing-prototypes
26
27.if !make(obj) && !make(clean) && !make(cleandir)
28.BEGIN: machine
29.NOPATH: machine
30.endif
31
32realdepend realall: machine
33CLEANFILES+= machine
34
35machine::
36	-rm -f $@
37	ln -s $S/arch/acorn32/include $@
38
39${OBJS}: machine
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_INCLUDE_NET=no SA_USE_LOADFILE=yes SA_USE_CREAD=yes
54CPPFLAGS+=	-DLIBSA_NO_RAW_ACCESS \
55		-DLIBSA_SINGLE_FILESYSTEM=riscos \
56		-DLIBSA_NO_FS_WRITE \
57		-DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET \
58		-DHEAP_VARIABLE
59.include "${S}/lib/libsa/Makefile.inc"
60LIBSA=		${SALIB}
61
62### find out what to use for libriscos
63RISCOS_AS=		library
64.include "${S}/arch/acorn32/stand/lib/Makefile.inc"
65LIBRISCOS=		${RISCOSLIB}
66
67RELOC=8000
68# -N (OMAGIC) since we don't need a gap between text and data.
69LINKFLAGS=-N
70
71${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS}
72	${LD} -o ${.TARGET} ${LINKFLAGS} -Ttext ${RELOC} ${OBJS} \
73	    ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS} ${LIBSA}
74	${SIZE} ${.TARGET}
75
76${PROG},${RISCOSTYPE}: ${PROG}
77	${OBJCOPY} --output-target=binary ${.ALLSRC} ${.TARGET}
78
79realall: ${PROG},${RISCOSTYPE}
80
81CLEANFILES+=	${PROG},${RISCOSTYPE}
82FILES+=		${PROG},${RISCOSTYPE}
83
84.include <bsd.prog.mk>
85