time to save again
[clinton/Smoothieware.git] / makefile
1 # Copyright 2011 Adam Green (http://mbed.org/users/AdamGreen/)
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 PROJECT=main
15 GCC4MBED_DIR=./gcc4mbed
16 INCDIRS=
17 LIBS_PREFIX=
18 LIBS_SUFFIX=
19 SRC=./src
20 #GCC4MBED_TYPE=Release
21 GCC4MBED_TYPE=Checked
22 #GCC4MBED_TYPE=Debug
23 #MRI_UART=MRI_UART_MBED_P13_P14 MRI_UART_BAUD=115200
24 MRI_UART=MRI_UART_MBED_USB MRI_UART_SHARE
25 #MRI_UART=MRI_UART_MBED_USB
26 MRI_BREAK_ON_INIT=0
27 MRI_SEMIHOST_STDIO=0
28
29 CONSOLE=/dev/arduino_A900K10V
30
31 include ./gcc4mbed/build/gcc4mbed.mk
32
33 .PHONY: debug-store flash upload debug console
34
35 debug-store: $(PROJECT).elf
36 cp $(PROJECT).elf $(PROJECT)_lastupload.elf
37
38 flash: $(PROJECT).hex debug-store
39 lpc21isp $< $(CONSOLE) 115200 12000
40
41 upload: $(PROJECT).bin debug-store
42 dfu-util -d 1d50:6015 -D $<
43
44 debug: $(PROJECT)_lastupload.elf
45 arm-none-eabi-gdb $< -ex "set target-charset ASCII" -ex "set remotelogfile mri.log" -ex "target remote $(CONSOLE)"
46
47 console:
48 stty raw ignbrk -echo 2000000 < $(CONSOLE)
49 ( cat <&3 & cat >&3 ; kill %% ) 3<>$(CONSOLE)