aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-05-28 14:53:07 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2019-05-28 14:53:07 +0200
commit1575d962fa57ad06ad541cdac364893590e687f5 (patch)
tree11847a3fd5e3776241fa35327be687cd863a89a8 /Makefile
parent2a11c48782d31cd6f9c181f7ff52984cc2ae0351 (diff)
downloadyosys-1575d962fa57ad06ad541cdac364893590e687f5.tar.gz
yosys-1575d962fa57ad06ad541cdac364893590e687f5.tar.bz2
yosys-1575d962fa57ad06ad541cdac364893590e687f5.zip
Moved pyosys block in Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 16 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 2f5da4110..0b99de001 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,22 @@ $(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),)
+$(info $(subst $$--$$,$(newline),$(shell sed 's,^,[Makefile.conf] ,; s,$$,$$--$$,;' < Makefile.conf | tr -d '\n' | sed 's,\$$--\$$$$,,')))
+include Makefile.conf
+endif
+
+endif
+
ifeq ($(CONFIG),clang)
CXX = clang
LD = clang++