Makefile.buildboot revision 1.5 1 # $NetBSD: Makefile.buildboot,v 1.5 2003/10/26 07:25:35 lukem 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: machine ${MACHINE_ARCH}
36 .NOPATH: machine ${MACHINE_ARCH}
37 .endif
38
39 realdepend realall: machine ${MACHINE_ARCH}
40 CLEANFILES+= machine ${MACHINE_ARCH}
41
42 machine::
43 -rm -f $@
44 ln -s $S/arch/acorn32/include $@
45
46 ${MACHINE_ARCH}::
47 -rm -f $@
48 ln -s $S/arch/${MACHINE_ARCH}/include $@
49
50 ${OBJS}: 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 RELOC=8000
79 # -N (OMAGIC) since we don't need a gap between text and data.
80 LINKFLAGS=-N
81
82 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS}
83 ${LD} -o ${.TARGET} ${LINKFLAGS} -Ttext ${RELOC} ${OBJS} \
84 ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS} ${LIBSA}
85 ${SIZE} ${.TARGET}
86
87 ${PROG},${RISCOSTYPE}: ${PROG}
88 ${OBJCOPY} --output-target=binary ${.ALLSRC} ${.TARGET}
89
90 realall: ${PROG},${RISCOSTYPE}
91
92 CLEANFILES+= ${PROG},${RISCOSTYPE}
93 FILES+= ${PROG},${RISCOSTYPE}
94
95 .include <bsd.prog.mk>
96