Add missing file.

This commit is contained in:
David Given 2019-02-07 23:01:10 +01:00
parent 7473601172
commit 80bfbd17b7
2 changed files with 39 additions and 5 deletions

View file

@ -19,11 +19,12 @@ vars.plats = {
"em22", "em22",
} }
vars.plats_with_tests = { vars.plats_with_tests = {
"linux68k", "cpm",
"linux386", -- "linux386",
"linuxppc", -- "linux68k",
"linuxmips", -- "linuxmips",
"pc86", -- "linuxppc",
-- "pc86",
} }
local plat_packages = {} local plat_packages = {}

33
util/cmisc/objectify.c Normal file
View file

@ -0,0 +1,33 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int main(int argc, const char* argv[])
{
size_t count = 0;
if (argc != 2)
{
fprintf(stderr, "syntax: objectify <symbol>\n");
exit(1);
}
printf("#include <stdint.h>\n");
printf("#include <unistd.h>\n");
printf("const uint8_t %s_data[] = {", argv[1]);
for (;;)
{
int c = getchar();
if (c == -1)
break;
if ((count & 15) == 0)
putchar('\n');
printf("0x%02x, ", c);
count++;
}
printf("\n};\n");
printf("const size_t %s_len = %d;\n", argv[1], count);
return 0;
}