8c436a9898
XXX: probabry we should have bsd.saprog.mk or something.
91 lines
2.1 KiB
Makefile
91 lines
2.1 KiB
Makefile
# $NetBSD: Makefile.buildboot,v 1.21 2014/01/12 15:26:28 tsutsui Exp $
|
|
|
|
S?= ${.CURDIR}/../../../..
|
|
|
|
.PATH: ${.CURDIR}/../lib
|
|
|
|
KLINK_MACHINE= acorn26
|
|
SRCS= ${PROGSOURCE}
|
|
NOMAN=# defined
|
|
BINDIR=/usr/mdec
|
|
BINMODE=444
|
|
FILESDIR=/usr/mdec
|
|
|
|
# XXX SHOULD NOT NEED TO DEFINE THESE!
|
|
LIBCRT0=
|
|
LIBCRTI=
|
|
LIBC=
|
|
LIBCRTBEGIN=
|
|
LIBCRTEND=
|
|
|
|
RISCOSTYPE ?= ff8
|
|
|
|
.include <bsd.own.mk>
|
|
.include <bsd.klinks.mk>
|
|
|
|
SRCS+= vers.c
|
|
CLEANFILES+= vers.c
|
|
.PHONY: vers.c
|
|
vers.c: ${.CURDIR}/version
|
|
${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
|
|
${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT}
|
|
|
|
CPUFLAGS=
|
|
CPPFLAGS+= -D_STANDALONE -DHIMEM=0x28000
|
|
CPPFLAGS+= -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
|
|
CPPFLAGS+= -I${.CURDIR}/../lib
|
|
CPPFLAGS+= ${ARM_APCS_FLAGS} -march=armv2
|
|
.if ${HAVE_GCC} < 48
|
|
CPPFLAGS+= -mno-thumb -mno-thumb-interwork
|
|
.else
|
|
CPPFLAGS+= -marm
|
|
.endif
|
|
CFLAGS= -O2
|
|
CFLAGS+= -ffreestanding -fno-unwind-tables
|
|
CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes
|
|
|
|
### find out what to use for libkern
|
|
KERN_AS= library
|
|
.include "${S}/lib/libkern/Makefile.inc"
|
|
LIBKERN= ${KERNLIB}
|
|
|
|
### find out what to use for libz
|
|
Z_AS= library
|
|
.include "${S}/lib/libz/Makefile.inc"
|
|
LIBZ= ${ZLIB}
|
|
|
|
### find out what to use for libsa
|
|
SA_AS= library
|
|
SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no SA_USE_LOADFILE=yes SA_USE_CREAD=yes
|
|
CPPFLAGS+= -DLIBSA_NO_RAW_ACCESS \
|
|
-DLIBSA_SINGLE_FILESYSTEM=riscos \
|
|
-DLIBSA_NO_FS_WRITE \
|
|
-DHEAP_VARIABLE
|
|
.include "${S}/lib/libsa/Makefile.inc"
|
|
LIBSA= ${SALIB}
|
|
|
|
### find out what to use for libriscos
|
|
RISCOS_AS= library
|
|
.include "${S}/arch/acorn26/stand/lib/Makefile.inc"
|
|
LIBRISCOS= ${RISCOSLIB}
|
|
|
|
RELOC=8000
|
|
# -N (OMAGIC) since we don't need a gap between text and data.
|
|
LINKFLAGS=-N
|
|
|
|
${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS}
|
|
${_MKTARGET_LINK}
|
|
${LD} -o ${.TARGET} ${LINKFLAGS} -Ttext ${RELOC} ${OBJS} \
|
|
${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS} ${LIBSA}
|
|
${SIZE} ${.TARGET}
|
|
|
|
${PROG},${RISCOSTYPE}: ${PROG}
|
|
${OBJCOPY} --output-target=binary ${.ALLSRC} ${.TARGET}
|
|
|
|
realall: ${PROG},${RISCOSTYPE}
|
|
|
|
CLEANFILES+= ${PROG},${RISCOSTYPE}
|
|
FILES+= ${PROG},${RISCOSTYPE}
|
|
|
|
.include <bsd.prog.mk>
|