diff --git a/configure.py b/configure.py index 2702750b..952b3c4a 100755 --- a/configure.py +++ b/configure.py @@ -1134,6 +1134,10 @@ else: description="AR $out") n.newline() +n.rule(name="host_cc", command="clang -I include/ -o $out $in", + description="host_cc $out") +n.newline() + ### # Build ### @@ -1172,6 +1176,11 @@ for lib in LIBS: "basedir": os.path.dirname(f"$builddir/src/{object}"), "basefile": f"$builddir/src/{object}" }) + n.build(f"$builddir/host/{object}.o", "host_cc", c_file, + variables={ + "basedir": os.path.dirname(f"$builddir/src/{object}"), + "basefile": f"$builddir/src/{object}" + }) if add_to_all: all_source_files.append(f"$builddir/src/{object}.o") if os.path.exists(os.path.join("asm", f"{object}.s")): @@ -1217,6 +1226,13 @@ n.comment("Adds a command for building all source files") n.build("all_source", "phony", all_source_files) n.newline() +### +# Helper rule for building all source files, with a host compiler +### +n.comment("Adds a command for building all source files with a host compiler") +n.build("all_source_host", "phony", [s.replace("/src/", "/host/") for s in all_source_files]) +n.newline() + ### # Generate DOL ###