2016-09-11 14:20:39 +02:00
|
|
|
|
#############################################################################
|
2017-01-30 16:31:17 +01:00
|
|
|
|
# build a wsltty installer package:
|
|
|
|
|
# configure ver=... and minttyver= in this makefile
|
|
|
|
|
# make targets:
|
2018-02-06 10:51:07 +01:00
|
|
|
|
# make [all] build a distributable installer (default)
|
|
|
|
|
# make pkg build an installer, bypassing the system checks
|
|
|
|
|
# make wsltty build the software, using the local copy of mintty
|
2017-01-30 16:31:17 +01:00
|
|
|
|
|
2016-09-11 14:20:39 +02:00
|
|
|
|
|
2016-11-14 16:42:27 +01:00
|
|
|
|
# wsltty release
|
2018-04-18 10:46:17 +02:00
|
|
|
|
ver=1.8.5.3
|
2016-11-14 16:42:27 +01:00
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
##############################
|
2016-11-14 16:42:27 +01:00
|
|
|
|
# mintty release version
|
2018-04-11 16:40:43 +02:00
|
|
|
|
minttyver=2.8.5
|
2017-12-15 21:58:28 +01:00
|
|
|
|
|
|
|
|
|
# or mintty branch or commit version
|
2018-04-11 16:40:43 +02:00
|
|
|
|
#minttyver=master
|
2016-11-14 16:42:27 +01:00
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
##############################
|
2017-12-16 20:08:31 +01:00
|
|
|
|
# wslbridge binary package; may be overridden below
|
2017-12-15 21:58:28 +01:00
|
|
|
|
wslbridge=wslbridge-package
|
2017-10-23 00:01:54 +02:00
|
|
|
|
wslbridgever=0.2.4
|
2017-06-24 01:32:20 +02:00
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
# or wslbridge branch or commit to build from source;
|
|
|
|
|
# also set wslbridge-commit
|
2018-04-08 11:33:19 +02:00
|
|
|
|
wslbridge=wslbridge-frontend wslbridge-backend
|
2017-12-15 21:58:28 +01:00
|
|
|
|
|
|
|
|
|
# release 0.2.0 does not have cygwin_internal(CW_SYNC_WINENV) yet:
|
|
|
|
|
#wslbridge-commit=master
|
2017-10-23 00:01:54 +02:00
|
|
|
|
|
|
|
|
|
# use --distro-guid option (merged into 0.2.4):
|
|
|
|
|
#wslbridge-commit=cb22e3f6f989cefe5b6599d3c04422ded74db664
|
2016-11-14 16:42:27 +01:00
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
# after 0.2.4, from branch login-mode:
|
|
|
|
|
wslbridge-commit=04a060505860915c99bc336dbeb80269771a80b7
|
|
|
|
|
|
2018-04-08 11:33:19 +02:00
|
|
|
|
# after 0.2.4, from branch wslpath:
|
|
|
|
|
wslbridge-commit=29df86d87135caec8424c08f031ce121a3a39ae1
|
|
|
|
|
|
2018-04-11 16:40:43 +02:00
|
|
|
|
# after 0.2.4, merged wslpath branch:
|
|
|
|
|
wslbridge-commit=06fb7acba28d7f37611f3911685af214739895a0
|
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
#############################################################################
|
|
|
|
|
# default target
|
|
|
|
|
|
|
|
|
|
all: check pkg
|
|
|
|
|
|
2016-11-14 16:42:27 +01:00
|
|
|
|
#############################################################################
|
|
|
|
|
# target checking and some defs
|
2016-09-11 14:20:39 +02:00
|
|
|
|
|
|
|
|
|
TARGET := $(shell $(CC) -dumpmachine)
|
|
|
|
|
|
|
|
|
|
ifeq ($(TARGET), i686-pc-cygwin)
|
|
|
|
|
sys := cygwin32
|
|
|
|
|
else ifeq ($(TARGET), x86_64-pc-cygwin)
|
|
|
|
|
sys := cygwin64
|
|
|
|
|
else ifeq ($(TARGET), i686-pc-msys)
|
|
|
|
|
sys := msys32
|
|
|
|
|
else ifeq ($(TARGET), x86_64-pc-msys)
|
|
|
|
|
sys := msys64
|
|
|
|
|
else
|
|
|
|
|
$(error Target '$(TARGET)' not supported)
|
|
|
|
|
endif
|
|
|
|
|
|
2016-11-14 16:42:27 +01:00
|
|
|
|
wget=curl -R -L --connect-timeout 55 -O
|
|
|
|
|
wgeto=curl -R -L --connect-timeout 55
|
2016-09-14 15:37:55 +02:00
|
|
|
|
|
2016-10-11 18:04:15 +02:00
|
|
|
|
#############################################################################
|
2018-02-06 10:51:07 +01:00
|
|
|
|
# system check:
|
|
|
|
|
# - ensure the path name drag-and-drop adaptation works (-> Cygwin, not MSYS)
|
|
|
|
|
# - 64 Bit (x86_64) for more stable invocation (avoid fork issues)
|
2016-10-11 18:04:15 +02:00
|
|
|
|
|
|
|
|
|
check:
|
2016-11-14 16:42:27 +01:00
|
|
|
|
# checking suitable host environment; run `make pkg` to bypass
|
2016-11-15 12:41:19 +01:00
|
|
|
|
# check cygwin (vs msys) for proper drag-and-drop paths:
|
|
|
|
|
uname | grep CYGWIN
|
2018-02-06 10:51:07 +01:00
|
|
|
|
# check 32 bit to ensure 32-Bit Windows support, just in case:
|
2017-04-14 01:08:20 +02:00
|
|
|
|
#uname -m | grep i686
|
2018-02-06 10:51:07 +01:00
|
|
|
|
# check 64 bit to provide 64-Bit stability support:
|
2017-04-14 01:08:20 +02:00
|
|
|
|
uname -m | grep x86_64
|
2016-10-11 18:04:15 +02:00
|
|
|
|
|
2016-09-11 14:20:39 +02:00
|
|
|
|
#############################################################################
|
|
|
|
|
# generation
|
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
wslbridge: $(wslbridge)
|
2016-11-14 16:42:27 +01:00
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
wslbridge-package:
|
2016-09-14 15:37:55 +02:00
|
|
|
|
$(wget) https://github.com/rprichard/wslbridge/releases/download/$(wslbridgever)/wslbridge-$(wslbridgever)-$(sys).tar.gz
|
2016-09-11 14:20:39 +02:00
|
|
|
|
tar xvzf wslbridge-$(wslbridgever)-$(sys).tar.gz
|
|
|
|
|
mkdir -p bin
|
2016-11-15 12:41:19 +01:00
|
|
|
|
cp wslbridge-$(wslbridgever)-$(sys)/wslbridge* bin/
|
2017-07-28 14:14:51 +02:00
|
|
|
|
tr -d '\015' < wslbridge-$(wslbridgever)-$(sys)/LICENSE.txt > LICENSE.wslbridge
|
2016-09-11 14:20:39 +02:00
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
wslbridge-source: wslbridge-$(wslbridge-commit).zip
|
2017-07-28 14:14:51 +02:00
|
|
|
|
unzip -o wslbridge-$(wslbridge-commit).zip
|
2017-12-15 21:58:28 +01:00
|
|
|
|
tr -d '\015' < wslbridge-$(wslbridge-commit)/LICENSE.txt > LICENSE.wslbridge
|
|
|
|
|
|
2018-01-09 16:35:05 +01:00
|
|
|
|
wslbridge-$(wslbridge-commit).zip:
|
|
|
|
|
$(wgeto) https://github.com/rprichard/wslbridge/archive/$(wslbridge-commit).zip -o wslbridge-$(wslbridge-commit).zip
|
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
wslbridge-frontend: wslbridge-source
|
2017-07-28 14:14:51 +02:00
|
|
|
|
cd wslbridge-$(wslbridge-commit)/frontend; make
|
|
|
|
|
strip wslbridge-$(wslbridge-commit)/out/wslbridge.exe
|
2016-11-14 16:42:27 +01:00
|
|
|
|
mkdir -p bin
|
2017-07-28 14:14:51 +02:00
|
|
|
|
cp wslbridge-$(wslbridge-commit)/out/wslbridge.exe bin/
|
2017-12-15 21:58:28 +01:00
|
|
|
|
|
|
|
|
|
wslbridge-backend: wslbridge-source
|
|
|
|
|
cd wslbridge-$(wslbridge-commit)/backend; wslbridge make
|
|
|
|
|
mkdir -p bin
|
|
|
|
|
cp wslbridge-$(wslbridge-commit)/out/wslbridge-backend bin/
|
2016-11-14 16:42:27 +01:00
|
|
|
|
|
2017-01-27 14:49:06 +01:00
|
|
|
|
mintty: mintty-get mintty-build
|
|
|
|
|
|
|
|
|
|
mintty-get:
|
|
|
|
|
$(wgeto) https://github.com/mintty/mintty/archive/$(minttyver).zip -o mintty-$(minttyver).zip
|
|
|
|
|
unzip -o mintty-$(minttyver).zip
|
|
|
|
|
|
2017-10-23 00:01:54 +02:00
|
|
|
|
wslbuild=LDFLAGS="-static -static-libgcc -s"
|
|
|
|
|
wslversion=VERSION_SUFFIX="– wsltty $(ver)" WSLTTY_VERSION="$(ver)"
|
|
|
|
|
|
2017-01-27 14:49:06 +01:00
|
|
|
|
mintty-build:
|
2018-01-25 14:04:22 +01:00
|
|
|
|
# ensure rebuild of version-specific check and message
|
|
|
|
|
rm -f mintty-$(minttyver)/bin/*/windialog.o
|
|
|
|
|
# build mintty
|
2017-10-23 00:01:54 +02:00
|
|
|
|
cd mintty-$(minttyver)/src; make $(wslbuild) $(wslversion)
|
2016-09-11 14:20:39 +02:00
|
|
|
|
mkdir -p bin
|
2017-01-27 14:49:06 +01:00
|
|
|
|
cp mintty-$(minttyver)/bin/mintty.exe bin/
|
|
|
|
|
cp mintty-$(minttyver)/LICENSE LICENSE.mintty
|
2017-11-09 17:08:29 +01:00
|
|
|
|
cd mintty-$(minttyver)/lang; zoo a lang *.po; mv lang.zoo ../../
|
|
|
|
|
cd mintty-$(minttyver)/themes; zoo a themes *[!~]; mv themes.zoo ../../
|
2018-04-02 23:35:40 +02:00
|
|
|
|
# add charnames.txt to support "Character Info"
|
|
|
|
|
cd mintty-$(minttyver)/src; sh ./mknames
|
|
|
|
|
cp mintty-$(minttyver)/src/charnames.txt .
|
2016-09-11 14:20:39 +02:00
|
|
|
|
|
|
|
|
|
cygwin:
|
|
|
|
|
mkdir -p bin
|
|
|
|
|
cp /bin/cygwin1.dll bin/
|
|
|
|
|
cp /bin/cygwin-console-helper.exe bin/
|
2017-07-28 14:14:51 +02:00
|
|
|
|
cp /bin/dash.exe bin/
|
|
|
|
|
cp /bin/regtool.exe bin/
|
2017-01-06 16:47:13 +01:00
|
|
|
|
cp /bin/zoo.exe bin/
|
2016-09-11 14:20:39 +02:00
|
|
|
|
|
2017-05-19 22:20:23 +02:00
|
|
|
|
cop: ver
|
2016-09-11 14:20:39 +02:00
|
|
|
|
mkdir -p rel
|
2017-01-06 16:47:13 +01:00
|
|
|
|
rm -fr rel/wsltty-$(ver)-install.exe
|
2016-09-11 14:20:39 +02:00
|
|
|
|
sed -e "s,%version%,$(ver)," makewinx.cfg > rel/wsltty.SED
|
|
|
|
|
cp bin/cygwin1.dll rel/
|
|
|
|
|
cp bin/cygwin-console-helper.exe rel/
|
2017-07-28 14:14:51 +02:00
|
|
|
|
cp bin/dash.exe rel/
|
|
|
|
|
cp bin/regtool.exe rel/
|
2016-09-11 14:20:39 +02:00
|
|
|
|
cp bin/mintty.exe rel/
|
2017-01-06 16:47:13 +01:00
|
|
|
|
cp bin/zoo.exe rel/
|
2017-11-09 17:08:29 +01:00
|
|
|
|
cp lang.zoo rel/
|
|
|
|
|
cp themes.zoo rel/
|
2018-04-02 23:35:40 +02:00
|
|
|
|
cp charnames.txt rel/
|
2016-09-11 14:20:39 +02:00
|
|
|
|
cp bin/wslbridge.exe rel/
|
|
|
|
|
cp bin/wslbridge-backend rel/
|
2016-11-16 16:46:50 +01:00
|
|
|
|
cp LICENSE.* rel/
|
2017-07-28 14:14:51 +02:00
|
|
|
|
cp VERSION rel/
|
2016-11-16 16:46:50 +01:00
|
|
|
|
cp *.lnk rel/
|
2017-07-28 14:14:51 +02:00
|
|
|
|
cp *.ico rel/
|
2016-11-16 16:46:50 +01:00
|
|
|
|
cp *.url rel/
|
|
|
|
|
cp *.bat rel/
|
2017-07-28 14:14:51 +02:00
|
|
|
|
cp *.sh rel/
|
2018-04-18 10:46:17 +02:00
|
|
|
|
cp *.vbs rel/
|
2017-05-19 22:20:23 +02:00
|
|
|
|
|
|
|
|
|
cab: cop
|
2016-09-11 14:20:39 +02:00
|
|
|
|
cd rel; iexpress /n wsltty.SED
|
|
|
|
|
|
2017-05-19 22:20:23 +02:00
|
|
|
|
install: cop installbat
|
|
|
|
|
|
|
|
|
|
installbat:
|
|
|
|
|
cd rel; cmd /C install
|
|
|
|
|
|
|
|
|
|
ver:
|
|
|
|
|
echo $(ver) > VERSION
|
|
|
|
|
|
2017-01-27 14:49:06 +01:00
|
|
|
|
pkg: wslbridge cygwin mintty cab
|
|
|
|
|
|
2018-02-06 10:51:07 +01:00
|
|
|
|
wsltty: wslbridge cygwin mintty-build
|
2017-01-06 16:47:13 +01:00
|
|
|
|
|
2016-09-11 14:20:39 +02:00
|
|
|
|
#############################################################################
|
|
|
|
|
# end
|