-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMakefile
44 lines (33 loc) · 1.03 KB
/
Makefile
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
40
41
42
43
44
#!/usr/bin/make
TEMP = temp
EXCLUDE = $(shell cat examples/exclude)
EXCLUDE := $(basename $(EXCLUDE))
EXCLUDE := $(addsuffix .vhd,$(EXCLUDE))
VHDLS = $(sort $(wildcard examples/*.vhd))
VHDLS := $(notdir $(VHDLS))
DIFFOPT = --exclude=Makefile
ifndef WIP
VHDLS := $(filter-out $(EXCLUDE),$(VHDLS))
DIFFOPT := $(DIFFOPT) --exclude-from=examples/exclude
endif
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
BINARY = src/vhd2vl
all: $(BINARY)
build $(BINARY):
make -C src
install: $(BINARY)
cp $< $(BINDIR)
test: $(BINARY)
@make -C examples
@rm -fr $(TEMP)/verilog && mkdir -p $(TEMP)/verilog
@echo "##### Translating Examples #####################################"
@cd examples; $(foreach VHDL,$(VHDLS), echo "Translating: $(VHDL)";\
../$(BINARY) --quiet $(VHDL) ../$(TEMP)/verilog/$(basename $(VHDL)).v;)
@make -C translated_examples
@echo "##### Diff #####################################################"
diff -u $(DIFFOPT) translated_examples $(TEMP)/verilog
@echo "PASS"
clean:
make -C src clean
rm -fr $(TEMP)