From 87bf48fccf89460b8264bb5cedf6b0e966dde563 Mon Sep 17 00:00:00 2001 From: Andres Erbsen Date: Sun, 18 Jun 2017 15:46:40 -0400 Subject: compile X25519 C code from Makefile --- extract-function-header.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 extract-function-header.sh (limited to 'extract-function-header.sh') diff --git a/extract-function-header.sh b/extract-function-header.sh new file mode 100755 index 000000000..e0db91ac9 --- /dev/null +++ b/extract-function-header.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +case "$#" in + 0) + funcname=f + ;; + 1) + funcname="$1" + ;; + *) + exit 111 + ;; +esac + +cat <<"EOF" +#include + +#undef force_inline +#define force_inline __attribute__((always_inline)) + +EOF + +while IFS= read -r line; do + case "$line" in + *"λ '"*) + echo -n "void force_inline $funcname(" + echo -n "uint64_t* out" + echo "$line" | grep -owP -- '\w+\d+' | \ + while IFS= read -r arg; do + echo -n ", uint64_t $arg" + done + echo ');' + break + ;; + esac +done + -- cgit v1.2.3