2017-11-28 00:30:04 -05:00
|
|
|
APP := miniflux
|
2018-10-29 01:22:48 -04:00
|
|
|
VERSION := $(shell git rev-parse --short HEAD)
|
|
|
|
BUILD_DATE := `date +%FT%T%z`
|
|
|
|
LD_FLAGS := "-s -w -X 'miniflux.app/version.Version=$(VERSION)' -X 'miniflux.app/version.BuildDate=$(BUILD_DATE)'"
|
2017-11-28 00:30:04 -05:00
|
|
|
PKG_LIST := $(shell go list ./... | grep -v /vendor/)
|
|
|
|
DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable
|
2017-11-20 00:10:04 -05:00
|
|
|
|
2018-10-23 22:29:50 -04:00
|
|
|
.PHONY: linux-amd64 linux-armv8 linux-armv7 linux-armv6 linux-armv5 darwin freebsd openbsd build run clean test lint integration-test clean-integration-test
|
2017-11-20 00:10:04 -05:00
|
|
|
|
2018-09-16 22:14:44 -04:00
|
|
|
linux-amd64:
|
2017-11-20 00:10:04 -05:00
|
|
|
@ go generate
|
2018-10-29 01:22:48 -04:00
|
|
|
@ GOOS=linux GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-amd64 main.go
|
2017-11-20 00:10:04 -05:00
|
|
|
|
2018-09-16 22:14:44 -04:00
|
|
|
linux-armv8:
|
2017-12-27 15:17:01 -05:00
|
|
|
@ go generate
|
2018-10-29 01:22:48 -04:00
|
|
|
@ GOOS=linux GOARCH=arm64 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-armv8 main.go
|
2018-09-16 22:14:44 -04:00
|
|
|
|
|
|
|
linux-armv7:
|
|
|
|
@ go generate
|
2018-10-29 01:22:48 -04:00
|
|
|
@ GOOS=linux GOARCH=arm GOARM=7 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-armv7 main.go
|
2018-09-16 22:14:44 -04:00
|
|
|
|
|
|
|
linux-armv6:
|
|
|
|
@ go generate
|
2018-10-29 01:22:48 -04:00
|
|
|
@ GOOS=linux GOARCH=arm GOARM=6 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-armv6 main.go
|
2018-09-16 22:14:44 -04:00
|
|
|
|
|
|
|
linux-armv5:
|
|
|
|
@ go generate
|
2018-10-29 01:22:48 -04:00
|
|
|
@ GOOS=linux GOARCH=arm GOARM=5 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-armv5 main.go
|
2017-12-27 15:17:01 -05:00
|
|
|
|
|
|
|
darwin:
|
2017-11-20 00:10:04 -05:00
|
|
|
@ go generate
|
2018-10-29 01:22:48 -04:00
|
|
|
@ GOOS=darwin GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-darwin-amd64 main.go
|
2017-11-20 00:10:04 -05:00
|
|
|
|
2018-03-18 23:44:13 -04:00
|
|
|
freebsd:
|
|
|
|
@ go generate
|
2018-10-29 01:22:48 -04:00
|
|
|
@ GOOS=freebsd GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-freebsd-amd64 main.go
|
2018-03-18 23:44:13 -04:00
|
|
|
|
2018-10-23 22:29:50 -04:00
|
|
|
openbsd:
|
|
|
|
@ go generate
|
2018-10-29 01:22:48 -04:00
|
|
|
@ GOOS=openbsd GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-openbsd-amd64 main.go
|
2018-10-23 22:29:50 -04:00
|
|
|
|
|
|
|
build: linux-amd64 linux-armv8 linux-armv7 linux-armv6 linux-armv5 darwin freebsd openbsd
|
2017-11-20 00:10:04 -05:00
|
|
|
|
|
|
|
run:
|
|
|
|
@ go generate
|
2018-02-01 00:57:20 -05:00
|
|
|
@ go run main.go -debug
|
2017-11-20 00:10:04 -05:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@ rm -f $(APP)-*
|
|
|
|
|
|
|
|
test:
|
|
|
|
go test -cover -race ./...
|
2017-11-25 13:40:23 -05:00
|
|
|
|
2017-11-28 00:30:04 -05:00
|
|
|
lint:
|
|
|
|
@ golint -set_exit_status ${PKG_LIST}
|
|
|
|
|
2017-11-25 13:40:23 -05:00
|
|
|
integration-test:
|
|
|
|
psql -U postgres -c 'drop database if exists miniflux_test;'
|
|
|
|
psql -U postgres -c 'create database miniflux_test;'
|
|
|
|
DATABASE_URL=$(DB_URL) go run main.go -migrate
|
|
|
|
DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run main.go -create-admin
|
|
|
|
go build -o miniflux-test main.go
|
2018-01-29 23:58:11 -05:00
|
|
|
DATABASE_URL=$(DB_URL) ./miniflux-test -debug >/tmp/miniflux.log 2>&1 & echo "$$!" > "/tmp/miniflux.pid"
|
2017-11-25 13:40:23 -05:00
|
|
|
while ! echo exit | nc localhost 8080; do sleep 1; done >/dev/null
|
2018-08-25 14:53:14 -04:00
|
|
|
go test -v -tags=integration miniflux.app/tests || cat /tmp/miniflux.log
|
2017-11-25 13:40:23 -05:00
|
|
|
|
|
|
|
clean-integration-test:
|
|
|
|
@ kill -9 `cat /tmp/miniflux.pid`
|
|
|
|
@ rm -f /tmp/miniflux.pid /tmp/miniflux.log
|
|
|
|
@ rm miniflux-test
|
|
|
|
@ psql -U postgres -c 'drop database if exists miniflux_test;'
|