Merge pull request #324 from wolfmanjm/fix/switch
[clinton/Smoothieware.git] / src / makefile
CommitLineData
4cff3ded 1PROJECT=main\r
172d42d9
AG
2BUILD_DIR=../build\r
3DEVICES=lpc1768\r
b00f1a6b 4\r
172d42d9
AG
5# BUILD_TYPE can be set to the following values:\r
6# Checked - Optimizations enabled with MRI debug monitor support. (Recommended Type)\r
7# Release - Optimizations enabled.\r
8# Debug - Optimization disabled with MRI debug monitor support.\r
9BUILD_TYPE=Checked\r
b00f1a6b 10\r
383036c1
AG
11# Set to 1 to tag each heap allocation with the caller's return address.\r
12# NOTE: Can't be enabled with latest build as not compatible with newlib nano.\r
13HEAP_TAGS=0\r
14\r
15# Set to 1 configure MPU to disable write buffering and eliminate imprecise bus faults.\r
16WRITE_BUFFER_DISABLE=0\r
17\r
18# Set to non zero value if you want checks to be enabled which reserve a\r
19# specific amount of space for the stack. The heap's growth will be\r
20# constrained to reserve this much space for the stack and the stack won't be\r
21# able to grow larger than this amount.\r
22STACK_SIZE=3072\r
23\r
b00f1a6b
AG
24# Set to 1 to allow MRI debug monitor to take full control of UART0 and use it\r
25# as a dedicated debug channel. If you are using the USB based serial port for\r
26# the console then this should cause you no problems. Set MRI_BREAK_ON_INIT to\r
27# 0 if you don't want to break into GDB at startup.\r
7e7cae44 28ENABLE_DEBUG_MONITOR?=0\r
b00f1a6b
AG
29\r
30ifeq "$(ENABLE_DEBUG_MONITOR)" "1"\r
31# Can add MRI_UART_BAUD=115200 to next line if GDB fails to connect to MRI.\r
32# Tends to happen on some Linux distros but not Windows and OS X.\r
33MRI_UART=MRI_UART_0\r
34MRI_BREAK_ON_INIT=1\r
35MRI_SEMIHOST_STDIO=1\r
36else\r
37MRI_UART=MRI_UART_0 MRI_UART_SHARE\r
6c79da43
AG
38MRI_BREAK_ON_INIT=0\r
39MRI_SEMIHOST_STDIO=0\r
b00f1a6b 40endif\r
4cff3ded 41\r
e4738895
JM
42# generate a git version string, sorry only on linux and mac osx\r
43ifneq "$(OS)" "Windows_NT"\r
44DEFINES += -D__GITVERSIONSTRING__=\"$(shell ./generate-version.sh)\"\r
45else\r
46DEFINES += -D__GITVERSIONSTRING__=\"placeholder\"\r
47endif\r
48\r
172d42d9 49include $(BUILD_DIR)/build.mk\r
14d4726b 50\r
a94966a2
MM
51CONSOLE?=/dev/arduino\r
52BAUD?=1000000\r
4cff3ded 53\r
172d42d9 54.PHONY: debug-store flash upload debug console dfu\r
15d0cdbc 55\r
2775d191
AG
56debug-store: ../LPC1768/$(PROJECT).elf\r
57 cp ../LPC1768/$(PROJECT).elf ../LPC1768/$(PROJECT)_lastupload.elf\r
15d0cdbc 58\r
2775d191 59flash: ../LPC1768/$(PROJECT).hex debug-store\r
5cdad772 60 lpc21isp $< $(CONSOLE) 115200 12000\r
a33de4b2 61\r
2775d191 62dfu: ../LPC1768/$(PROJECT).bin\r
172d42d9 63 dfu-util -D $< -R\r
0144b869 64\r
2775d191 65upload: ../LPC1768/$(PROJECT).bin debug-store\r
9e403697 66 dfu-util -R -d 1d50:6015 -D $<\r
172d42d9 67\r
2775d191 68debug: ../LPC1768/$(PROJECT)_lastupload.elf\r
14d4726b 69 arm-none-eabi-gdb $< -ex "set target-charset ASCII" -ex "set remotelogfile mri.log" -ex "target remote $(CONSOLE)"\r
0144b869
MM
70\r
71console:\r
62f57a04 72 stty raw ignbrk -echo $(BAUD) < $(CONSOLE)\r
14d4726b 73 ( cat <&3 & cat >&3 ; kill %% ) 3<>$(CONSOLE)\r