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.bootxx,v 1.9 2016/09/08 14:42:33 christos Exp $

NOMAN		=
NOPIE		=

.include <bsd.init.mk>

BINMODE		= 0444

S		= ${.CURDIR}/../../../..
COMMON		= ${.CURDIR}/../common

.PATH:		${COMMON}

PROG		= ${BASE}
SRCS		+= entry.S bootxx.c
SRCS		+= boot_device.c floppy_2d.c floppy_2hd_ibmpc.c
#SRCS		+= floppy_2hc.c
BINMODE		= 444

LINKFLAGS	= -T ${COMMON}/bootxx.ldscript -S -N
MIPSFLAGS	= -mips1 -G 0 -mno-abicalls
DEBUGFLAGS	= -Wall -Werror
DEBUGFLAGS	+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
DEBUGFLAGS	+= -Wno-format-zero-length -Wno-sign-compare
OPTFLAGS	= -Os -mmemcpy -fno-unwind-tables
FLAGS		= ${MIPSFLAGS} ${DEBUGFLAGS} ${OPTFLAGS}
AFLAGS		= -xassembler-with-cpp -D_LOCORE ${FLAGS}
CFLAGS		= ${FLAGS} -ffreestanding

CPPFLAGS	+= -D_STANDALONE
CPPFLAGS	+= -nostdinc -I${.OBJDIR} -I${COMMON} -I${S}
CPPFLAGS	+= -D__daddr_t=int32_t

CLEANFILES	+= ${PROG} ${PROG}.bin ${PROG}.elf ${PROG}.tmp

KERN_AS		= library
.include	"${S}/lib/libkern/Makefile.inc"
LIBKERN		= ${KERNLIB}

LIBS		= ${LIBKERN}

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

${PROG}: ${OBJS} ${LIBS}
	${_MKTARGET_LINK}
	${LD} ${LINKFLAGS} -o ${PROG}.elf ${OBJS} ${LIBS}
	${OBJCOPY} -O binary ${PROG}.elf ${BASE}.bin
	ls -al ${BASE}.bin
	dd if=${BASE}.bin of=${PROG}.tmp bs=4096 conv=sync
	mv ${PROG}.tmp ${PROG}
	ls -al ${PROG}
#	-rm -f ${BASE}.tmp

cleandir distclean: .WAIT cleanlibdir

cleanlibdir:
	-rm -rf lib

.include <bsd.klinks.mk>
.include <bsd.prog.mk>