diff --git a/tools/mcconfig/nmake.esp32.mk b/tools/mcconfig/nmake.esp32.mk index 7513e601eb..cba5c158fe 100644 --- a/tools/mcconfig/nmake.esp32.mk +++ b/tools/mcconfig/nmake.esp32.mk @@ -547,8 +547,6 @@ release: precursor python %IDF_PATH%\tools\idf.py $(IDF_PY_LOG_FLAG) $(PORT_COMMAND) -b $(UPLOAD_SPEED) monitor prepare: - $(KILL_SERIAL2XSBUG) - $(START_XSBUG) if exist $(BLD_DIR)\xs_esp32.elf del $(BLD_DIR)\xs_esp32.elf if not exist $(BLD_DIR) mkdir $(BLD_DIR) copy $(BIN_DIR)\xs_$(ESP32_SUBCLASS).a $(BLD_DIR)\. diff --git a/tools/mcconfig/nmake.win.mk b/tools/mcconfig/nmake.win.mk index be90e9b00c..a37ea37e43 100644 --- a/tools/mcconfig/nmake.win.mk +++ b/tools/mcconfig/nmake.win.mk @@ -23,20 +23,36 @@ !CMDSWITCHES +S !ENDIF + !IF "$(DEBUG)"=="1" !IF "$(XSBUG_LOG)"=="1" START_XSBUG = !ELSE +!IF "$(XSBUG_HOST)"=="localhost" START_XSBUG = tasklist /nh /fi "imagename eq xsbug.exe" | find /i "xsbug.exe" > nul || (start $(BUILD_DIR)\bin\win\release\xsbug.exe) +!ELSE +START_XSBUG = echo "mcconfig -x" is remote ($(XSBUG_HOST):$(XSBUG_PORT)), not starting xsbug +!ENDIF !ENDIF !ELSE START_XSBUG = !ENDIF +!IFNDEF XSBUG_PORT +XSBUG_PORT = 5002 +!ENDIF +!IFNDEF XSBUG_HOST +XSBUG_HOST = localhost +!ENDIF + !IF "$(XSBUG_LOG)"=="1" -START_COMMAND = cd $(MODDABLE)\tools\xsbug-log && node xsbug-log start /B $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll +!IF "$(XSBUG_HOST)"=="localhost" +START_COMMAND = cmd /c "set "XSBUG_PORT=$(XSBUG_PORT)" && set "XSBUG_HOST=$(XSBUG_HOST)" && cd $(MODDABLE)\tools\xsbug-log && node xsbug-log start /B $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll" +!ELSE +START_COMMAND = cmd /c "set "XSBUG_PORT=$(XSBUG_PORT)" && set "XSBUG_HOST=$(XSBUG_HOST)" && start $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll" +!ENDIF !ELSE -START_COMMAND = start $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll +START_COMMAND = cmd /c "set "XSBUG_PORT=$(XSBUG_PORT)" && set "XSBUG_HOST=$(XSBUG_HOST)" && start $(SIMULATOR) $(SIMULATORS) $(BIN_DIR)\mc.dll" !ENDIF KILL_COMMAND = taskkill /im mcsim.exe /F 2> nul || (call ) diff --git a/tools/xsbug-log/xsbug-log.js b/tools/xsbug-log/xsbug-log.js index dd778b74a8..3382c80f7b 100644 --- a/tools/xsbug-log/xsbug-log.js +++ b/tools/xsbug-log/xsbug-log.js @@ -39,7 +39,7 @@ catch (e) { process.exit(); } -const portIn = 5002; +const portIn = process.env.XSBUG_PORT ?? 5002; let connections = 0; let autoexit = false;