nat/Makefile

38 lines
915 B
Makefile
Raw Normal View History

2016-06-10 14:36:41 +00:00
## simple makefile to log workflow
.PHONY: all test clean build install
GOFLAGS ?= $(GOFLAGS:)
dbtype=$(shell grep dbtype config.json | cut -d \" -f 4)
dbname=$(shell grep dbname config.json | cut -d \" -f 4)
dbtable=$(shell grep dbtable config.json | cut -d \" -f 4)
2016-06-10 14:36:41 +00:00
all: clean install build
build:
gofmt -w pastebin.go
2016-07-14 02:09:25 +00:00
go build $(GOFLAGS) ./...
ifeq ($(dbtype),sqlite3)
cat database.sql | sed 's/pastebin/$(dbtable)/' | sqlite3 $(dbname)
endif
2016-06-10 14:36:41 +00:00
install:
2016-07-14 02:09:25 +00:00
go get github.com/dchest/uniuri
go get github.com/ewhal/pygments
go get github.com/mattn/go-sqlite3
2016-07-14 02:09:25 +00:00
go get github.com/gorilla/mux
go get github.com/go-sql-driver/mysql
go get github.com/lib/pq
2017-02-05 04:02:32 +00:00
go get golang.org/x/crypto/bcrypt
go get github.com/gorilla/securecookie
2016-06-10 14:36:41 +00:00
test: install
2016-07-15 05:13:59 +00:00
go install $(GOFLAGS) ./...
2016-06-10 14:36:41 +00:00
bench: install
2016-07-14 02:09:25 +00:00
go test -run=NONE -bench=. $(GOFLAGS) ./...
2016-06-10 14:36:41 +00:00
clean:
2016-07-14 02:09:25 +00:00
go clean $(GOFLAGS) -i ./...
rm -rf ./build
rm -rf pastebin.db