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.netbsd-gmp,v 1.6 2020/09/26 20:58:48 mrg Exp $

# hack makefile to help build gmp ./configure

.include <bsd.own.mk>

CCADDFLAGS=	--sysroot=${DESTDIR} -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include

TARGET?=${MACHINE_GNU_PLATFORM}
#TARGET=mips64el-netbsd
ENV_ARGS=\
			CC=${CC:Q}' '${CCADDFLAGS:Q} \
			CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
			AS=${AS:Q} AWK=${TOOL_AWK:Q} LD=${LD:Q} \
			NM=${NM:Q} OBJDUMP=${OBJDUMP:Q} \
			LIBS=-lintl

.include "Makefile.arch"
NEWCONFIGDIR?=	${NETBSDSRCDIR}
ARCHDIR=	${NEWCONFIGDIR}/external/lgpl3/gmp/lib/libgmp/arch/${GMP_MACHINE_ARCH}

all:
	mkdir -p build
	cd build && env ${ENV_ARGS} ${NETBSDSRCDIR}/external/lgpl3/gmp/dist/configure --host=${TARGET} --target=${TARGET}

copy-files:
	cd build && cp gmp.h gmp-mparam.h config.h config.m4 ${ARCHDIR}
	awk -f ${NETBSDSRCDIR}/external/lgpl3/gmp/build-gmp-Makefile.inc.awk < build/config.log > ${ARCHDIR}/srcs.mk
	sed -i -e 's/define.*CONFIG_TOP_SRCDIR.*//' ${ARCHDIR}/config.m4
	sed -i -e 's/__GMP_CC.*/__GMP_CC "gcc"/' ${ARCHDIR}/gmp.h
	sed -i -e 's/GMP_MPARAM_H_SUGGEST[ 	]"\/.*dist\/mpn/GMP_MPARAM_H_SUGGEST ".\/mpn/' ${ARCHDIR}/config.h

.include <bsd.obj.mk>