From a4baa8c794e28c32606b643d8a6bfe7e1c3a93b2 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Thu, 25 Jul 2024 02:28:36 +0200 Subject: [PATCH] Statically replace *.inc includes with contents in packed cc-runtime --- .github/workflows/pack.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml index b038d56..7c95f7c 100644 --- a/.github/workflows/pack.yml +++ b/.github/workflows/pack.yml @@ -16,7 +16,10 @@ jobs: - name: Pack cc-runtime run: | set -e - cat assembly.h int_endianness.h int_types.h int_lib.h int_util.h *.inc *.c > /tmp/cc-runtime.c + cat assembly.h int_endianness.h int_types.h int_lib.h int_util.h *.c > /tmp/cc-runtime.c + for f in *.inc; do + sed -i "/#include \"$f\"/{r $f;d}" /tmp/cc-runtime.c + done grep '#include <' /tmp/cc-runtime.c > /tmp/saved-includes sed -i '/#include/d' /tmp/cc-runtime.c cat /tmp/saved-includes /tmp/cc-runtime.c > /tmp/cc-runtime.c.tmp