51 lines
1.1 KiB
Makefile
Raw Normal View History

2017-06-16 13:05:37 +00:00
# Makefile for Anime Notifier
GOCMD=@go
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOTEST=$(GOCMD) test
BUILDJOBS=@./jobs/build.sh
2017-06-16 13:38:10 +00:00
BUILDPATCHES=@./patches/build.sh
2017-07-17 20:50:14 +00:00
BUILDBOTS=@./bots/build.sh
2017-07-05 23:01:04 +00:00
TSCMD=@tsc
2017-06-16 13:21:01 +00:00
IPTABLES=@sudo iptables
2017-06-16 13:05:37 +00:00
server:
$(GOBUILD)
jobs:
$(BUILDJOBS)
2017-07-17 20:50:14 +00:00
bots:
$(BUILDBOTS)
2017-06-16 13:38:10 +00:00
patches:
$(BUILDPATCHES)
2017-07-05 23:01:04 +00:00
js:
$(TSCMD)
2017-06-16 13:05:37 +00:00
install:
$(GOINSTALL)
test:
2017-10-01 22:01:01 +00:00
$(GOTEST) github.com/animenotifier/... -v
2017-06-16 13:05:37 +00:00
bench:
$(GOTEST) -bench .
2017-07-05 23:51:42 +00:00
tools:
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/aerogo/pack
go get -u github.com/aerogo/run
go install github.com/aerogo/pack
go install github.com/aerogo/run
2017-06-16 13:25:30 +00:00
versions:
@go version
@asd --version
2017-06-16 13:29:09 +00:00
assets:
2017-07-05 23:01:04 +00:00
$(TSCMD)
2017-06-16 13:29:09 +00:00
@pack
2017-06-16 13:05:37 +00:00
depslist:
$(GOCMD) list -f {{.Deps}} | sed -e 's/\[//g' -e 's/\]//g' | tr " " "\n"
2017-06-16 13:38:10 +00:00
clean:
2017-06-16 13:42:22 +00:00
find . -type f | xargs file | grep "ELF.*executable" | awk -F: '{print $1}' | xargs rm
2017-06-16 13:21:01 +00:00
ports:
$(IPTABLES) -t nat -A OUTPUT -o lo -p tcp --dport 80 -j REDIRECT --to-port 4000
$(IPTABLES) -t nat -A OUTPUT -o lo -p tcp --dport 443 -j REDIRECT --to-port 4001
2017-07-17 20:50:14 +00:00
all: assets server bots jobs patches
2017-06-16 13:05:37 +00:00
2017-07-17 20:50:14 +00:00
.PHONY: bots jobs patches ports