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