summaryrefslogtreecommitdiff
path: root/robot/makefile
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-26 15:39:31 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-26 15:39:31 +0200
commit60f07661602a5dfe8e39b8038964b38bddcb33a5 (patch)
tree0b257acda0797a13cd09e7df2d16a6da0a6aef11 /robot/makefile
parent333eea840a17d0f8ecf0110d952df2857fea4da0 (diff)
parentf073c9d3848dab915bed4844e9d13684aa5e23eb (diff)
merge dev into master
Diffstat (limited to 'robot/makefile')
-rw-r--r--robot/makefile13
1 files changed, 7 insertions, 6 deletions
diff --git a/robot/makefile b/robot/makefile
index 6f50519..a6e96ee 100644
--- a/robot/makefile
+++ b/robot/makefile
@@ -10,11 +10,14 @@ PORT ?= /dev/ttyACM0
CFLAGS=-g -Wall $(DEVICE_SPECIFIC_CFLAGS) -Os
LDFLAGS=-Wl,-gc-sections -Wl,-relax
+all: $(if $(SIM), a.out, out.hex)
+
SOURCES := $(filter-out sim.c, $(wildcard *.c))
HEADERS := $(filter-out sim.h, $(wildcard *.h))
+include ../shared/makefile
# simulation
-# SIM = true
+SIM = true
CFLAGS += $(if $(SIM), -DW2_SIM, -mcall-prologues -mmcu=$(MCU))
LDFLAGS += $(if $(SIM), , -lpololu_$(DEVICE))
PREFIX := $(if $(SIM), , avr-)
@@ -29,12 +32,10 @@ OBJ2HEX=$(PREFIX)objcopy
# debug build info string
BUILD_STR=$(shell git update-index -q --refresh; git describe --tags --dirty='*' --broken='x' | cut -c1-20)
-CFLAGS += -DW2_BUILD_STR="$(BUILD_STR)"
-
-all: $(if $(SIM), a.out, out.hex)
+CFLAGS += -DW2_BUILD_STR=\"$(BUILD_STR)\"
-clean:
- rm -f *.o out.hex a.out compile_commands.json
+clean::
+ rm -f *.o out.hex a.out
a.out: $(OBJECTS)
$(CC) $(OBJECTS) $(CFLAGS) $(LDFLAGS)