/
Makefile
33 lines (24 loc) · 884 Bytes
/
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
CXX = $(shell yosys-config --cxx)
CXXFLAGS = $(shell yosys-config --cxxflags)
LDFLAGS = $(shell yosys-config --ldflags)
LDLIBS = $(shell yosys-config --ldlibs)
PLUGINS_DIR = $(shell yosys-config --datdir)/plugins
OBJS = vhdl_parser.tab.o vhdl_lexer.o vhdl_frontend.o preproc.o
vhdl.so: vhdl_parser.tab.o vhdl_lexer.o vhdl_frontend.o preproc.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS)
$(MAKE) test
vhdl_parser.tab.cc: vhdl_parser.y def.h
bison -d -r all -b vhdl_parser $<
mv vhdl_parser.tab.c vhdl_parser.tab.cc
vhdl_parser.tab.h: vhdl_parser.tab.cc
vhdl_lexer.cc: vhdl_lexer.l def.h vhdl_parser.tab.h
flex -d -i -o $@ $<
.PHONY: test
test:
cd test; ./runtests
.PHONY: install
install: vhdl.so
mkdir -p $(PLUGINS_DIR)
cp vhdl.so $(PLUGINS_DIR)/vhdl.so
clean:
rm -f *.d *.o vhdl.so vhdl_lexer.cc vhdl_parser.output vhdl_parser.tab.cc vhdl_parser.tab.h