diff --git a/build/esp32/Makefile b/build/esp32/Makefile index a81821d..75cce14 100644 --- a/build/esp32/Makefile +++ b/build/esp32/Makefile @@ -22,11 +22,11 @@ EXCLUDE := $(SRCDIR)/spider/runtime/util/Terminal.cpp \ $(SRCDIR)/spider/runtime/debug/LiveDebug.cpp \ $(SRCDIR)/spider/SpiderRuntime.cpp -# ESP32 specific entry point -EXTRA := $(SRCDIR)/spider/main_esp32.cpp +# ESP32 specific entry point (local to this build folder) +EXTRA := ./main_esp32.cpp SOURCES := $(filter-out $(EXCLUDE), $(shell find $(SRCDIR) -type f -name "*.$(SRCEXT)" 2>/dev/null)) $(EXTRA) -OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT))) +OBJECTS := $(patsubst ./%,$(BUILDDIR)/%,$(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT)))) all: directories $(TARGET) @echo "Build complete: $(TARGETDIR)/$(TARGET)" @@ -53,4 +53,9 @@ $(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT) @echo "Compiling $<..." $(CC) $(CFLAGS) $(INC) -c -o $@ $< +$(BUILDDIR)/%.$(OBJEXT): ./%.$(SRCEXT) + @mkdir -p $(dir $@) + @echo "Compiling $<..." + $(CC) $(CFLAGS) $(INC) -c -o $@ $< + .PHONY: all remake clean cleaner diff --git a/build/esp32/bin/spider/main_esp32.o b/build/esp32/bin/main_esp32.o similarity index 100% rename from build/esp32/bin/spider/main_esp32.o rename to build/esp32/bin/main_esp32.o diff --git a/build/esp32/gen_makefile.py b/build/esp32/gen_makefile.py index a29d28c..7f7c5b4 100644 --- a/build/esp32/gen_makefile.py +++ b/build/esp32/gen_makefile.py @@ -25,11 +25,11 @@ EXCLUDE := {dollar}(SRCDIR)/spider/runtime/util/Terminal.cpp \\ {dollar}(SRCDIR)/spider/runtime/debug/LiveDebug.cpp \\ {dollar}(SRCDIR)/spider/SpiderRuntime.cpp -# ESP32 specific entry point -EXTRA := {dollar}(SRCDIR)/spider/main_esp32.cpp +# ESP32 specific entry point (local to this build folder) +EXTRA := ./main_esp32.cpp SOURCES := {dollar}(filter-out {dollar}(EXCLUDE), {dollar}(shell find {dollar}(SRCDIR) -type f -name "*.{dollar}(SRCEXT)" 2>/dev/null)) {dollar}(EXTRA) -OBJECTS := {dollar}(patsubst {dollar}(SRCDIR)/%,{dollar}(BUILDDIR)/%,{dollar}(SOURCES:.{dollar}(SRCEXT)=.{dollar}(OBJEXT))) +OBJECTS := {dollar}(patsubst ./%,{dollar}(BUILDDIR)/%,{dollar}(patsubst {dollar}(SRCDIR)/%,{dollar}(BUILDDIR)/%,{dollar}(SOURCES:.{dollar}(SRCEXT)=.{dollar}(OBJEXT)))) all: directories {dollar}(TARGET) {tab}@echo "Build complete: {dollar}(TARGETDIR)/{dollar}(TARGET)" @@ -56,6 +56,11 @@ cleaner: clean {tab}@echo "Compiling {dollar}<..." {tab}{dollar}(CC) {dollar}(CFLAGS) {dollar}(INC) -c -o {dollar}@ {dollar}< +{dollar}(BUILDDIR)/%.{dollar}(OBJEXT): ./%.{dollar}(SRCEXT) +{tab}@mkdir -p {dollar}(dir {dollar}@) +{tab}@echo "Compiling {dollar}<..." +{tab}{dollar}(CC) {dollar}(CFLAGS) {dollar}(INC) -c -o {dollar}@ {dollar}< + .PHONY: all remake clean cleaner """ diff --git a/src/spider/main_esp32.cpp b/build/esp32/main_esp32.cpp similarity index 83% rename from src/spider/main_esp32.cpp rename to build/esp32/main_esp32.cpp index 024b35f..8925e2e 100644 --- a/src/spider/main_esp32.cpp +++ b/build/esp32/main_esp32.cpp @@ -1,6 +1,6 @@ // ESP32 entry point for Spider Runtime // This replaces SpiderRuntime.cpp for microcontroller builds -#include "SpiderRuntime.hpp" +#include int main() { // TODO: initialize Spider runtime for ESP32 diff --git a/build/esp32/out/spider_esp32.elf b/build/esp32/out/spider_esp32.elf index a101fde..c764849 100644 Binary files a/build/esp32/out/spider_esp32.elf and b/build/esp32/out/spider_esp32.elf differ