diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -14,8 +14,10 @@ LIB = lib/launchpad_pro.a | |||
14 | ELF = $(BUILDDIR)/launchpad_pro.elf | 14 | ELF = $(BUILDDIR)/launchpad_pro.elf |
15 | HEX = $(BUILDDIR)/launchpad_pro.hex | 15 | HEX = $(BUILDDIR)/launchpad_pro.hex |
16 | HEXTOSYX = $(BUILDDIR)/hextosyx | 16 | HEXTOSYX = $(BUILDDIR)/hextosyx |
17 | SIMULATOR = $(BUILDDIR)/simulator | ||
17 | 18 | ||
18 | HOST_CC = g++ | 19 | HOST_GPP = g++ |
20 | HOST_GCC = gcc | ||
19 | CC = arm-none-eabi-gcc | 21 | CC = arm-none-eabi-gcc |
20 | LD = arm-none-eabi-gcc | 22 | LD = arm-none-eabi-gcc |
21 | OBJCOPY = arm-none-eabi-objcopy | 23 | OBJCOPY = arm-none-eabi-objcopy |
@@ -33,12 +35,17 @@ LDFLAGS += -T$(LDSCRIPT) -u _start -u _Minimum_Stack_Size -mcpu=cortex-m3 -mthu | |||
33 | all: $(SYX) | 35 | all: $(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 $< $@ |