-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (30 loc) · 973 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
export ROOTDIR := $(shell pwd)
export CC := arm-none-eabi-gcc
export RM := rm -rf
export MKDIR := mkdir -p
export BUILDDIR := $(ROOTDIR)/Build
ifeq ($(MAKECMDGOALS),)
MACHINE = Stellaris
else
MACHINE = $(MAKECMDGOALS)
endif
export MACHINE
SUBDIR := Source \
Drivers \
TARGET := firmware
all: $(TARGET)
$(TARGET): $(BUILDDIR) $(SUBDIR)
$(CC) -o $@ -mcpu=cortex-m3 -mthumb -T Source/GCC/gcc_arm_$(MACHINE).ld --specs=nosys.specs $(wildcard $(BUILDDIR)/HAL/$(MACHINE)/*.o) $(wildcard $(BUILDDIR)/Source/*.o)
$(BUILDDIR):
@$(MKDIR) $@
$(SUBDIR):
@$(MAKE) -C $@
run:
qemu-system-arm -M lm3s811evb -cpu cortex-m3 -kernel $(TARGET) -display none -serial stdio
debug:
qemu-system-arm -M lm3s811evb -cpu cortex-m3 -kernel $(TARGET) -d in_asm,cpu,unimp -display none -semihosting
gdb:
qemu-system-arm -M lm3s811evb -cpu cortex-m3 -kernel $(TARGET) -d in_asm,cpu,unimp -display none -semihosting -S -s
clean:
$(RM) $(BUILDDIR) $(TARGET)
.PHONY: all $(SUBDIR)