-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CC=emcc tests/run.sh
- Loading branch information
Showing
7 changed files
with
85 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
cd $(dirname "${BASH_SOURCE[0]}") | ||
|
||
compfile() { | ||
hexdump -v -e '16/1 "_x%02X" "\n"' $1 | \ | ||
sed 's/_/\\/g; s/\\x //g; s/.*/ "&"/' | ||
echo ";" | ||
} | ||
|
||
compheader() { | ||
echo "// Auto generated file, DO NOT EDIT" | ||
for file in relations/*.jsonc | ||
do | ||
filename=$(basename $file) | ||
filename="${filename%.*}_jsonc" | ||
echo "static const char $filename[] =" | ||
compfile $file | ||
done | ||
echo " | ||
struct relation { | ||
const char *name; | ||
const char *data; | ||
}; | ||
static struct relation relations[] = {" | ||
for file in relations/*.jsonc | ||
do | ||
filename=$(basename $file) | ||
filename="${filename%.*}_jsonc" | ||
printf " { \"%s\", %s },\n" $(basename $file) $filename | ||
done | ||
|
||
echo "};" | ||
} | ||
|
||
compheader > relations.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters