From 88a33b79bf70f3a27a5274daab03a90683163226 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 3 Jul 2019 07:32:48 +0200 Subject: Makefile: add install target. --- Makefile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'Makefile') 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: -- cgit v1.2.3