Makefile reimports when import script changes

This commit is contained in:
jaburns
2020-10-19 17:17:28 -06:00
parent baec38c80e
commit 82126eca3c
2 changed files with 13 additions and 11 deletions
+2 -4
View File
@@ -38,6 +38,7 @@ const GeoLayout mario_geo_libsm64[] = {
};
void *mario_geo_ptr = (void*)mario_geo_libsm64;
"""
geo_inc_h = """
@@ -56,10 +57,6 @@ model_inc_h = """
def main():
global model_inc_h
if os.path.exists("src/mario/geo.inc.c") and os.path.exists("src/mario/model.inc.c") \
and os.path.exists("src/mario/geo.inc.h") and os.path.exists("src/mario/model.inc.h"):
return;
shutil.rmtree("src/mario", ignore_errors=True)
os.makedirs("src/mario", exist_ok=True)
@@ -85,6 +82,7 @@ def main():
lines.insert(0, "#include \"../load_tex_data.h\"")
model_inc_c = "\n".join(lines)
with open("src/mario/geo.inc.c", "w") as file:
file.write(geo_inc_c_header + geo_inc_c + geo_inc_c_footer)