From 3c41ad5479be9991c2e30351a973b9e078b0e716 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 10 Feb 2017 22:24:11 +0100 Subject: Add Makefile to build ghdl as a yosys module. --- Makefile | 11 +++++++++++ README.md | 24 ++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6acc130 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +# Build ghdl module for yosys + +# Prefix where ghdl has been installed +GHDL_PREFIX= + +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 diff --git a/README.md b/README.md index 4ef0883..48efb0f 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,29 @@ VHDL synthesis (based on ghdl) This is awfully experimental and work in progress! -## How to build +## How to build as a module -FIXME: should provide an easy way to build as a module! +Get and install yosys. + +Get ghdl from github, +build and install +build and install libghdlsynth.so: +```sh +$ make libghdlsynth.so +$ make install.libghdlsynth.shared +``` + +From ghdlsynth-beta: + +make GHDL_PREFIX=prefix-used-to-configure-ghdl + +This generates ghdl.so, which can be used directly: + +```sh +$ yosys -m ghdl.so +``` + +## How to build (not recommended) Get ghdl from github, build and install -- cgit v1.2.3