summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: cddd9071b03bf927c88ebce1f510856223efc8c7 (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
27
28
29
30
31
32
33
34
35
36
37
38
#!/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

all: diff

translate:
	@make -C src
	@make -C examples
	@rm -fr $(TEMP)/verilog
	@mkdir -p $(TEMP)/verilog
	@echo "##### Translating Examples #####################################"
	@cd examples; $(foreach VHDL,$(VHDLS), echo "Translating: $(VHDL)";\
	../src/vhd2vl --quiet $(VHDL) ../$(TEMP)/verilog/$(basename $(VHDL)).v;)
	@make -C translated_examples

diff: translate
	@echo "##### Diff #####################################################"
	diff -u $(DIFFOPT) translated_examples $(TEMP)/verilog
	@echo "PASS"

clean:
	make -C src clean
	rm -fr $(TEMP)
OpenPOWER on IntegriCloud