############################################################################# # build a wsltty installer package: # configure ver=... and minttyver= in this makefile # make targets: # make [all] build a distributable installer (default) # make pkg build an installer, bypassing the system checks # make build build the software (no installer) # make install install wsltty locally from build (no installer needed) # make wsltty build the software, using the local copy of mintty # wsltty release ver=3.6.4 # wsltty appx release - must have 4 parts! verx=3.6.4.1 ############################## # mintty release version minttyver=3.6.4 ############################## # wslbridge2 repository repo=Biswa96/wslbridge2 # wslbridge2 master release version wslbridgever=0.11 # wslbridge2 latest version #archive=master #wslbridgedir=wslbridge2-$(archive) # wslbridge2 branch or commit version (from fix-window-resize branch) and dir #commit=70e0dcea1db122d076ce1578f2a45280cc92d09f #commit=8b6dd7ee2b3102d72248990c21764c5cf86c6612 #archive=$(commit) #wslbridgedir=wslbridge2-$(archive) # wslbridge2 fork repository and version #repo=mintty/wslbridge2 #wslbridgever=0.5.1 # wslbridge2 release or fork archive and dir archive=v$(wslbridgever) wslbridgedir=wslbridge2-$(wslbridgever) ############################## # mintty branch or commit version #minttyver=master # wslbridge branch or commit to build from source; wslbridge=wslbridge-frontend wslbridge-backend ############################## # build backend on a musl-libc-based distribution # (reportedly not needed anymore but untested) BuildDistr=-d Alpine ############################## # 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` ############################################################################# # default target all: all-$(notdir $(CURDIR)) all-wsltty: check pkg all-wsltty.appx: appx ############################################################################# # target checking and some defs 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 wget=curl -R -L --connect-timeout 55 -O wgeto=curl -R -L --connect-timeout 55 ############################################################################# # 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) arch:=$(shell uname -m) check: # checkarch echo Building for: echo $(arch) | grep . # checking suitable host environment; run `make pkg` to bypass # check cygwin (vs msys) for proper drag-and-drop paths: uname | grep CYGWIN checkarch: # check 32 bit to ensure 32-Bit Windows support, just in case: #uname -m | grep i686 # check 64 bit to provide 64-Bit stability support: #uname -m | grep x86_64 ############################################################################# # patch version information for appx package configuration fix-verx: echo patching $(WINSDKVER) into Launcher config cd Launcher; sed -i~ -e "// s,v[.0-9]*,$(WINSDKVER)," Launcher.csproj echo patched Launcher.csproj echo patching $(verx) into app config sed -i~ -e '/ rel/wsltty.SED # build installer cd rel; iexpress /n wsltty.SED silent-installer: # prepare build of installer rm -f rel/$(CAB)-install-quiet.exe cd rel; sed -e "/ShowInstallProgramWindow/ s/0/1/" -e "/HideExtractAnimation/ s/0/1/" -e "/InstallPrompt/ s/=.*/=/" -e "/FinishMessage/ s/=.*/=/" -e "/TargetName/ s/install.exe/install-quiet.exe/" wsltty.SED > wsltty-quiet.SED # build installer cd rel; iexpress /n wsltty-quiet.SED InstallPrompt=Install Mintty terminal for WSL Portable? FinishMessage=Mintty for WSL Portable installation finished portable-installer: # prepare build of installer rm -f rel/$(CAB)-install-portable.exe cd rel; sed -e "/InstallPrompt/ s/=.*/=$(InstallPrompt)/" -e "/FinishMessage/ s/=.*/=$(FinishMessage)/" -e "/AppLaunched/ s/install/install-portable/" -e "/TargetName/ s/install.exe/install-portable.exe/" wsltty.SED > wsltty-portable.SED # build installer cd rel; iexpress /n wsltty-portable.SED install: cop installbat installbat: cd rel; cmd /C install ver: echo $(ver) > VERSION mintty: mintty-get mintty-build mintty-usr: mintty-get mintty-appx # local wsltty build target: wsltty: wslbridge cygwin mintty-build mintty-pkg # build software without installer: build: wslbridge cygwin mintty-get mintty-build mintty-pkg # standalone wsltty package build target: pkg: wslbridge cygwin mintty-get mintty-build mintty-pkg installer # appx package contents target: wsltty-appx: wslbridge appx-bin mintty-get mintty-build-appx mintty-appx # appx package target: appx: wsltty-appx fix-verx sh ./build.sh ############################################################################# # end