Makefile.buildboot revision 1.3 1 # $NetBSD: Makefile.buildboot,v 1.3 2003/09/21 14:17:13 matt Exp $
2
3 S?= ${.CURDIR}/../../../..
4
5 .PATH: ${.CURDIR}/../lib
6
7 SRCS= ${PROGSOURCE}
8 NOMAN=# defined
9 BINDIR=/usr/mdec
10 BINMODE=444
11 FILESDIR=/usr/mdec
12
13 RISCOSTYPE ?= ff8
14
15 SRCS+= vers.c
16 CLEANFILES+= vers.c
17 .PHONY: vers.c
18 vers.c: ${.CURDIR}/version
19 sh ${S}/conf/newvers_stand.sh ${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT}
20
21 CPPFLAGS+= -D_STANDALONE
22 CPPFLAGS+= -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
23 CPPFLAGS+= -I${.CURDIR}/../lib
24 CFLAGS= -O2
25 CFLAGS+= -ffreestanding
26 CFLAGS+= -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
33 realdepend realall: machine ${MACHINE_ARCH}
34 CLEANFILES+= machine ${MACHINE_ARCH}
35
36 machine::
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
47 KERN_AS= library
48 .include "${S}/lib/libkern/Makefile.inc"
49 LIBKERN= ${KERNLIB}
50
51 ### find out what to use for libz
52 Z_AS= library
53 .include "${S}/lib/libz/Makefile.inc"
54 LIBZ= ${ZLIB}
55
56 ### find out what to use for libsa
57 SA_AS= library
58 SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no SA_USE_LOADFILE=yes SA_USE_CREAD=yes
59 CPPFLAGS+= -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"
65 LIBSA= ${SALIB}
66
67 ### find out what to use for libriscos
68 RISCOS_AS= library
69 .include "${S}/arch/acorn32/stand/lib/Makefile.inc"
70 LIBRISCOS= ${RISCOSLIB}
71
72 RELOC=8000
73 # -N (OMAGIC) since we don't need a gap between text and data.
74 LINKFLAGS=-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
84 realall: ${PROG},${RISCOSTYPE}
85
86 CLEANFILES+= ${PROG},${RISCOSTYPE}
87 FILES+= ${PROG},${RISCOSTYPE}
88
89 .include <bsd.prog.mk>
90