[yosys] 16/38: Improved building of plugins

Ruben Undheim rubund-guest at moszumanska.debian.org
Mon Feb 9 19:36:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

rubund-guest pushed a commit to tag upstream/0.5.0
in repository yosys.

commit 743da01e9ec7be4d6d7db293b49ef81048570251
Author: Clifford Wolf <clifford at clifford.at>
Date:   Sat Feb 7 19:04:06 2015 +0100

    Improved building of plugins
---
 CodingReadme |  5 +++++
 Makefile     | 34 +++++++++++++++++++++++++++++++---
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/CodingReadme b/CodingReadme
index 78bc5a3..0b141ce 100644
--- a/CodingReadme
+++ b/CodingReadme
@@ -319,6 +319,11 @@ Also with default config setting:
 	bash example.sh
 
 
+Test building plugins with various of the standard passes:
+
+	yosys-config --build test.so equiv_simple.cc
+
+
 Finally if a current verific library is available:
 
 	cd ~yosys
diff --git a/Makefile b/Makefile
index 679f361..9c26873 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,9 @@ ENABLE_NDEBUG := 0
 DESTDIR := /usr/local
 INSTALL_SUDO :=
 
+TARGET_BINDIR := $(DESTDIR)/bin
+TARGET_DATDIR := $(DESTDIR)/share/yosys
+
 EXE =
 OBJS =
 GENFILES =
@@ -32,7 +35,8 @@ SMALL = 0
 
 all: top-all
 
-CXXFLAGS = -Wall -Wextra -ggdb -I"$(shell pwd)" -MD -DYOSYS_SRC='"$(shell pwd)"' -D_YOSYS_ -fPIC -I$(DESTDIR)/include
+YOSYS_SRC := $(shell pwd)
+CXXFLAGS = -Wall -Wextra -ggdb -I"$(YOSYS_SRC)" -MD -D_YOSYS_ -fPIC -I$(DESTDIR)/include
 LDFLAGS = -L$(DESTDIR)/lib
 LDLIBS = -lstdc++ -lm
 SED = sed
@@ -161,6 +165,10 @@ $(1)/$(notdir $(2)): $(2)
 	$$(Q) cp $(2) $(1)/$(notdir $(2))
 endef
 
+define add_include_file
+$(eval $(call add_share_file,$(dir share/include/$(1)),$(1)))
+endef
+
 ifeq ($(PRETTY), 1)
 P_STATUS = 0
 P_OFFSET = 0
@@ -176,7 +184,26 @@ Q =
 S =
 endif
 
+$(eval $(call add_include_file,kernel/yosys.h))
+$(eval $(call add_include_file,kernel/hashlib.h))
+$(eval $(call add_include_file,kernel/log.h))
+$(eval $(call add_include_file,kernel/rtlil.h))
+$(eval $(call add_include_file,kernel/register.h))
+$(eval $(call add_include_file,kernel/celltypes.h))
+$(eval $(call add_include_file,kernel/consteval.h))
+$(eval $(call add_include_file,kernel/sigtools.h))
+$(eval $(call add_include_file,kernel/modtools.h))
+$(eval $(call add_include_file,kernel/macc.h))
+$(eval $(call add_include_file,kernel/utils.h))
+$(eval $(call add_include_file,kernel/satgen.h))
+$(eval $(call add_include_file,libs/ezsat/ezsat.h))
+$(eval $(call add_include_file,libs/ezsat/ezminisat.h))
+$(eval $(call add_include_file,libs/sha1/sha1.h))
+$(eval $(call add_include_file,passes/fsm/fsmdata.h))
+$(eval $(call add_include_file,backends/ilang/ilang_backend.h))
+
 OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o kernel/yosys.o
+kernel/log.o: CXXFLAGS += -DYOSYS_SRC='"$(YOSYS_SRC)"'
 
 OBJS += libs/bigint/BigIntegerAlgorithms.o libs/bigint/BigInteger.o libs/bigint/BigIntegerUtils.o
 OBJS += libs/bigint/BigUnsigned.o libs/bigint/BigUnsignedInABase.o
@@ -246,8 +273,9 @@ kernel/version_$(GIT_REV).cc: Makefile
 			$(CXX) --version | tr ' ()' '\n' | grep '^[0-9]' | head -n1` $(filter -f% -m% -O% -DNDEBUG,$(CXXFLAGS)))\"; }" > kernel/version_$(GIT_REV).cc
 
 yosys-config: misc/yosys-config.in
-	$(P) $(SED) -e 's, at CXX@,$(CXX),;' -e 's, at CXXFLAGS@,$(CXXFLAGS),;' -e 's, at LDFLAGS@,$(LDFLAGS),;' -e 's, at LDLIBS@,$(LDLIBS),;' \
-			-e 's, at BINDIR@,$(DESTDIR)/bin,;' -e 's, at DATDIR@,$(DESTDIR)/share/yosys,;' < misc/yosys-config.in > yosys-config
+	$(P) $(SED) -e 's, at CXXFLAGS@,$(subst -I"$(YOSYS_SRC)",-I"$(TARGET_DATDIR)/include",$(CXXFLAGS)),;' \
+			-e 's, at CXX@,$(CXX),;' -e 's, at LDFLAGS@,$(LDFLAGS),;' -e 's, at LDLIBS@,$(LDLIBS),;' \
+			-e 's, at BINDIR@,$(TARGET_BINDIR),;' -e 's, at DATDIR@,$(TARGET_DATDIR),;' < misc/yosys-config.in > yosys-config
 	$(Q) chmod +x yosys-config
 
 abc/abc-$(ABCREV)$(EXE):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/yosys.git



More information about the debian-science-commits mailing list