summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 8c91f24..3e15b46 100644
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,10 @@ LIB = lib/launchpad_pro.a
14ELF = $(BUILDDIR)/launchpad_pro.elf 14ELF = $(BUILDDIR)/launchpad_pro.elf
15HEX = $(BUILDDIR)/launchpad_pro.hex 15HEX = $(BUILDDIR)/launchpad_pro.hex
16HEXTOSYX = $(BUILDDIR)/hextosyx 16HEXTOSYX = $(BUILDDIR)/hextosyx
17SIMULATOR = $(BUILDDIR)/simulator
17 18
18HOST_CC = g++ 19HOST_GPP = g++
20HOST_GCC = gcc
19CC = arm-none-eabi-gcc 21CC = arm-none-eabi-gcc
20LD = arm-none-eabi-gcc 22LD = arm-none-eabi-gcc
21OBJCOPY = arm-none-eabi-objcopy 23OBJCOPY = arm-none-eabi-objcopy
@@ -33,12 +35,17 @@ LDFLAGS += -T$(LDSCRIPT) -u _start -u _Minimum_Stack_Size -mcpu=cortex-m3 -mthu
33all: $(SYX) 35all: $(SYX)
34 36
35# build the final sysex file from the ELF 37# build the final sysex file from the ELF
36$(SYX): $(HEX) $(HEXTOSYX) 38$(SYX): $(HEX) $(HEXTOSYX) $(SIMULATOR)
39 ./$(SIMULATOR)
37 ./$(HEXTOSYX) $(HEX) $(SYX) 40 ./$(HEXTOSYX) $(HEX) $(SYX)
38 41
39# build the tool for conversion of ELF files to sysex ready for upload to the unit 42# build the tool for conversion of ELF files to sysex ready for upload to the unit
40$(HEXTOSYX): 43$(HEXTOSYX):
41 $(HOST_CC) -Ofast -std=c++0x -I./$(TOOLS)/libintelhex/include ./$(TOOLS)/libintelhex/src/intelhex.cc $(TOOLS)/hextosyx.cpp -o $(HEXTOSYX) 44 $(HOST_GPP) -Ofast -std=c++0x -I./$(TOOLS)/libintelhex/include ./$(TOOLS)/libintelhex/src/intelhex.cc $(TOOLS)/hextosyx.cpp -o $(HEXTOSYX)
45
46# build the simulator and run it (it's a very basic test of the code before it runs on the device!)
47$(SIMULATOR):
48 $(HOST_GCC) -O0 -std=c99 -Iinclude $(TOOLS)/simulator.c src/app.c -o $(SIMULATOR)
42 49
43$(HEX): $(ELF) 50$(HEX): $(ELF)
44 $(OBJCOPY) -O ihex $< $@ 51 $(OBJCOPY) -O ihex $< $@