aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-05-28 16:52:40 +0200
committerGitHub <noreply@github.com>2019-05-28 16:52:40 +0200
commit49d641d97f98526484d4ea7021f6ed15584fa4c9 (patch)
tree8df1f934e23d936f28ba2d7b4f52859501aafe7e
parent2a11c48782d31cd6f9c181f7ff52984cc2ae0351 (diff)
parent040b06cb370a8a0a6cdfdf49a605ee2eb113a01c (diff)
downloadyosys-49d641d97f98526484d4ea7021f6ed15584fa4c9.tar.gz
yosys-49d641d97f98526484d4ea7021f6ed15584fa4c9.tar.bz2
yosys-49d641d97f98526484d4ea7021f6ed15584fa4c9.zip
Merge pull request #1048 from mmicko/fix_enable_pyosys
Moved pyosys block in Makefile
-rw-r--r--Makefile23
1 files changed, 15 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 2f5da4110..05b28f33d 100644
--- a/Makefile
+++ b/Makefile
@@ -22,14 +22,6 @@ ENABLE_PROTOBUF := 0
# python wrappers
ENABLE_PYOSYS := 0
-ifeq ($(ENABLE_PYOSYS),1)
-PYTHON_VERSION_TESTCODE := "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));print(t)"
-PYTHON_EXECUTABLE := $(shell if python3 -c ""; then echo "python3"; else echo "python"; fi)
-PYTHON_VERSION := $(shell $(PYTHON_EXECUTABLE) -c ""$(PYTHON_VERSION_TESTCODE)"")
-PYTHON_MAJOR_VERSION := $(shell echo $(PYTHON_VERSION) | cut -f1 -d.)
-PYTHON_PREFIX := $(shell $(PYTHON_EXECUTABLE)-config --prefix)
-PYTHON_DESTDIR := $(PYTHON_PREFIX)/lib/python$(PYTHON_VERSION)/site-packages
-endif
# other configuration flags
ENABLE_GCOV := 0
@@ -145,6 +137,21 @@ $(info $(subst $$--$$,$(newline),$(shell sed 's,^,[Makefile.conf] ,; s,$$,$$--$$
include Makefile.conf
endif
+ifeq ($(ENABLE_PYOSYS),1)
+PYTHON_VERSION_TESTCODE := "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));print(t)"
+PYTHON_EXECUTABLE := $(shell if python3 -c ""; then echo "python3"; else echo "python"; fi)
+PYTHON_VERSION := $(shell $(PYTHON_EXECUTABLE) -c ""$(PYTHON_VERSION_TESTCODE)"")
+PYTHON_MAJOR_VERSION := $(shell echo $(PYTHON_VERSION) | cut -f1 -d.)
+PYTHON_PREFIX := $(shell $(PYTHON_EXECUTABLE)-config --prefix)
+PYTHON_DESTDIR := $(PYTHON_PREFIX)/lib/python$(PYTHON_VERSION)/site-packages
+
+# Reload Makefile.conf to override python specific variables if defined
+ifneq ($(wildcard Makefile.conf),)
+include Makefile.conf
+endif
+
+endif
+
ifeq ($(CONFIG),clang)
CXX = clang
LD = clang++