windows/MSYS Make install improvements

Signed-off-by: Russ Magee <rmagee@gmail.com>
This commit is contained in:
Russ Magee 2018-12-26 15:36:13 -08:00
parent 0a59bbedc8
commit 3fb66694c6
2 changed files with 43 additions and 26 deletions

View File

@ -4,6 +4,18 @@ SUBPKGS = logger spinsult hkexnet
TOOLS = hkexpasswd hkexsh hkexshd
SUBDIRS = $(LIBS) $(TOOLS)
ifeq $(MSYSTEM),MSYS)
GOOS=windows
endif
ifeq ($(GOOS),windows)
ifeq ($(MSYSTEM),MSYS)
SBIN=bin
endif
else
SBIN=sbin
endif
INSTPREFIX = /usr/local
all: common client server passwd
@ -33,21 +45,29 @@ client: common
$(MAKE) -C hkexsh
ifeq ($(MSYSTEM),)
ifneq ($(GOOS),windows)
server: common
$(MAKE) -C hkexshd
ifeq ($(GOOS),windows)
ifeq ($(MSYSTEM),MSYS)
@echo "(GOOS=windows, MSYSTEM=MSYS):hkexshd server not (yet) supported on Windows"
else
echo "Cross-build of hkexshd server for Windows not yet supported"
@echo "(GOOS=windows, MSYSTEM=?):Cross-build of hkexshd server not (yet) supported"
endif
else
server: common
echo "hkexshd server not (yet) supported on Windows"
$(MAKE) -C hkexshd
endif
passwd: common
ifneq ($(GOOS),windows)
ifeq ($(MSYSTEM),MSYS)
@echo "(GOOS=windows, MSYSTEM=MSYS): Building hkexpasswd, but won't install until hkexshd works on (windows,MSYS)."
$(MAKE) -C hkexpasswd
else
@echo "(GOOS=windows, MSYSTEM=?): unsupported uninstall config."
endif
else
$(MAKE) -C hkexpasswd
endif
vis:
@which go-callvis >/dev/null 2>&1; \
@ -66,28 +86,23 @@ lint:
reinstall: uninstall install
install:
cp hkexsh/hkexsh $(INSTPREFIX)/bin
ifeq ($(MSYSTEM),)
ifneq ($(GOOS),windows)
cp hkexshd/hkexshd hkexpasswd/hkexpasswd $(INSTPREFIX)/sbin
install: client server passwd
ifeq ($(GOOS),windows)
ifeq ($(MSYSTEM),MSYS)
cp hkexsh/hkexsh.exe $(INSTPREFIX)/bin/.hkexsh.exe
cp hkexsh/hkexsh.exe $(INSTPREFIX)/bin/.hkexcp.exe
cp hkexsh/mintty_wrapper.sh $(INSTPREFIX)/bin/hkexsh.exe
cp hkexsh/mintty_wrapper.sh $(INSTPREFIX)/bin/hkexcp.exe
else
mv $(INSTPREFIX)/bin/hkexsh $(INSTPREFIX)/bin/_hkexsh
cp hkexsh/mintty_wrapper.sh $(INSTPREFIX)/bin/hkexsh
echo "Cross-build of hkexshd server for Windows not yet supported"
@echo "(GOOS=windows, MSYSTEM=?):unsupported install config."
endif
else
echo "Cross-build of hkexshd server for Windows not yet supported"
endif
cp hkexsh/hkexsh $(INSTPREFIX)/bin/hkexsh
cp hkexshd/hkexshd hkexpasswd/hkexpasswd $(INSTPREFIX)/$(SBIN)
cd $(INSTPREFIX)/bin && ln -s hkexsh hkexcp && cd -
endif
uninstall:
rm -f $(INSTPREFIX)/bin/hkexsh $(INSTPREFIX)/bin/hkexcp $(INSTPREFIX)/bin/_hkexsh
ifeq ($(MSYSTEM),)
ifneq ($(GOOS),windows)
rm -f $(INSTPREFIX)/sbin/hkexshd $(INSTPREFIX)/sbin/hkexpasswd
else
endif
else
endif
rm -f $(INSTPREFIX)/bin/hkexsh* $(INSTPREFIX)/bin/hkexcp* $(INSTPREFIX)/bin/.hkexsh*
rm -f $(INSTPREFIX)/$(SBIN)/hkexshd* $(INSTPREFIX)/$(SBIN)/hkexpasswd*

View File

@ -28,10 +28,12 @@ cleanup() {
stty sane
}
me="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
if [ ${1}x == "-hx" ]; then
./hkexsh -h
."$me".exe -h
else
stty -echo raw icrnl
./hkexsh $@
."$me".exe $@
fi