2018-11-21 06:34:16 +00:00
|
|
|
.PHONY: vis clean common client server passwd subpkgs install uninstall
|
2018-04-04 15:51:03 +00:00
|
|
|
|
2018-10-26 23:05:01 +00:00
|
|
|
SUBPKGS = logger spinsult hkexnet herradurakex
|
2018-07-05 06:07:09 +00:00
|
|
|
TOOLS = hkexpasswd hkexsh hkexshd
|
|
|
|
SUBDIRS = $(LIBS) $(TOOLS)
|
2018-05-27 06:42:43 +00:00
|
|
|
|
2018-11-14 01:38:13 +00:00
|
|
|
INSTPREFIX = /usr/local
|
|
|
|
|
2018-07-05 06:07:09 +00:00
|
|
|
all: common client server passwd
|
2018-04-04 15:51:03 +00:00
|
|
|
|
|
|
|
clean:
|
2018-05-27 06:42:43 +00:00
|
|
|
go clean .
|
|
|
|
for d in $(SUBDIRS); do\
|
|
|
|
$(MAKE) -C $$d clean;\
|
|
|
|
done
|
2018-04-04 15:51:03 +00:00
|
|
|
|
2018-07-05 06:07:09 +00:00
|
|
|
subpkgs:
|
|
|
|
for d in $(SUBPKGS); do\
|
|
|
|
$(MAKE) -C $$d all;\
|
|
|
|
done
|
|
|
|
|
|
|
|
tools:
|
|
|
|
for d in $(TOOLS); do\
|
|
|
|
$(MAKE) -C $$d all;\
|
|
|
|
done
|
|
|
|
|
2018-11-14 01:38:13 +00:00
|
|
|
|
2018-07-05 06:07:09 +00:00
|
|
|
common:
|
2018-04-04 15:51:03 +00:00
|
|
|
go install .
|
|
|
|
|
2018-11-14 01:38:13 +00:00
|
|
|
|
2018-07-05 06:07:09 +00:00
|
|
|
client: common
|
2018-05-27 06:42:43 +00:00
|
|
|
$(MAKE) -C hkexsh
|
2018-04-04 15:51:03 +00:00
|
|
|
|
2018-11-14 01:38:13 +00:00
|
|
|
|
2018-10-26 23:05:01 +00:00
|
|
|
ifeq ($(MSYSTEM),)
|
|
|
|
ifneq ($(GOOS),windows)
|
2018-07-05 06:07:09 +00:00
|
|
|
server: common
|
2018-10-26 23:05:01 +00:00
|
|
|
$(MAKE) -C hkexshd
|
|
|
|
else
|
|
|
|
echo "Cross-build of hkexshd server for Windows not yet supported"
|
|
|
|
endif
|
2018-05-26 22:54:54 +00:00
|
|
|
else
|
2018-07-05 06:07:09 +00:00
|
|
|
server: common
|
2018-10-26 23:05:01 +00:00
|
|
|
echo "hkexshd server not (yet) supported on Windows"
|
2018-05-26 22:54:54 +00:00
|
|
|
endif
|
2018-04-04 15:51:03 +00:00
|
|
|
|
2018-11-14 01:38:13 +00:00
|
|
|
|
2018-07-05 06:07:09 +00:00
|
|
|
passwd: common
|
2018-05-27 06:42:43 +00:00
|
|
|
$(MAKE) -C hkexpasswd
|
2018-04-04 15:51:03 +00:00
|
|
|
|
2018-11-21 06:34:16 +00:00
|
|
|
vis:
|
|
|
|
@which go-code-visualizer >/dev/null 2>&1; \
|
|
|
|
stat=$$?; if [ $$stat -ne "0" ]; then \
|
|
|
|
/bin/echo "go-code-visualizer not found. Run go get github.com/CodeHipster/go-code-visualizer to install."; \
|
|
|
|
else \
|
|
|
|
go-code-visualizer . && dot -Tpng dot-visual.gv -o viz_hkexsh_dot.png; \
|
|
|
|
fi
|
2018-11-14 01:38:13 +00:00
|
|
|
|
|
|
|
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
|