-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 786 Bytes
/
Makefile
File metadata and controls
39 lines (29 loc) · 786 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
39
TESTS=$(shell find . -maxdepth 1 -name '*.test.v')
BINS=$(TESTS:.v=.run)
VFLAGS=-g 2009 -Wall
all: $(BINS)
%.run: %.v
iverilog -o $@ $(VFLAGS) $<
clean:
rm -fv *.run Makefile.deps
tar:
mkdir mgoldman_proj2
cp *.v mgoldman_proj2
cp Makefile mgoldman_proj2
cp README.txt mgoldman_proj2
cp -r tests mgoldman_proj2
tar cvf mgoldman_proj2.tar mgoldman_proj2
rm -rf mgoldman_proj2
.INTERMEDIATE: $(BINS:.run=.v.dep)
%.v.dep: %.v
$(eval TMPF=$(shell mktemp))
iverilog -o /dev/null $(VFLAGS) -Minclude=$(TMPF) $<
gsed -i -e "1i $@:" -e 's/\.v\.dep:/.run:/' $(TMPF)
paste -sd ' ' $(TMPF) > $@
paste -sd ' ' $(TMPF) | sed -e 's/\.v\.dep:/.run:/' >> $@
rm -f $(TMPF)
Makefile.deps: $(BINS:.run=.v.dep)
cat $^ /dev/null > $@
ifneq ($(BINS),)
include Makefile.deps
endif