Merge pull request #96 from YosysHQ/claire/btorscript
[SymbiYosys.git] / Makefile
1
2 DESTDIR =
3 PREFIX = /usr/local
4
5 # On Windows, manually setting absolute path to Python binary may be required
6 # for launcher executable to work. From MSYS2, this can be done using the
7 # following command: "which python3 | cygpath -w -m -f -".
8 ifeq ($(OS), Windows_NT)
9 PYTHON = $(shell cygpath -w -m $(PREFIX)/bin/python3)
10 endif
11
12 help:
13 @echo ""
14 @echo "sudo make install"
15 @echo " build and install SymbiYosys (sby)"
16 @echo ""
17 @echo "make html"
18 @echo " build documentation in docs/build/html/"
19 @echo ""
20 @echo "make clean"
21 @echo " cleanup"
22 @echo ""
23
24 install:
25 mkdir -p $(DESTDIR)$(PREFIX)/bin
26 mkdir -p $(DESTDIR)$(PREFIX)/share/yosys/python3
27 cp sbysrc/sby_*.py $(DESTDIR)$(PREFIX)/share/yosys/python3/
28 ifeq ($(OS), Windows_NT)
29 sed -e 's|##yosys-sys-path##|sys.path += [os.path.dirname(__file__) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' \
30 -e "s|#!/usr/bin/env python3|#!$(PYTHON)|" < sbysrc/sby.py > $(DESTDIR)$(PREFIX)/bin/sby-script.py
31 gcc -DGUI=0 -O -s -o $(DESTDIR)$(PREFIX)/bin/sby.exe extern/launcher.c
32 else
33 sed 's|##yosys-sys-path##|sys.path += [os.path.dirname(__file__) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' < sbysrc/sby.py > $(DESTDIR)$(PREFIX)/bin/sby
34 chmod +x $(DESTDIR)$(PREFIX)/bin/sby
35 endif
36
37 html:
38 make -C docs html
39
40 clean:
41 make -C docs clean
42 rm -rf docs/build sbysrc/sby sbysrc/__pycache__
43