aboutsummaryrefslogtreecommitdiff
path: root/test/ppu-stm-integration-demo/makefile
blob: 12f504ff031f1bf9cf0e5c6d62f621d8efe1d9f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.PHONY: all clean

SRCS := $(wildcard *.txt)
SRCS += $(patsubst %.pvc,%.txt, $(wildcard *.pvc))
TARGETS += $(patsubst %.txt,%.h, $(SRCS))
TARGETS += $(patsubst %.txt,%-ppu.tb.vhd, $(SRCS))
TARGETS += $(patsubst %.txt,%-spi.tb.vhd, $(SRCS))

.PRECIOUS: $(SRCS)

all: $(TARGETS)

%.txt: %.pvc
	sed 's/.*://g' $< | tr -d ' \n' | sed 's/\(.\{4\}\)\(.\{4\}\)/\L\1: \2\n/g' > $@

%.h: %.txt ./data2test.awk
	tr -d ':' < $< | ./data2test.awk > $@

%-ppu.tb.vhd: %.txt ./data2pputb.awk
	tr -d ':' < $< | ./data2pputb.awk > $@

%-spi.tb.vhd: %.txt ./data2spitb.awk
	(tr -d ':' < $<; echo "ffff ffff") | ./data2spitb.awk > $@

clean:
	$(RM) $(TARGETS)