Makefile.buildboot revision 1.14 1 # $NetBSD: Makefile.buildboot,v 1.14 2011/01/22 19:19:14 joerg 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 # XXX SHOULD NOT NEED TO DEFINE THESE!
14 LIBCRT0=
15 LIBC=
16 LIBCRTBEGIN=
17 LIBCRTEND=
18
19 MKMODULE?=no
20 .if ${MKMODULE} == "yes"
21 RISCOSTYPE ?= ffa
22 LINKFLAGS+=-shared -Bsymbolic --no-undefined -T ${.CURDIR}/../module.ldscript
23 CFLAGS+=-DRISCOS_MODULE
24 .else
25 RISCOSTYPE ?= ff8
26 RELOC=8000
27 # -N (OMAGIC) since we don't need a gap between text and data.
28 LINKFLAGS+=-N -Ttext ${RELOC}
29 .endif
30
31 .include <bsd.own.mk>
32
33 SRCS+= vers.c
34 CLEANFILES+= vers.c
35 .PHONY: vers.c
36 vers.c: ${.CURDIR}/version
37 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
38 ${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT}
39
40 CPPFLAGS+= -D_STANDALONE
41 CPPFLAGS+= -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
42 CPPFLAGS+= -I${.CURDIR}/../lib
43 CFLAGS= -O2
44 CFLAGS+= -ffreestanding
45 CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes
46
47 .if !make(obj) && !make(clean) && !make(cleandir)
48 .BEGIN:
49 -rm -f machine ${MACHINE_ARCH}
50 ln -s $S/arch/${MACHINE}/include machine
51 ln -s $S/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH}
52 .endif
53
54 CLEANFILES+= machine ${MACHINE_ARCH}
55
56 ### find out what to use for libkern
57 KERN_AS= library
58 .include "${S}/lib/libkern/Makefile.inc"
59 LIBKERN= ${KERNLIB}
60
61 ### find out what to use for libz
62 Z_AS= library
63 .include "${S}/lib/libz/Makefile.inc"
64 LIBZ= ${ZLIB}
65
66 ### find out what to use for libsa
67 SA_AS= library
68 SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no
69 CPPFLAGS+= -DLIBSA_NO_RAW_ACCESS \
70 -DHEAP_VARIABLE
71 .include "${S}/lib/libsa/Makefile.inc"
72 LIBSA= ${SALIB}
73
74 ### find out what to use for libriscos
75 RISCOS_AS= library
76 .include "${S}/arch/acorn32/stand/lib/Makefile.inc"
77 LIBRISCOS= ${RISCOSLIB}
78
79 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS}
80 ${_MKTARGET_LINK}
81 ${LD} -o ${.TARGET} ${LINKFLAGS} ${OBJS} \
82 --start-group ${LIBSA} ${LIBZ} ${LIBRISCOS} ${LIBKERN} --end-group
83 ${SIZE} ${.TARGET}
84
85 ${PROG},${RISCOSTYPE}: ${PROG}
86 ${_MKTARGET_CREATE}
87 ${OBJCOPY} --output-target=binary ${.ALLSRC} ${.TARGET}
88
89 realall: ${PROG},${RISCOSTYPE}
90
91 CLEANFILES+= ${PROG},${RISCOSTYPE}
92 FILES+= ${PROG},${RISCOSTYPE}
93
94 .include <bsd.prog.mk>
95