Ziran now generates C, Go, Python and portable .zx. zi2cpp, zi2rust, the C++ mode of the shared C emitter, the Plan 9 post-pass and the std Plan 9 modules are gone; --target=cpp|rust|plan9-c and zi2c --plan9 are rejected as unknown targets. Generated C headers keep avoiding C++ keywords in exported names, so C++ hosts can still include them.
16 lines
541 B
Bash
Executable File
16 lines
541 B
Bash
Executable File
#!/bin/sh
|
|
# Write a C source holding each runtime header's text, so zi2c
|
|
# can copy the headers a program includes next to its generated code.
|
|
set -eu
|
|
echo '/* Generated by scripts/embed_headers.sh. Do not edit. */'
|
|
echo '#include "zir_runtime.h"'
|
|
echo '#include <stddef.h>'
|
|
echo 'const ZirRuntimeHeader ZirRuntimeHeaders[] = {'
|
|
for header in "$@"; do
|
|
printf ' {"%s",\n' "$(basename "$header")"
|
|
sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/ "/' -e 's/$/\\n"/' "$header"
|
|
echo ' },'
|
|
done
|
|
echo ' {NULL, NULL}'
|
|
echo '};'
|