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