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