summaryrefslogtreecommitdiff
path: root/Makefile
blob: 1f31cb755478c629034cfe916a814914bd6b6687 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

obj = present
PORT = 1337

WFLAGS   = -Wall -Wextra
LDFLAGS  = -Wl,--section-start=.text=0x1000
LDFLAGS += -Wl,--section-start=.data=0x2000

$(obj): $(obj).S
	arm-none-eabi-gcc -g $(WFLAGS) -nostdlib $< -o $@ $(LDFLAGS)

run-$(obj): $(obj)
	qemu-arm -g $(PORT) $(obj) &
	arm-none-eabi-gdb -q -ex 'tar rem localhost:$(PORT)' $(obj)

edit-$(obj).S: $(obj).S
	@vim +"let g:syntastic_asm_compiler='arm-none-eabi-gcc'" $<