Add `ninja all_source` command

This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-10 12:21:02 +03:00
parent b9e88d3206
commit 27a6cfe95f
No known key found for this signature in database
GPG Key ID: E224F951761145F8
1 changed files with 9 additions and 0 deletions

View File

@ -1131,6 +1131,7 @@ from pprint import pprint
###
# Build
###
all_source_files = []
for lib in LIBS:
inputs = []
if "lib" in lib:
@ -1162,6 +1163,7 @@ for lib in LIBS:
"basedir": os.path.dirname(f"$builddir/src/{object}"),
"basefile": f"$builddir/src/{object}"
})
all_source_files.append(f"$builddir/src/{object}.o")
if os.path.exists(os.path.join("asm", f"{object}.s")):
n.build(f"$builddir/asm/{object}.o", "as", f"asm/{object}.s")
if completed:
@ -1198,6 +1200,13 @@ else:
n.build("$builddir/main.elf", "link", inputs)
n.newline()
###
# Helper rule for building all source files
###
n.comment("Adds a command for building all source files")
n.build("all_source", "phony", all_source_files)
n.newline()
###
# Generate DOL
###