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:21:01 +00:00
|
|
|
IPTABLES=@sudo iptables
|
2017-06-16 13:05:37 +00:00
|
|
|
|
|
|
|
server:
|
|
|
|
$(GOBUILD)
|
|
|
|
jobs:
|
|
|
|
$(BUILDJOBS)
|
|
|
|
install:
|
|
|
|
$(GOINSTALL)
|
|
|
|
test:
|
|
|
|
$(GOTEST)
|
|
|
|
bench:
|
|
|
|
$(GOTEST) -bench .
|
2017-06-16 13:25:30 +00:00
|
|
|
versions:
|
|
|
|
@go version
|
|
|
|
@asd --version
|
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: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
|
|
|
|
all: server jobs ports
|
2017-06-16 13:05:37 +00:00
|
|
|
|
|
|
|
.PHONY: jobs
|