aboutsummaryrefslogtreecommitdiff
path: root/driver_fw/Makefile
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-08-28 20:53:10 +0200
committerjaseg <git@jaseg.de>2023-08-28 20:53:10 +0200
commitbf9e310360f0ac45a35008fd9e8a7d2561c8d481 (patch)
tree17a648dae9ac3d90de2e2f627be7687a2ee9e4cf /driver_fw/Makefile
parente54c5479c310709636f9ff808b198e03bda77a7e (diff)
download8seg-bf9e310360f0ac45a35008fd9e8a7d2561c8d481.tar.gz
8seg-bf9e310360f0ac45a35008fd9e8a7d2561c8d481.tar.bz2
8seg-bf9e310360f0ac45a35008fd9e8a7d2561c8d481.zip
Waveform interleaving seems to work
Diffstat (limited to 'driver_fw/Makefile')
-rw-r--r--driver_fw/Makefile19
1 files changed, 13 insertions, 6 deletions
diff --git a/driver_fw/Makefile b/driver_fw/Makefile
index c9393bf..8ae65b2 100644
--- a/driver_fw/Makefile
+++ b/driver_fw/Makefile
@@ -30,7 +30,7 @@ DEVICE := STM32G070RB
ASM_SOURCES := startup.s
-C_SOURCES := src/main.c
+C_SOURCES := src/main.c $(BUILDDIR)/generated/waveform_tables.c
CPP_SOURCES := # - none -
@@ -93,6 +93,8 @@ COMMON_CFLAGS += -O$(OPT) -std=gnu2x -g
COMMON_CFLAGS += $(DEVICE_DEFINES)
COMMON_CFLAGS += -DDEBUG=$(DEBUG)
+GEN_HEADERS := $(BUILDDIR)/generated/waveform_tables.h
+
HOST_CFLAGS += $(COMMON_CFLAGS)
# for musl
@@ -152,7 +154,7 @@ $(BUILDDIR)/src/%.o: src/%.s
mkdir -p $(@D)
$(CC) $(COMMON_CFLAGS) $(CFLAGS) $(INT_CFLAGS) -o $@ -c $<
-$(BUILDDIR)/src/%.o: src/%.c
+$(BUILDDIR)/src/%.o: src/%.c $(GEN_HEADERS)
mkdir -p $(@D)
$(CC) $(COMMON_CFLAGS) $(CFLAGS) $(INT_CFLAGS) -o $@ -c $<
@@ -168,21 +170,26 @@ $(BUILDDIR)/%.o: %.s
mkdir -p $(@D)
$(CC) $(COMMON_CFLAGS) $(CFLAGS) $(EXT_CFLAGS) -o $@ -c $<
+$(BUILDDIR)/generated/waveform_tables.c: tools/template_wave_tables.py $(BUILDDIR)/generated/waveform_tables.h
+ mkdir -p $(@D)
+ python $< $@
+
+$(BUILDDIR)/generated/waveform_tables.h: tools/template_wave_tables.py
+ mkdir -p $(@D)
+ python $< --header $@
+
venv:
test -d venv || python3 -m venv --system-site-packages venv
source venv/bin/activate && pip install cxxfilt pyelftools libarchive matplotlib
clean:
rm -rf $(BUILDDIR)/src
+ rm -rf $(BUILDDIR)/generated
rm -f $(BUILDDIR)/**.o
rm -f $(BUILDDIR)/$(BINARY)
rm -f $(BUILDDIR)/$(BINARY:.elf=.map)
rm -f $(BUILDDIR)/$(BINARY:.elf=-symbol-sizes.dot)
rm -f $(BUILDDIR)/$(BINARY:.elf=-symbol-sizes.pdf)
- rm -f $(BUILDDIR)/crc32_test
- rm -f $(BUILDDIR)/microcobs_test_sg
- rm -f $(BUILDDIR)/microcobs_test
- rm -f $(BUILDDIR)/microcobs_decode_test
mrproper: clean
rm -rf build