Add OS X binaries for dfu-util and lpc21isp
[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
b00f1a6b
AG
20\r
21#GCC4MBED_TYPE=Debug\r
4464301d 22#GCC4MBED_TYPE=Release\r
6c79da43 23GCC4MBED_TYPE=Checked\r
b00f1a6b
AG
24\r
25# Set to 1 to allow MRI debug monitor to take full control of UART0 and use it\r
26# as a dedicated debug channel. If you are using the USB based serial port for\r
27# the console then this should cause you no problems. Set MRI_BREAK_ON_INIT to\r
28# 0 if you don't want to break into GDB at startup.\r
29ENABLE_DEBUG_MONITOR=0\r
30\r
31ifeq "$(ENABLE_DEBUG_MONITOR)" "1"\r
32# Can add MRI_UART_BAUD=115200 to next line if GDB fails to connect to MRI.\r
33# Tends to happen on some Linux distros but not Windows and OS X.\r
34MRI_UART=MRI_UART_0\r
35MRI_BREAK_ON_INIT=1\r
36MRI_SEMIHOST_STDIO=1\r
37else\r
38MRI_UART=MRI_UART_0 MRI_UART_SHARE\r
6c79da43
AG
39MRI_BREAK_ON_INIT=0\r
40MRI_SEMIHOST_STDIO=0\r
b00f1a6b 41endif\r
4cff3ded 42\r
38cf3dc6 43CONSOLE=/dev/ttyUSB0\r
14d4726b 44\r
4cff3ded
AW
45include ./gcc4mbed/build/gcc4mbed.mk\r
46\r
15d0cdbc
MM
47.PHONY: debug-store flash upload debug console\r
48\r
49debug-store: $(PROJECT).elf\r
50 cp $(PROJECT).elf $(PROJECT)_lastupload.elf\r
51\r
52flash: $(PROJECT).hex debug-store\r
5cdad772 53 lpc21isp $< $(CONSOLE) 115200 12000\r
a33de4b2 54\r
15d0cdbc 55upload: $(PROJECT).bin debug-store\r
38cf3dc6 56 dfu-util -d 1d50:6015 -R -D $<\r
0144b869 57\r
15d0cdbc 58debug: $(PROJECT)_lastupload.elf\r
14d4726b 59 arm-none-eabi-gdb $< -ex "set target-charset ASCII" -ex "set remotelogfile mri.log" -ex "target remote $(CONSOLE)"\r
0144b869
MM
60\r
61console:\r
14d4726b
MM
62 stty raw ignbrk -echo 2000000 < $(CONSOLE)\r
63 ( cat <&3 & cat >&3 ; kill %% ) 3<>$(CONSOLE)\r