Skip to content

Commit

Permalink
Simplify dependency rules, move deps to .PRECIOUS
Browse files Browse the repository at this point in the history
  • Loading branch information
Disasm committed Aug 9, 2019
1 parent 0277134 commit 94a455a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ YAMLS := $(foreach crate, $(CRATES), \
# Each yaml file in devices/ exactly name-matches an SVD file in svd/
PATCHED_SVDS := $(patsubst devices/%.yaml, svd/%.svd.patched, $(YAMLS))
FORMATTED_SVDS := $(patsubst devices/%.yaml, svd/%.svd.formatted, $(YAMLS))
DEPS := $(patsubst devices/%.yaml, .deps/%.d, $(YAMLS))

.PRECIOUS: $(DEPS)

# Each device will lead to a crate/src/device/mod.rs file
RUST_SRCS := $(foreach crate, $(CRATES), \
Expand All @@ -34,7 +37,7 @@ CHECK_SRCS := $(foreach crate, $(CRATES), \
$(wildcard devices/$(crate)*.yaml)))

# Turn a devices/device.yaml and svd/device.svd into svd/device.svd.patched
svd/%.svd.patched: devices/%.yaml svd/%.svd
svd/%.svd.patched: devices/%.yaml svd/%.svd .deps/%.d
python3 scripts/svdpatch.py $<

svd/%.svd.formatted: svd/%.svd.patched
Expand Down Expand Up @@ -100,6 +103,4 @@ clean: clean-rs clean-patch clean-html
@mkdir -p .deps
python3 scripts/makedeps.py $< > $@

$(PATCHED_SVDS): $(patsubst devices/%.yaml, .deps/%.d, $(YAMLS))

-include .deps/*

0 comments on commit 94a455a

Please sign in to comment.