summaryrefslogtreecommitdiffhomepage
path: root/run
diff options
context:
space:
mode:
Diffstat (limited to 'run')
-rwxr-xr-xrun15
1 files changed, 15 insertions, 0 deletions
diff --git a/run b/run
index b9a38f6..feaee4a 100755
--- a/run
+++ b/run
@@ -62,6 +62,18 @@ build_cross() {
fi
}
+# Generate configs for better development experience
+generate() {
+ ctags -R --exclude=.git --exclude=build --exclude=cross .
+
+ # Compile commands for ALE in Vim
+ make --always-make --dry-run |
+ grep -wE 'gcc|g\+\+' |
+ grep -w '\-c' |
+ jq -nR '[inputs|{directory:".", command:., file: match(" [^ ]+$").string[1:]}]' \
+ >compile_commands.json
+}
+
build() {
mkdir -p build/
@@ -91,6 +103,9 @@ emulate() {
qemu-system-i386 -d guest_errors -cpu max -serial stdio -m 256M -vga std -drive file=build/disk.img,format=raw,index=1,media=disk
}
+# Always generate updated configurations
+generate
+
if [ "${mode}" = "cross" ]; then
build_cross
elif [ "${mode}" = "build" ]; then