3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-23 13:25:31 +00:00

Install launcher executable when running on Windows.

Signed-off-by: William D. Jones <thor0505@comcast.net>
This commit is contained in:
William D. Jones 2019-03-12 00:50:52 -04:00
parent cef50242df
commit a14f0ac5af
2 changed files with 371 additions and 0 deletions

View file

@ -2,6 +2,13 @@
DESTDIR =
PREFIX = /usr/local
# On Windows, manually setting absolute path to Python binary may be required
# for launcher executable to work. From MSYS2, this can be done using the
# following command: "which python3 | cygpath -w -m -f -".
ifeq ($(OS), Windows_NT)
PYTHON = $(shell cygpath -w -m $(PREFIX)/bin/python3)
endif
help:
@echo ""
@echo "sudo make install"
@ -18,8 +25,14 @@ install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(PREFIX)/share/yosys/python3
cp sbysrc/sby_*.py $(DESTDIR)$(PREFIX)/share/yosys/python3/
ifeq ($(OS), Windows_NT)
sed -e 's|##yosys-sys-path##|sys.path += [os.path.dirname(__file__) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' \
-e "s|#!/usr/bin/env python3|#!$(PYTHON)|" < sbysrc/sby.py > $(DESTDIR)$(PREFIX)/bin/sby-script.py
gcc -DGUI=0 -O -s -o $(DESTDIR)$(PREFIX)/bin/sby.exe extern/launcher.c
else
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
chmod +x $(DESTDIR)$(PREFIX)/bin/sby
endif
html:
make -C docs html