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