blob: ab8d2f9c568771a53635d010efe483a594f08b18 [file] [log] [blame]
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
SOURCES := $(shell find -name '*.cc')
OBJS := $(SOURCES:cc=o)
NAME := $(patsubst %-plugin,%,$(notdir $(shell pwd)))
$(NAME).so: $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS)
install_plugin: $(NAME).so
mkdir -p $(PLUGINS_DIR)
cp $< $(PLUGINS_DIR)/$<
test:
$(MAKE) -C tests all
.PHONY: install
install: install_plugin
clean:
rm -f *.d *.o *.so
$(MAKE) -C tests clean