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
|
2019-10-06 16:36:19 +02:00
|
|
|
|
ver=3.0.6
|
2016-11-14 16:42:27 +01:00
|
|
|
|
|
2018-11-14 08:06:26 +01:00
|
|
|
|
# wsltty appx release - must have 4 parts!
|
2019-10-06 16:36:19 +02:00
|
|
|
|
verx=3.0.6.0
|
2018-11-14 08:06:26 +01:00
|
|
|
|
|
2016-11-14 16:42:27 +01:00
|
|
|
|
# mintty release version
|
2019-10-06 16:36:19 +02:00
|
|
|
|
minttyver=3.0.6
|
2017-12-15 21:58:28 +01:00
|
|
|
|
|
2019-10-06 16:36:19 +02:00
|
|
|
|
# wslbridge release version
|
|
|
|
|
wslbridgever=0.4
|
2016-11-14 16:42:27 +01:00
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
##############################
|
2017-06-24 01:32:20 +02:00
|
|
|
|
|
2019-10-06 16:36:19 +02:00
|
|
|
|
# mintty branch or commit version
|
|
|
|
|
#minttyver=master
|
|
|
|
|
|
|
|
|
|
# wslbridge branch or commit to build from source;
|
2018-04-08 11:33:19 +02:00
|
|
|
|
wslbridge=wslbridge-frontend wslbridge-backend
|
2017-12-15 21:58:28 +01:00
|
|
|
|
|
2019-10-06 16:36:19 +02:00
|
|
|
|
##############################
|
|
|
|
|
# Windows SDK version for appx
|
|
|
|
|
WINSDKKEY=/HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432Node/Microsoft/.NET Framework Platform/Setup/Multi-Targeting Pack
|
|
|
|
|
WINSDKVER=`regtool list '$(WINSDKKEY)' | sed -e '$$ q' -e d`
|
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
#############################################################################
|
|
|
|
|
# default target
|
|
|
|
|
|
2018-07-02 01:26:08 +02:00
|
|
|
|
all: all-$(notdir $(CURDIR))
|
|
|
|
|
|
|
|
|
|
all-wsltty: check pkg
|
|
|
|
|
|
|
|
|
|
all-wsltty.appx: appx
|
2017-12-15 21:58:28 +01:00
|
|
|
|
|
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
|
|
|
|
|
2018-11-14 08:06:26 +01:00
|
|
|
|
#############################################################################
|
|
|
|
|
# patch version information for appx package configuration
|
|
|
|
|
|
|
|
|
|
fix-verx:
|
|
|
|
|
echo patching $(WINSDKVER) into Launcher config
|
|
|
|
|
cd Launcher; sed -i~ -e "/<supportedRuntime / s,Version=v[.0-9]*,Version=$(WINSDKVER)," app.config
|
|
|
|
|
echo patched app.config
|
|
|
|
|
cd Launcher; sed -i~ -e "/<TargetFrameworkVersion>/ s,v[.0-9]*,$(WINSDKVER)," Launcher.csproj
|
|
|
|
|
echo patched Launcher.csproj
|
|
|
|
|
echo patching $(verx) into app config
|
|
|
|
|
sed -i~ -e '/<Identity / s,Version="[.0-9]*",Version="$(verx)",' AppxManifest.xml
|
|
|
|
|
echo patched AppxManifest.xml
|
|
|
|
|
|
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
|
|
|
|
|
2019-10-02 00:57:48 +02:00
|
|
|
|
wslbridge2-$(wslbridgever).zip:
|
|
|
|
|
$(wgeto) https://github.com/Biswa96/wslbridge2/archive/v$(wslbridgever).zip -o wslbridge2-$(wslbridgever).zip
|
2017-12-15 21:58:28 +01:00
|
|
|
|
|
2019-10-02 00:57:48 +02:00
|
|
|
|
wslbridge-source: wslbridge2-$(wslbridgever).zip
|
|
|
|
|
unzip -ou wslbridge2-$(wslbridgever).zip
|
|
|
|
|
cp wslbridge2-$(wslbridgever)/LICENSE LICENSE.wslbridge2
|
2018-01-09 16:35:05 +01:00
|
|
|
|
|
2017-12-15 21:58:28 +01:00
|
|
|
|
wslbridge-frontend: wslbridge-source
|
2019-10-02 00:57:48 +02:00
|
|
|
|
echo ------------- Compiling wslbridge2 frontend
|
2016-11-14 16:42:27 +01:00
|
|
|
|
mkdir -p bin
|
2019-10-06 16:36:19 +02:00
|
|
|
|
rm -f bin/wslbridge2.exe bin/hvpty.exe
|
2019-10-14 00:00:00 +02:00
|
|
|
|
# frontend build
|
2019-10-06 16:36:19 +02:00
|
|
|
|
cd wslbridge2-$(wslbridgever); make RELEASE=1
|
2019-10-14 00:00:00 +02:00
|
|
|
|
# extract binaries
|
2019-10-02 00:57:48 +02:00
|
|
|
|
cp wslbridge2-$(wslbridgever)/bin/wslbridge2.exe bin/
|
|
|
|
|
cp wslbridge2-$(wslbridgever)/bin/hvpty.exe bin/
|
|
|
|
|
|
2019-10-14 00:00:00 +02:00
|
|
|
|
# build backend on a musl-libc-based distribution
|
|
|
|
|
BuildDistr=Alpine
|
|
|
|
|
|
2019-10-02 00:57:48 +02:00
|
|
|
|
wslbridge-backend: wslbridge-source
|
|
|
|
|
echo ------------- Compiling wslbridge2 backend
|
|
|
|
|
uname -m | grep x86_64
|
2017-12-15 21:58:28 +01:00
|
|
|
|
mkdir -p bin
|
2019-10-06 16:36:19 +02:00
|
|
|
|
rm -f bin/wslbridge2-backend bin/hvpty-backend
|
2019-10-14 00:00:00 +02:00
|
|
|
|
# provide dependencies for backend build
|
|
|
|
|
cmd /C wsl -d $(BuildDistr) apk add make g++ linux-headers
|
|
|
|
|
# invoke backend build
|
|
|
|
|
cd wslbridge2-$(wslbridgever); cmd /C wsl -d $(BuildDistr) make RELEASE=1 < /dev/null
|
|
|
|
|
# extract binaries
|
2019-10-02 00:57:48 +02:00
|
|
|
|
cp wslbridge2-$(wslbridgever)/bin/wslbridge2-backend bin/
|
|
|
|
|
cp wslbridge2-$(wslbridgever)/bin/hvpty-backend bin/
|
2016-11-14 16:42:27 +01:00
|
|
|
|
|
2017-01-27 14:49:06 +01:00
|
|
|
|
mintty-get:
|
|
|
|
|
$(wgeto) https://github.com/mintty/mintty/archive/$(minttyver).zip -o mintty-$(minttyver).zip
|
|
|
|
|
unzip -o mintty-$(minttyver).zip
|
2019-01-20 19:49:49 +01:00
|
|
|
|
cp mintty-$(minttyver)/icon/terminal.ico mintty.ico
|
2017-01-27 14:49:06 +01:00
|
|
|
|
|
2017-10-23 00:01:54 +02:00
|
|
|
|
wslbuild=LDFLAGS="-static -static-libgcc -s"
|
2018-07-23 20:53:31 +02:00
|
|
|
|
appxbuild=$(wslbuild) CCOPT=-DWSLTTY_APPX
|
2017-10-23 00:01:54 +02:00
|
|
|
|
wslversion=VERSION_SUFFIX="– wsltty $(ver)" WSLTTY_VERSION="$(ver)"
|
2018-07-04 21:37:53 +02:00
|
|
|
|
appxversion=VERSION_SUFFIX="– wsltty appx $(verx)" WSLTTY_VERSION="$(verx)"
|
2017-10-23 00:01:54 +02:00
|
|
|
|
|
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/
|
2019-04-11 00:00:00 +02:00
|
|
|
|
strip bin/mintty.exe
|
2018-07-02 01:26:08 +02:00
|
|
|
|
|
2018-07-04 21:37:53 +02:00
|
|
|
|
mintty-build-appx:
|
|
|
|
|
# ensure rebuild of version-specific check and message
|
|
|
|
|
rm -f mintty-$(minttyver)/bin/*/windialog.o
|
|
|
|
|
# build mintty
|
|
|
|
|
cd mintty-$(minttyver)/src; make $(appxbuild) $(appxversion)
|
|
|
|
|
mkdir -p bin
|
|
|
|
|
cp mintty-$(minttyver)/bin/mintty.exe bin/
|
2019-04-11 00:00:00 +02:00
|
|
|
|
strip bin/mintty.exe
|
2018-07-04 21:37:53 +02:00
|
|
|
|
|
2018-07-02 01:26:08 +02:00
|
|
|
|
mintty-pkg:
|
2017-01-27 14:49:06 +01:00
|
|
|
|
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 ../../
|
2019-05-03 05:01:28 +02:00
|
|
|
|
cd mintty-$(minttyver)/sounds; zoo a sounds *.wav *.WAV *.md; mv sounds.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
|
|
|
|
|
2018-07-02 01:26:08 +02:00
|
|
|
|
mintty-appx:
|
|
|
|
|
mkdir -p usr/share/mintty
|
2019-05-03 05:01:28 +02:00
|
|
|
|
cd usr/share/mintty; mkdir -p lang themes sounds info
|
2018-07-02 01:26:08 +02:00
|
|
|
|
cp mintty-$(minttyver)/lang/*.po usr/share/mintty/lang/
|
|
|
|
|
cp mintty-$(minttyver)/themes/*[!~] usr/share/mintty/themes/
|
2019-05-03 05:01:28 +02:00
|
|
|
|
cp mintty-$(minttyver)/sounds/*.wav usr/share/mintty/sounds/
|
|
|
|
|
cp mintty-$(minttyver)/sounds/*.WAV usr/share/mintty/sounds/
|
2018-07-02 01:26:08 +02:00
|
|
|
|
# add charnames.txt to support "Character Info"
|
|
|
|
|
cd mintty-$(minttyver)/src; sh ./mknames
|
|
|
|
|
cp mintty-$(minttyver)/src/charnames.txt usr/share/mintty/info/
|
|
|
|
|
|
2019-08-07 23:48:03 +02:00
|
|
|
|
cygwin: # mkshortcutexe
|
2016-09-11 14:20:39 +02:00
|
|
|
|
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
|
|
|
|
|
2019-08-07 20:37:08 +02:00
|
|
|
|
mkshortcutexe: bin/mkshortcut.exe
|
|
|
|
|
|
|
|
|
|
bin/mkshortcut.exe: mkshortcut.c
|
|
|
|
|
echo mksh
|
2019-08-07 00:00:00 +02:00
|
|
|
|
gcc -o bin/mkshortcut mkshortcut.c -lpopt -lole32 /usr/lib/w32api/libuuid.a
|
|
|
|
|
cp /bin/cygpopt-0.dll bin/
|
2019-08-07 20:51:34 +02:00
|
|
|
|
cp /bin/cygiconv-2.dll bin/
|
|
|
|
|
cp /bin/cygintl-8.dll bin/
|
2019-08-07 00:00:00 +02:00
|
|
|
|
|
2018-07-02 01:26:08 +02:00
|
|
|
|
appx-bin:
|
|
|
|
|
mkdir -p bin
|
|
|
|
|
cp /bin/cygwin1.dll bin/
|
|
|
|
|
cp /bin/cygwin-console-helper.exe bin/
|
|
|
|
|
|
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/
|
2019-05-03 05:01:28 +02:00
|
|
|
|
cp sounds.zoo rel/
|
2018-04-02 23:35:40 +02:00
|
|
|
|
cp charnames.txt rel/
|
2019-10-02 00:57:48 +02:00
|
|
|
|
cp bin/wslbridge2.exe rel/
|
|
|
|
|
cp bin/wslbridge2-backend rel/
|
|
|
|
|
cp bin/hvpty.exe rel/
|
|
|
|
|
cp bin/hvpty-backend rel/
|
2019-08-07 23:48:03 +02:00
|
|
|
|
cp mkshortcut.vbs rel/
|
|
|
|
|
#cp bin/mkshortcut.exe rel/
|
|
|
|
|
#cp bin/cygpopt-0.dll rel/
|
|
|
|
|
#cp bin/cygiconv-2.dll rel/
|
|
|
|
|
#cp bin/cygintl-8.dll 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
|
|
|
|
|
|
2018-07-02 01:26:08 +02:00
|
|
|
|
mintty: mintty-get mintty-build
|
|
|
|
|
|
|
|
|
|
mintty-usr: mintty-get mintty-appx
|
|
|
|
|
|
|
|
|
|
# local wsltty build target:
|
|
|
|
|
wsltty: wslbridge cygwin mintty-build mintty-pkg
|
|
|
|
|
|
|
|
|
|
# standalone wsltty package build target:
|
|
|
|
|
pkg: wslbridge cygwin mintty-get mintty-build mintty-pkg cab
|
|
|
|
|
|
|
|
|
|
# appx package contents target:
|
2018-07-04 21:37:53 +02:00
|
|
|
|
wsltty-appx: wslbridge appx-bin mintty-get mintty-build-appx mintty-appx
|
2017-01-27 14:49:06 +01:00
|
|
|
|
|
2018-07-02 01:26:08 +02:00
|
|
|
|
# appx package target:
|
2018-11-14 08:06:26 +01:00
|
|
|
|
appx: wsltty-appx fix-verx
|
2018-07-02 01:26:08 +02:00
|
|
|
|
sh ./build.sh
|
2017-01-06 16:47:13 +01:00
|
|
|
|
|
2016-09-11 14:20:39 +02:00
|
|
|
|
#############################################################################
|
|
|
|
|
# end
|