aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobijuan <juan@iearobotics.com>2017-02-11 10:08:47 +0100
committerobijuan <juan@iearobotics.com>2017-02-11 10:08:47 +0100
commit27098c58ca1a0150fec4b9ec89bf75ff5a8c7fdd (patch)
tree38f2d2991dba375ad668c291d32463bbf1010d1c
parentf2a62a002f09df979bf01bf9fa6c97f1e7cf73d8 (diff)
parent726355628b623bf84ec0d97707589be9df2a8d5a (diff)
downloadghdl-yosys-plugin-27098c58ca1a0150fec4b9ec89bf75ff5a8c7fdd.tar.gz
ghdl-yosys-plugin-27098c58ca1a0150fec4b9ec89bf75ff5a8c7fdd.tar.bz2
ghdl-yosys-plugin-27098c58ca1a0150fec4b9ec89bf75ff5a8c7fdd.zip
Merge remote-tracking branch 'upstream/master'
-rw-r--r--Makefile24
1 files changed, 22 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 6acc130..c62141b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,29 @@
# Prefix where ghdl has been installed
GHDL_PREFIX=
+# GHDL_PREFIX must be defined.
ifeq ($(GHDL_PREFIX),)
$(error GHDL_PREFIX not defined)
endif
-ghdl.so: ghdl/ghdl.cc
- yosys-config --exec --cxx --cxxflags --ldflags -o $@ -shared $< -DYOSYS_ENABLE_GHDL -I$(GHDL_PREFIX)/include $(GHDL_PREFIX)/lib/libghdlsynth.so -Wl,-rpath,$(GHDL_PREFIX)/lib --ldlibs
+LDFLAGS=
+CFLAGS=-O
+
+ALL_LDFLAGS=$(GHDL_PREFIX)/lib/libghdlsynth.so -Wl,-rpath,$(GHDL_PREFIX)/lib $(LDFLAGS)
+
+ALL_CFLAGS=-fPIC -DYOSYS_ENABLE_GHDL -I$(GHDL_PREFIX)/include $(CFLAGS)
+
+COMPILE=yosys-config --exec --cxx
+
+all: ghdl.so
+
+ghdl.so: 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
+
+force: