MRI_SEMIHOST_STDIO=0
endif
-# generate a git version string, sorry only on linux and mac osx
+# generate a git version string
ifneq "$(OS)" "Windows_NT"
DEFINES += -D__GITVERSIONSTRING__=\"$(shell ./generate-version.sh)\"
else
-DEFINES += -D__GITVERSIONSTRING__=\"placeholder\"
+DEFINES += -D__GITVERSIONSTRING__=\"$(shell generate-version.bat)\"
endif
# use c++11 features for the checksums and set default baud rate for serial uart
DEFINES += -DCHECKSUM_USE_CPP -DDEFAULT_SERIAL_BAUD_RATE=$(DEFAULT_SERIAL_BAUD_RATE)
+ifneq "$(STEPTICKER_DEBUG_PIN)" ""
+# Set a Pin here that toggles on end of move
+DEFINES += -DSTEPTICKER_DEBUG_PIN=$(STEPTICKER_DEBUG_PIN)
+endif
+
+# include an optional default set of excludes
# add any modules that you do not want included in the build
-export EXCLUDED_MODULES = tools/touchprobe
# e.g for a CNC machine
-#export EXCLUDED_MODULES = tools/touchprobe tools/laser tools/temperaturecontrol tools/extruder
+#export EXCLUDE_MODULES = tools/laser tools/temperaturecontrol tools/extruder
+-include default_excludes.mk
+
+# override any default excludes by setting NODEFAULTEXCLUDES=1
+ifneq "$(NODEFAULTEXCLUDES)" "1"
+# if nothing set in the default_excludes.mk file then handle some default excludes for different builds
+
+ifeq "$(EXCLUDE_MODULES)" ""
+
+ifeq "$(CNC)" "1"
+# CNC build excludes these
+export EXCLUDE_MODULES = tools/filamentdetector tools/scaracal tools/temperaturecontrol tools/temperatureswitch tools/extruder
+else
+# 3D build excludes these
+export EXCLUDE_MODULES = tools/drillingcycles tools/spindle
+endif
+
+endif
+endif
+
+ifneq "$(INCLUDE_MODULE)" ""
+export EXCLUDED_MODULES = $(filter-out $(INCLUDE_MODULE),$(EXCLUDE_MODULES))
+else
+export EXCLUDED_MODULES = $(EXCLUDE_MODULES)
+endif
+
+ifneq "$(EXCLUDED_MODULES)" ""
+$(info **NOTE** Excluding modules $(EXCLUDED_MODULES))
+endif
+
+ifneq "$(AXIS)" ""
+DEFINES += -DMAX_ROBOT_ACTUATORS=$(AXIS)
+endif
+
+# define the number of primary (cartesian) axis must be >= MAX_ROBOT_ACTUATORS
+ifneq "$(PAXIS)" ""
+DEFINES += -DN_PRIMARY_AXIS=$(PAXIS)
+endif
# set to not compile in any network support
#export NONETWORK = 1
include $(BUILD_DIR)/build.mk
CONSOLE?=/dev/arduino
-BAUD?=1000000
+BAUD?=9600
+
+ifneq "$(OS)" "Windows_NT"
+COPY=cp
+else
+COPY=copy
+endif
.PHONY: debug-store flash upload debug console dfu
+print-% : ; @echo $* = $($*)
debug-store: ../LPC1768/$(PROJECT).elf
- cp ../LPC1768/$(PROJECT).elf ../LPC1768/$(PROJECT)_lastupload.elf
+ cd .. && cd LPC1768 && $(COPY) $(PROJECT).elf $(PROJECT)_lastupload.elf
flash: ../LPC1768/$(PROJECT).hex debug-store
lpc21isp $< $(CONSOLE) 115200 12000