Skip to content

Commit a2b0072

Browse files
authored
Merge pull request #673 from burrbull/svdtools
SVDTOOLS env value
2 parents 4b5df58 + 5fb4874 commit a2b0072

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
* `SVDTOOLS` env value for specifying patching tool
6+
57
Family-specific:
68

79
* F7:

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ all: patch svd2rust
55

66
SHELL := /usr/bin/env bash
77

8+
# Path to `svd`/`svdtools`
9+
SVDTOOLS ?= svd
10+
811
CRATES ?= stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32h7 \
912
stm32l0 stm32l1 stm32l4 stm32l5 stm32g0 stm32g4 stm32mp1 \
1013
stm32wl stm32wb
@@ -40,15 +43,15 @@ CHECK_SRCS := $(foreach crate, $(CRATES), \
4043

4144
# Turn a devices/device.yaml and svd/device.svd into svd/device.svd.patched
4245
svd/%.svd.patched: devices/%.yaml svd/%.svd .deps/%.d
43-
svd patch $<
46+
$(SVDTOOLS) patch $<
4447

4548
svd/%.svd.formatted: svd/%.svd.patched
4649
xmllint $< --format -o $@
4750

4851
# Generate mmap from patched SVD
4952
mmaps/%.mmap: svd/%.svd.patched
5053
@mkdir -p mmaps
51-
svd mmap $< > $@
54+
$(SVDTOOLS) mmap $< > $@
5255

5356
# Generates the common crate files: Cargo.toml, build.rs, src/lib.rs, README.md
5457
crates:
@@ -141,6 +144,6 @@ update-venv:
141144
# Generate dependencies for each device YAML
142145
.deps/%.d: devices/%.yaml
143146
@mkdir -p .deps
144-
svd makedeps $< $@
147+
$(SVDTOOLS) makedeps $< $@
145148

146149
-include .deps/*

0 commit comments

Comments
 (0)