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