From 80bfbd17b7eb7db8bed703069e5ca6e41d90dad2 Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 7 Feb 2019 23:01:10 +0100 Subject: [PATCH] Add missing file. --- build.lua | 11 ++++++----- util/cmisc/objectify.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 util/cmisc/objectify.c diff --git a/build.lua b/build.lua index b653c1c9f..156ff7cea 100644 --- a/build.lua +++ b/build.lua @@ -19,11 +19,12 @@ vars.plats = { "em22", } vars.plats_with_tests = { - "linux68k", - "linux386", - "linuxppc", - "linuxmips", - "pc86", + "cpm", +-- "linux386", +-- "linux68k", +-- "linuxmips", +-- "linuxppc", +-- "pc86", } local plat_packages = {} diff --git a/util/cmisc/objectify.c b/util/cmisc/objectify.c new file mode 100644 index 000000000..090956131 --- /dev/null +++ b/util/cmisc/objectify.c @@ -0,0 +1,33 @@ +#include +#include +#include + +int main(int argc, const char* argv[]) +{ + size_t count = 0; + + if (argc != 2) + { + fprintf(stderr, "syntax: objectify \n"); + exit(1); + } + + printf("#include \n"); + printf("#include \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; +} +