-Makefile: added install,uninstall targets

-Bumped version to 0.7pre

Signed-off-by: Russ Magee <rmagee@gmail.com>
This commit is contained in:
Russ Magee 2018-11-13 17:38:13 -08:00
parent 1d1feee476
commit d973c83e01
2 changed files with 34 additions and 2 deletions

View file

@ -1,9 +1,11 @@
.PHONY: info clean common client server passwd subpkgs .PHONY: info clean common client server passwd subpkgs install uninstall
SUBPKGS = logger spinsult hkexnet herradurakex SUBPKGS = logger spinsult hkexnet herradurakex
TOOLS = hkexpasswd hkexsh hkexshd TOOLS = hkexpasswd hkexsh hkexshd
SUBDIRS = $(LIBS) $(TOOLS) SUBDIRS = $(LIBS) $(TOOLS)
INSTPREFIX = /usr/local
all: common client server passwd all: common client server passwd
clean: clean:
@ -22,12 +24,15 @@ tools:
$(MAKE) -C $$d all;\ $(MAKE) -C $$d all;\
done done
common: common:
go install . go install .
client: common client: common
$(MAKE) -C hkexsh $(MAKE) -C hkexsh
ifeq ($(MSYSTEM),) ifeq ($(MSYSTEM),)
ifneq ($(GOOS),windows) ifneq ($(GOOS),windows)
server: common server: common
@ -40,6 +45,33 @@ server: common
echo "hkexshd server not (yet) supported on Windows" echo "hkexshd server not (yet) supported on Windows"
endif endif
passwd: common passwd: common
$(MAKE) -C hkexpasswd $(MAKE) -C hkexpasswd
install:
cp hkexsh/hkexsh $(INSTPREFIX)/bin
ifeq ($(MSYSTEM),)
ifneq ($(GOOS),windows)
cp hkexshd/hkexshd hkexpasswd/hkexpasswd $(INSTPREFIX)/sbin
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"
endif
else
echo "Cross-build of hkexshd server for Windows not yet supported"
endif
cd $(INSTPREFIX)/bin && ln -s hkexsh hkexcp && cd -
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

View file

@ -7,5 +7,5 @@
// golang implementation by Russ Magee (rmagee_at_gmail.com) // golang implementation by Russ Magee (rmagee_at_gmail.com)
package hkexsh package hkexsh
const Version = "0.6pre (NO WARRANTY)" const Version = "0.7pre (NO WARRANTY)"