makefile: add support for built-in ghdl-yosys-plugin
authorumarcor <unai.martinezcorral@ehu.eus>
Mon, 28 Dec 2020 01:24:41 +0000 (02:24 +0100)
committerumarcor <unai.martinezcorral@ehu.eus>
Mon, 28 Dec 2020 21:45:00 +0000 (22:45 +0100)
Co-authored-by: Tristan Gingold <tgingold@free.fr>
Co-authored-by: whitequark <whitequark@whitequark.org>
Makefile

index 57bf2a7268e6fc30b05393515584c79d5014575f..76018a014343a76a10d34447afe2d9a52ff8d058 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,7 @@ ENABLE_GLOB := 1
 ENABLE_PLUGINS := 1
 ENABLE_READLINE := 1
 ENABLE_EDITLINE := 0
+ENABLE_GHDL := 0
 ENABLE_VERIFIC := 0
 ENABLE_COVER := 1
 ENABLE_LIBYOSYS := 0
@@ -511,6 +512,14 @@ endif
 endif
 endif
 
+ifeq ($(ENABLE_GHDL),1)
+GHDL_PREFIX ?= $(PREFIX)
+GHDL_INCLUDE_DIR ?= $(GHDL_DIR)/include
+GHDL_LIB_DIR ?= $(GHDL_DIR)/lib
+CXXFLAGS += -I$(GHDL_INCLUDE_DIR) -DYOSYS_ENABLE_GHDL
+LDLIBS += $(GHDL_LIB_DIR)/libghdl.a $(file <$(GHDL_LIB_DIR)/libghdl.link)
+endif
+
 ifeq ($(ENABLE_VERIFIC),1)
 VERIFIC_DIR ?= /usr/local/src/verific_lib
 VERIFIC_COMPONENTS ?= verilog vhdl database util containers hier_tree