1 # $NetBSD: Makefile.buildboot,v 1.12 2006/04/02 22:13:32 bjh21 Exp $
3 S?= ${.CURDIR}/../../../..
5 .PATH: ${.CURDIR}/../lib
13 # XXX SHOULD NOT NEED TO DEFINE THESE!
20 .if ${MKMODULE} == "yes"
22 LINKFLAGS+=-shared -Bsymbolic --no-undefined -T ${.CURDIR}/../module.ldscript
23 CFLAGS+=-DRISCOS_MODULE
27 # -N (OMAGIC) since we don't need a gap between text and data.
28 LINKFLAGS+=-N -Ttext ${RELOC}
34 vers.c: ${.CURDIR}/version
35 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT}
37 CPPFLAGS+= -D_STANDALONE
38 CPPFLAGS+= -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
39 CPPFLAGS+= -I${.CURDIR}/../lib
41 CFLAGS+= -ffreestanding
42 CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes
44 .if !make(obj) && !make(clean) && !make(cleandir)
46 -rm -f machine ${MACHINE_ARCH}
47 ln -s $S/arch/${MACHINE}/include machine
48 ln -s $S/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH}
51 CLEANFILES+= machine ${MACHINE_ARCH}
53 ### find out what to use for libkern
55 .include "${S}/lib/libkern/Makefile.inc"
58 ### find out what to use for libz
60 .include "${S}/lib/libz/Makefile.inc"
63 ### find out what to use for libsa
65 SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no
66 CPPFLAGS+= -DLIBSA_NO_RAW_ACCESS \
68 .include "${S}/lib/libsa/Makefile.inc"
71 ### find out what to use for libriscos
73 .include "${S}/arch/acorn32/stand/lib/Makefile.inc"
74 LIBRISCOS= ${RISCOSLIB}
76 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS}
78 ${LD} -o ${.TARGET} ${LINKFLAGS} ${OBJS} \
79 --start-group ${LIBSA} ${LIBZ} ${LIBRISCOS} ${LIBKERN} --end-group
82 ${PROG},${RISCOSTYPE}: ${PROG}
84 ${OBJCOPY} --output-target=binary ${.ALLSRC} ${.TARGET}
86 realall: ${PROG},${RISCOSTYPE}
88 CLEANFILES+= ${PROG},${RISCOSTYPE}
89 FILES+= ${PROG},${RISCOSTYPE}
91 .include <bsd.prog.mk>