aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2022-01-08 06:17:06 +0100
committerDaniel Gröber <dxld@darkboxed.org>2022-01-08 07:59:58 +0100
commitf6fdc36d556173bc18f5e3c34f1ad18c925f72bc (patch)
tree48d7d135e4187a44834d59608a90abb3caf1cee0
parent09a32cd13c3335e3231d6ccd32c033826c6a3798 (diff)
downloadghdl-yosys-plugin-f6fdc36d556173bc18f5e3c34f1ad18c925f72bc.tar.gz
ghdl-yosys-plugin-f6fdc36d556173bc18f5e3c34f1ad18c925f72bc.tar.bz2
ghdl-yosys-plugin-f6fdc36d556173bc18f5e3c34f1ad18c925f72bc.zip
Support installing into $DESTDIR
This makes packaging easier for distributions as installation is usually staged in a temporary directory when building intallable packages.
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c2d9d25..06d768d 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,7 @@ LIBGHDL_LIB:=$(shell $(GHDL) --libghdl-library-path)
LIBGHDL_INC:=$(shell $(GHDL) --libghdl-include-dir)
ALL_LDFLAGS=$(LIBGHDL_LIB) -Wl,-rpath,$(dir $(LIBGHDL_LIB)) $(LDFLAGS)
+DATDIR:=$(shell $(YOSYS_CONFIG) --datdir)
ALL_CFLAGS=-fPIC -DYOSYS_ENABLE_GHDL -I$(LIBGHDL_INC) $(CFLAGS)
@@ -29,8 +30,8 @@ clean: force
$(RM) -f ghdl.$(SOEXT) ghdl.o
install: ghdl.$(SOEXT)
- $(YOSYS_CONFIG) --exec mkdir -p --datdir/plugins
- $(YOSYS_CONFIG) --exec cp $< --datdir/plugins
+ $(YOSYS_CONFIG) --exec mkdir -p $(DESTDIR)$(DATDIR)/plugins
+ $(YOSYS_CONFIG) --exec cp $< $(DESTDIR)$(DATDIR)/plugins
-include src/ghdl.d