summaryrefslogtreecommitdiff
path: root/robot/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'robot/makefile')
-rw-r--r--robot/makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/robot/makefile b/robot/makefile
index 6f50519..4039ae3 100644
--- a/robot/makefile
+++ b/robot/makefile
@@ -10,8 +10,11 @@ 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
@@ -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)