Archived
1
0

re add pow captcha (initial)

This commit is contained in:
Jeff Becker
2018-02-22 07:53:34 -05:00
parent 2bb4540118
commit c3426871d2
18 changed files with 24656 additions and 7 deletions

View File

@@ -1,7 +1,9 @@
REPO=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
REPO_GOPATH=$(REPO)/go
MINIFY=$(REPO_GOPATH)/bin/minify
JS=$(REPO)/contrib/static/nntpchan.js
STATIC_DIR=$(REPO)/contrib/static
JS=$(STATIC_DIR)/nntpchan.js
MINER_JS=$(STATIC_DIR)/miner-js.js
CONTRIB_JS=$(REPO)/contrib/js/contrib
LOCAL_JS=$(REPO)/contrib/js/nntpchan
VENDOR_JS=$(REPO)/contrib/js/vendor
@@ -15,6 +17,11 @@ NNTPD=$(REPO)/nntpd
GOROOT=$(shell go env GOROOT)
GO=$(GOROOT)/bin/go
GOPHERJS_GOROOT ?= $(GOROOT)
GOPHERJS_GO = $(GOPHERJS_GOROOT)/bin/go
GOPHERJS=$(REPO_GOPATH)/bin/gopherjs
all: clean build
build: js srnd
@@ -23,14 +30,23 @@ full: clean full-build
full-build: srnd beta native
js: $(JS)
js: $(JS) $(MINER_JS)
srnd: $(SRND)
$(MINIFY):
GOPATH=$(REPO_GOPATH) go get -v github.com/tdewolff/minify/cmd/minify
GOPATH=$(REPO_GOPATH) $(GO) get -v github.com/tdewolff/minify/cmd/minify
js-deps: $(MINIFY)
$(GOPHERJS):
GOPATH=$(REPO_GOPATH) $(GOPHERJS_GO) get -v github.com/gopherjs/gopherjs
js-deps: $(MINIFY) $(MINER_JS)
$(MINER_JS): $(GOPHERJS) $(MINIFY)
cp -rf $(SRND_DIR)/src/github.com $(REPO_GOPATH)/src/
GOROOT=$(GOPHERJS_GOROOT) GOPATH=$(REPO_GOPATH) $(GOPHERJS) -m -v build github.com/ZiRo-/cuckgo/miner_js
$(MINIFY) --mime=text/javascript > $(STATIC_DIR)/miner-js.js < miner_js.js
rm -f miner_js.js.map miner_js.js
$(JS): js-deps
rm -f $(JS)
@@ -70,16 +86,16 @@ test-native:
GOROOT=$(GOROOT) $(MAKE) -C $(NNTPCHAN_DAEMON_DIR) test
clean: clean-js clean-srnd
clean: clean-srnd clean-js
clean-full: clean clean-beta clean-native
clean-full: clean clean-beta clean-native clean-js
clean-srnd:
rm -f $(SRND)
GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR) clean
clean-js:
rm -f $(JS)
rm -f $(JS) $(MINER_JS)
clean-beta:
rm -f $(NNTPCHAND)