aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-03 07:32:48 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-03 07:32:48 +0200
commit88a33b79bf70f3a27a5274daab03a90683163226 (patch)
treeb08a56c56c621d5e66051edb6b057259c25d994c /Makefile
parent6d167784e474c9c25cee655b22b7703666c32d7e (diff)
downloadghdl-yosys-plugin-88a33b79bf70f3a27a5274daab03a90683163226.tar.gz
ghdl-yosys-plugin-88a33b79bf70f3a27a5274daab03a90683163226.tar.bz2
ghdl-yosys-plugin-88a33b79bf70f3a27a5274daab03a90683163226.zip
Makefile: add install target.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 11 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index c62141b..60b65da 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,9 @@ ifeq ($(GHDL_PREFIX),)
$(error GHDL_PREFIX not defined)
endif
+YOSYS_CONFIG=yosys-config
+SOEXT=so
+
LDFLAGS=
CFLAGS=-O
@@ -15,17 +18,21 @@ ALL_LDFLAGS=$(GHDL_PREFIX)/lib/libghdlsynth.so -Wl,-rpath,$(GHDL_PREFIX)/lib $(L
ALL_CFLAGS=-fPIC -DYOSYS_ENABLE_GHDL -I$(GHDL_PREFIX)/include $(CFLAGS)
-COMPILE=yosys-config --exec --cxx
+COMPILE=$(YOSYS_CONFIG) --exec --cxx
-all: ghdl.so
+all: ghdl.$(SOEXT)
-ghdl.so: ghdl.o
+ghdl.$(SOEXT): ghdl.o
$(COMPILE) -o $@ -shared $< -shared $(ALL_LDFLAGS) --ldflags --ldlibs
ghdl.o: ghdl/ghdl.cc
$(COMPILE) -c --cxxflags -o $@ $< $(ALL_CFLAGS)
clean: force
- $(RM) -f ghdl.so ghdl.o
+ $(RM) -f ghdl.$(SOEXT) ghdl.o
+
+install: ghdl.$(SOEXT)
+ $(YOSYS_CONFIG) --exec mkdir -p --datdir/plugins
+ $(YOSYS_CONFIG) --exec cp $< --datdir/plugins
force: