emulator-template: Rebuild when the sketch file changes

The $(EMU) target only depended on main.cpp and shim.h, so editing the
sketch (.cpp) did not trigger a rebuild - stale binaries silently ran.
Add the sketch to the prerequisites; propagate to cyberspace-demo copy.
This commit is contained in:
Dejvino
2026-11-16 21:01:19 +01:00
parent 80d931b875
commit 57d79ee296
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -41,7 +41,9 @@ all: $(EMU)
# Compile + link: main.cpp includes the sketch .cpp, forming one TU.
# -DAPP_INO makes the sketch's .ino filename available to #ifdef EMULATOR.
$(EMU): $(EMU_MAIN) $(SHIMS)
# Depend on the sketch too, or sketch edits won't trigger a rebuild.
SKETCH := $(APP_DIR)/$(APP).cpp
$(EMU): $(EMU_MAIN) $(SHIMS) $(SKETCH)
$(CXX) $(CXXFLAGS) $(SDLFLAGS) $(INC) $(DEFS) \
$(EMU_MAIN) -o $@ $(LIBS)
+3 -1
View File
@@ -41,7 +41,9 @@ all: $(EMU)
# Compile + link: main.cpp includes the sketch .cpp, forming one TU.
# -DAPP_INO makes the sketch's .ino filename available to #ifdef EMULATOR.
$(EMU): $(EMU_MAIN) $(SHIMS)
# Depend on the sketch too, or sketch edits won't trigger a rebuild.
SKETCH := $(APP_DIR)/$(APP).cpp
$(EMU): $(EMU_MAIN) $(SHIMS) $(SKETCH)
$(CXX) $(CXXFLAGS) $(SDLFLAGS) $(INC) $(DEFS) \
$(EMU_MAIN) -o $@ $(LIBS)