mirror of
https://github.com/darlinghq/darling.git
synced 2024-11-27 06:10:36 +00:00
5f96f6c7fb
This makes it easy to add the folder to PATH and run commands
26 lines
240 B
Bash
Executable File
26 lines
240 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cfile=/tmp/valueof.$$.c
|
|
include="$1"
|
|
var="$2"
|
|
|
|
cat > $cfile <<END
|
|
#include <stdio.h>
|
|
#include <$include>
|
|
|
|
int main()
|
|
{
|
|
printf("$var=%d\n", $var);
|
|
return 0;
|
|
}
|
|
|
|
END
|
|
|
|
gcc -w $3 $cfile -o $cfile.bin
|
|
$cfile.bin
|
|
|
|
rm $cfile*
|
|
|