refactor(editor): extract --gen-makefile / --gen-project-makefile into cli_makefile.cpp

Moves the two Makefile-generation handlers (--gen-makefile,
--gen-project-makefile) out of main.cpp into a new
cli_makefile.{hpp,cpp} module. Both emit GNU make recipes
that rebuild every derived output (.glb / .obj / .stl / .html
/ .csv / .md) from sources via wowee_editor flags, with proper
dependency tracking so make can skip already-up-to-date
outputs. Designers can `make -j$(nproc)` to rebuild all zones
in parallel after a content edit.

main.cpp shrinks by 167 lines (3,791 to 3,624).
This commit is contained in:
Kelsi 2026-05-09 09:04:44 -07:00
parent bd2d8ffbd0
commit 43bb8d133b
4 changed files with 236 additions and 171 deletions

View file

@ -0,0 +1,20 @@
#pragma once
namespace wowee {
namespace editor {
namespace cli {
// Dispatch the Makefile-generation handlers — emit GNU make
// recipes that rebuild every derived output (.glb / .obj /
// .stl / .html / .csv / .md) from sources via wowee_editor
// flags. Designers can `make -j` to rebuild after editing
// without remembering which CLI flag does what.
// --gen-makefile per-zone Makefile inside the zone dir
// --gen-project-makefile project-wide Makefile delegating per-zone
//
// Returns true if matched; outRc holds the exit code.
bool handleMakefile(int& i, int argc, char** argv, int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee