Merge remote-tracking branch 'origin/master' into eddie/cleanup
[yosys.git] / backends / smt2 / Makefile.inc
1
2 OBJS += backends/smt2/smt2.o
3
4 ifneq ($(CONFIG),mxe)
5 ifneq ($(CONFIG),emcc)
6
7 # MSYS targets support yosys-smtbmc, but require a launcher script
8 ifeq ($(CONFIG),$(filter $(CONFIG),msys2 msys2-64))
9 TARGETS += yosys-smtbmc.exe yosys-smtbmc-script.py
10 # Needed to find the Python interpreter for yosys-smtbmc scripts.
11 # Override if necessary, it is only used for msys2 targets.
12 PYTHON := $(shell cygpath -w -m $(PREFIX)/bin/python3)
13
14 yosys-smtbmc-script.py: backends/smt2/smtbmc.py
15 $(P) sed -e 's|##yosys-sys-path##|sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' \
16 -e "s|#!/usr/bin/env python3|#!$(PYTHON)|" < $< > $@
17
18 yosys-smtbmc.exe: misc/launcher.c yosys-smtbmc-script.py
19 $(P) gcc -DGUI=0 -O -s -o $@ $<
20 # Other targets
21 else
22 TARGETS += yosys-smtbmc
23
24 yosys-smtbmc: backends/smt2/smtbmc.py
25 $(P) sed 's|##yosys-sys-path##|sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' < $< > $@.new
26 $(Q) chmod +x $@.new
27 $(Q) mv $@.new $@
28 endif
29
30 $(eval $(call add_share_file,share/python3,backends/smt2/smtio.py))
31 endif
32 endif