Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

#	$NetBSD: Makefile.buildboot,v 1.24 2017/04/09 16:29:46 christos Exp $

S?=	${.CURDIR}/../../../..

.PATH: ${.CURDIR}/../lib

KLINK_MACHINE= acorn32

SRCS=	${PROGSOURCE}
NOMAN=# defined
BINDIR=/usr/mdec
BINMODE=444
FILESDIR=/usr/mdec

# XXX SHOULD NOT NEED TO DEFINE THESE!
LIBCRT0=
LIBCRTI=
LIBC=
LIBCRTBEGIN=
LIBCRTEND=

MKMODULE?=no
.if ${MKMODULE} == "yes"
RISCOSTYPE ?= ffa
LINKFLAGS+=-shared -Bsymbolic --no-undefined -T ${.CURDIR}/../module.ldscript
CFLAGS+=-DRISCOS_MODULE
.else
RISCOSTYPE ?= ff8
RELOC=8000
# -N (OMAGIC) since we don't need a gap between text and data.
LINKFLAGS+=-N -Ttext ${RELOC}
.endif

.include "${S}/conf/newvers_stand.mk"

.include <bsd.own.mk>
.include <bsd.klinks.mk>

CPPFLAGS+=	-D_STANDALONE 
CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
CPPFLAGS+=	-I${.CURDIR}/../lib
CPPFLAGS+=	${ARM_APCS_FLAGS} -march=armv3m
CPPFLAGS+=	-marm
CPUFLAGS=
CFLAGS=		-O2
CFLAGS+=	-ffreestanding -fno-unwind-tables
CFLAGS+=	-Wall -Wstrict-prototypes -Wmissing-prototypes

CLEANFILES+= machine ${MACHINE_ARCH}

### 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
CPPFLAGS+=	-DLIBSA_NO_RAW_ACCESS \
		-DHEAP_VARIABLE
.include "${S}/lib/libsa/Makefile.inc"
LIBSA=		${SALIB}

### find out what to use for libriscos
RISCOS_AS=		library
.include "${S}/arch/acorn32/stand/lib/Makefile.inc"
LIBRISCOS=		${RISCOSLIB}

${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS}
	${_MKTARGET_LINK}
	${LD} -o ${.TARGET} ${LINKFLAGS} ${OBJS} \
	    --start-group ${LIBSA} ${LIBZ} ${LIBRISCOS} ${LIBKERN} --end-group
	${SIZE} ${.TARGET}

${PROG},${RISCOSTYPE}: ${PROG}
	${_MKTARGET_CREATE}
	${OBJCOPY} --output-target=binary ${.ALLSRC} ${.TARGET}

realall: ${PROG},${RISCOSTYPE}

CLEANFILES+=	${PROG},${RISCOSTYPE}
FILES+=		${PROG},${RISCOSTYPE}

.include <bsd.prog.mk>