NetBSD/external/lgpl3/gmp/Makefile.netbsd-gmp

33 lines
1.1 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile.netbsd-gmp,v 1.5 2017/08/22 09:57:18 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}
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>