2017-04-04 18:01:32 +05:00
|
|
|
REPO=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
REPO_GOPATH=$(REPO)/go
|
|
|
|
MINIFY=$(REPO_GOPATH)/bin/minify
|
2018-02-22 19:48:03 +05:00
|
|
|
JS=$(REPO)/contrib/static/nntpchan.js
|
2017-04-04 18:01:32 +05:00
|
|
|
CONTRIB_JS=$(REPO)/contrib/js/contrib
|
|
|
|
LOCAL_JS=$(REPO)/contrib/js/nntpchan
|
|
|
|
VENDOR_JS=$(REPO)/contrib/js/vendor
|
|
|
|
SRND_DIR=$(REPO)/contrib/backends/srndv2
|
2017-09-24 17:18:56 +05:00
|
|
|
NNTPCHAND_DIR=$(REPO)/contrib/backends/nntpchand
|
|
|
|
NNTPCHAN_DAEMON_DIR=$(REPO)/contrib/backends/nntpchan-daemon
|
2017-04-04 18:01:32 +05:00
|
|
|
SRND=$(REPO)/srndv2
|
2017-09-24 19:00:03 +05:00
|
|
|
NNTPCHAND=$(REPO)/nntpchand
|
|
|
|
NNTPD=$(REPO)/nntpd
|
|
|
|
|
2017-09-12 22:08:26 +05:00
|
|
|
GOROOT=$(shell go env GOROOT)
|
|
|
|
GO=$(GOROOT)/bin/go
|
2017-04-04 18:01:32 +05:00
|
|
|
|
2018-02-22 19:48:03 +05:00
|
|
|
<<<<<<< HEAD
|
2018-02-22 17:53:34 +05:00
|
|
|
GOPHERJS_GOROOT ?= $(GOROOT)
|
|
|
|
GOPHERJS_GO = $(GOPHERJS_GOROOT)/bin/go
|
|
|
|
|
2018-02-22 17:56:28 +05:00
|
|
|
GOPHERJS_GOPATH=$(REPO)/gopherjs_go
|
|
|
|
GOPHERJS=$(GOPHERJS_GOPATH)/bin/gopherjs
|
2018-02-22 17:53:34 +05:00
|
|
|
|
2018-02-22 19:48:03 +05:00
|
|
|
=======
|
|
|
|
>>>>>>> parent of c342687... re add pow captcha (initial)
|
2017-04-04 20:01:02 +05:00
|
|
|
all: clean build
|
2017-04-04 18:01:32 +05:00
|
|
|
|
|
|
|
build: js srnd
|
|
|
|
|
2017-09-24 19:00:03 +05:00
|
|
|
full: clean full-build
|
|
|
|
|
|
|
|
full-build: srnd beta native
|
|
|
|
|
2018-02-22 19:48:03 +05:00
|
|
|
js: $(JS)
|
2017-04-04 18:01:32 +05:00
|
|
|
|
|
|
|
srnd: $(SRND)
|
|
|
|
|
|
|
|
$(MINIFY):
|
2018-02-22 19:48:03 +05:00
|
|
|
<<<<<<< HEAD
|
2018-02-22 17:53:34 +05:00
|
|
|
GOPATH=$(REPO_GOPATH) $(GO) get -v github.com/tdewolff/minify/cmd/minify
|
|
|
|
|
|
|
|
$(GOPHERJS):
|
2018-02-22 17:56:28 +05:00
|
|
|
GOROOT=$(GOPHERJS_GOROOT) GOPATH=$(GOPHERJS_GOPATH) $(GOPHERJS_GO) get -v github.com/gopherjs/gopherjs
|
2017-04-04 18:01:32 +05:00
|
|
|
|
2018-02-22 17:53:34 +05:00
|
|
|
js-deps: $(MINIFY) $(MINER_JS)
|
|
|
|
|
|
|
|
$(MINER_JS): $(GOPHERJS) $(MINIFY)
|
2018-02-22 17:56:28 +05:00
|
|
|
cp -rf $(SRND_DIR)/src/github.com $(GOPHERJS_GOPATH)/src/
|
|
|
|
GOROOT=$(GOPHERJS_GOROOT) GOPATH=$(GOPHERJS_GOPATH) $(GOPHERJS) -m -v build github.com/ZiRo-/cuckgo/miner_js
|
2018-02-22 17:53:34 +05:00
|
|
|
$(MINIFY) --mime=text/javascript > $(STATIC_DIR)/miner-js.js < miner_js.js
|
|
|
|
rm -f miner_js.js.map miner_js.js
|
2018-02-22 19:48:03 +05:00
|
|
|
=======
|
|
|
|
GOPATH=$(REPO_GOPATH) go get -v github.com/tdewolff/minify/cmd/minify
|
|
|
|
|
|
|
|
js-deps: $(MINIFY)
|
|
|
|
>>>>>>> parent of c342687... re add pow captcha (initial)
|
2017-04-04 18:01:32 +05:00
|
|
|
|
|
|
|
$(JS): js-deps
|
2017-04-04 21:54:17 +05:00
|
|
|
rm -f $(JS)
|
2017-04-04 18:01:32 +05:00
|
|
|
for f in $(CONTRIB_JS)/*.js ; do $(MINIFY) --mime=text/javascript >> $(JS) < $$f ; done
|
|
|
|
$(MINIFY) --mime=text/javascript >> $(JS) < $(REPO)/contrib/js/entry.js
|
|
|
|
for f in $(LOCAL_JS)/*.js ; do $(MINIFY) --mime=text/javascript >> $(JS) < $$f ; done
|
|
|
|
for f in $(VENDOR_JS)/*.js ; do $(MINIFY) --mime=text/javascript >> $(JS) < $$f ; done
|
|
|
|
|
|
|
|
|
|
|
|
$(SRND):
|
2017-09-12 22:08:26 +05:00
|
|
|
GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR)
|
2017-08-26 18:40:24 +05:00
|
|
|
cp $(SRND_DIR)/srndv2 $(SRND)
|
|
|
|
|
2017-09-24 19:00:03 +05:00
|
|
|
beta: $(NNTPCHAND)
|
|
|
|
|
|
|
|
$(NNTPCHAND):
|
|
|
|
GOROOT=$(GOROOT) $(MAKE) -C $(NNTPCHAND_DIR)
|
|
|
|
cp $(NNTPCHAND_DIR)/nntpchand $(NNTPCHAND)
|
|
|
|
|
|
|
|
native: $(NNTPD)
|
|
|
|
|
|
|
|
$(NNTPD):
|
|
|
|
$(MAKE) -C $(NNTPCHAN_DAEMON_DIR)
|
|
|
|
cp $(NNTPCHAN_DAEMON_DIR)/nntpd $(NNTPD)
|
|
|
|
|
|
|
|
test: test-srnd
|
|
|
|
|
|
|
|
test-full: test-srnd test-beta test-native
|
2017-09-24 17:18:56 +05:00
|
|
|
|
2017-09-24 19:00:03 +05:00
|
|
|
test-srnd:
|
2017-09-24 17:18:56 +05:00
|
|
|
GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR) test
|
2017-09-24 19:00:03 +05:00
|
|
|
|
|
|
|
test-beta:
|
2017-09-24 17:18:56 +05:00
|
|
|
GOROOT=$(GOROOT) $(MAKE) -C $(NNTPCHAND_DIR) test
|
|
|
|
|
|
|
|
test-native:
|
|
|
|
GOROOT=$(GOROOT) $(MAKE) -C $(NNTPCHAN_DAEMON_DIR) test
|
|
|
|
|
2017-09-24 19:00:03 +05:00
|
|
|
|
2018-02-22 19:48:03 +05:00
|
|
|
clean: clean-js clean-srnd
|
2017-09-26 18:37:44 +05:00
|
|
|
|
2018-02-22 19:48:03 +05:00
|
|
|
clean-full: clean clean-beta clean-native
|
2017-09-24 19:00:03 +05:00
|
|
|
|
|
|
|
clean-srnd:
|
|
|
|
rm -f $(SRND)
|
2017-09-12 22:08:26 +05:00
|
|
|
GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR) clean
|
2017-04-04 18:01:32 +05:00
|
|
|
|
2017-09-24 19:00:03 +05:00
|
|
|
clean-js:
|
2018-02-22 19:48:03 +05:00
|
|
|
rm -f $(JS)
|
2017-09-24 19:00:03 +05:00
|
|
|
|
|
|
|
clean-beta:
|
|
|
|
rm -f $(NNTPCHAND)
|
|
|
|
GOROOT=$(GOROOT) $(MAKE) -C $(NNTPCHAND_DIR) clean
|
|
|
|
|
|
|
|
clean-native:
|
|
|
|
rm -f $(NNTPD)
|
|
|
|
$(MAKE) -C $(NNTPCHAN_DAEMON_DIR) clean
|
|
|
|
|
2017-04-04 18:01:32 +05:00
|
|
|
distclean: clean
|
|
|
|
rm -rf $(REPO_GOPATH)
|