2018-11-25 18:24:10 +00:00
|
|
|
.PHONY: lint vis clean common client server passwd subpkgs install uninstall reinstall
|
2018-04-04 15:51:03 +00:00
|
|
|
|
2019-06-21 05:44:19 +00:00
|
|
|
#ifeq ($(MAKEOPTS),)
|
|
|
|
MAKEOPTS = $(MAKEOPTS)
|
|
|
|
#endif
|
|
|
|
|
2019-07-11 17:12:38 +00:00
|
|
|
GIT_COMMIT := $(shell git rev-list -1 HEAD)
|
2019-12-20 04:04:22 +00:00
|
|
|
VERSION := 0.8.9-sys-passwd
|
2019-06-21 05:44:19 +00:00
|
|
|
#ifeq ($(BUILDOPTS),)
|
2019-07-11 17:12:38 +00:00
|
|
|
BUILDOPTS :=$(BUILDOPTS)" -ldflags \"-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT)\""
|
2019-06-21 05:44:19 +00:00
|
|
|
#endif
|
|
|
|
|
2019-10-30 03:34:09 +00:00
|
|
|
SUBPKGS = logger spinsult xsnet
|
|
|
|
TOOLS = xspasswd xs xsd
|
2018-07-05 06:07:09 +00:00
|
|
|
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\
|
2019-07-11 17:12:38 +00:00
|
|
|
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C $$d all;\
|
2018-07-05 06:07:09 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
tools:
|
|
|
|
for d in $(TOOLS); do\
|
2019-07-11 17:12:38 +00:00
|
|
|
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C $$d all;\
|
2018-07-05 06:07:09 +00:00
|
|
|
done
|
|
|
|
|
2018-11-14 01:38:13 +00:00
|
|
|
|
2018-07-05 06:07:09 +00:00
|
|
|
common:
|
2019-07-11 17:12:38 +00:00
|
|
|
go build .
|
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
|
2019-10-30 03:34:09 +00:00
|
|
|
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C xs
|
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
|
2019-10-30 03:34:09 +00:00
|
|
|
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C xsd
|
2018-10-26 23:05:01 +00:00
|
|
|
else
|
2019-10-30 03:34:09 +00:00
|
|
|
echo "Cross-build of xsd server for Windows not yet supported"
|
2018-10-26 23:05:01 +00:00
|
|
|
endif
|
2018-05-26 22:54:54 +00:00
|
|
|
else
|
2018-07-05 06:07:09 +00:00
|
|
|
server: common
|
2019-10-30 03:34:09 +00:00
|
|
|
echo "xsd 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
|
2019-10-30 03:34:09 +00:00
|
|
|
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C xspasswd
|
2018-04-04 15:51:03 +00:00
|
|
|
|
2018-11-21 06:34:16 +00:00
|
|
|
vis:
|
2018-11-22 01:06:09 +00:00
|
|
|
@which go-callvis >/dev/null 2>&1; \
|
2018-11-21 06:34:16 +00:00
|
|
|
stat=$$?; if [ $$stat -ne "0" ]; then \
|
2018-11-22 01:06:09 +00:00
|
|
|
/bin/echo "go-callvis not found. Run go get github.com/Russtopia/go-callvis to install."; \
|
2018-11-21 06:34:16 +00:00
|
|
|
else \
|
2019-10-30 03:34:09 +00:00
|
|
|
make -C xs vis;\
|
|
|
|
make -C xsd vis;\
|
|
|
|
make -C xspasswd vis; \
|
2018-11-21 06:34:16 +00:00
|
|
|
fi
|
2018-11-14 01:38:13 +00:00
|
|
|
|
2018-11-25 18:24:10 +00:00
|
|
|
lint:
|
2019-10-30 03:34:09 +00:00
|
|
|
make -C xspasswd lint
|
|
|
|
make -C xsd lint
|
|
|
|
make -C xs lint
|
2018-11-25 18:24:10 +00:00
|
|
|
|
|
|
|
reinstall: uninstall install
|
|
|
|
|
2018-11-14 01:38:13 +00:00
|
|
|
install:
|
2019-10-30 03:34:09 +00:00
|
|
|
cp xs/xs $(INSTPREFIX)/bin
|
2018-11-14 01:38:13 +00:00
|
|
|
ifeq ($(MSYSTEM),)
|
|
|
|
ifneq ($(GOOS),windows)
|
2019-10-30 03:34:09 +00:00
|
|
|
cp xsd/xsd xspasswd/xspasswd $(INSTPREFIX)/sbin
|
2018-11-14 01:38:13 +00:00
|
|
|
else
|
2019-10-30 03:34:09 +00:00
|
|
|
mv $(INSTPREFIX)/bin/xs $(INSTPREFIX)/bin/_xs
|
|
|
|
cp xs/mintty_wrapper.sh $(INSTPREFIX)/bin/xs
|
|
|
|
echo "Cross-build of xsd server for Windows not yet supported"
|
2018-11-14 01:38:13 +00:00
|
|
|
endif
|
|
|
|
else
|
2019-10-30 03:34:09 +00:00
|
|
|
echo "Cross-build of xsd server for Windows not yet supported"
|
2018-11-14 01:38:13 +00:00
|
|
|
endif
|
2019-10-30 03:34:09 +00:00
|
|
|
cd $(INSTPREFIX)/bin && ln -s xs xc && cd -
|
2018-11-14 01:38:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
uninstall:
|
2019-10-30 03:34:09 +00:00
|
|
|
rm -f $(INSTPREFIX)/bin/xs $(INSTPREFIX)/bin/xc $(INSTPREFIX)/bin/_xs
|
2018-11-14 01:38:13 +00:00
|
|
|
ifeq ($(MSYSTEM),)
|
|
|
|
ifneq ($(GOOS),windows)
|
2019-10-30 03:34:09 +00:00
|
|
|
rm -f $(INSTPREFIX)/sbin/xsd $(INSTPREFIX)/sbin/xspasswd
|
2018-11-14 01:38:13 +00:00
|
|
|
else
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
endif
|