-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Makefile to facilitate building and testing.
Add --version, which will be taken from git tag or HEAD Ran "go mod vendor" to fix some issues.
- Loading branch information
Showing
5 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.PHONY: clean build test | ||
|
||
MAIN_DIRECTORY := . | ||
BIN_OUTPUT := $(if $(filter $(shell go env GOOS), windows), mikrotik-fwban.exe, mikrotik-fwban) | ||
|
||
TAG_NAME := $(shell git tag -l --contains HEAD) | ||
SHA := $(shell git rev-parse HEAD) | ||
VERSION := $(if $(TAG_NAME),$(TAG_NAME),$(SHA)) | ||
|
||
default: clean test build | ||
|
||
clean: | ||
@echo BIN_OUTPUT: ${BIN_OUTPUT} | ||
rm -rf ${BIN_OUTPUT} coverage.out | ||
|
||
build: clean | ||
@echo Version: $(VERSION) | ||
go build -v -trimpath -ldflags '-X "main.version=${VERSION}"' -o ${BIN_OUTPUT} ${MAIN_DIRECTORY} | ||
|
||
test: clean | ||
go test -cover ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
# github.com/google/gops v0.3.5 | ||
## explicit | ||
github.com/google/gops/agent | ||
github.com/google/gops/internal | ||
github.com/google/gops/signal | ||
# github.com/howeyc/fsnotify v0.9.0 | ||
## explicit | ||
github.com/howeyc/fsnotify | ||
# github.com/jeromer/syslogparser v0.0.0-20180622150051-323c7ad120db | ||
## explicit | ||
github.com/jeromer/syslogparser | ||
github.com/jeromer/syslogparser/rfc3164 | ||
github.com/jeromer/syslogparser/rfc5424 | ||
# github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 | ||
## explicit | ||
github.com/kardianos/osext | ||
# gopkg.in/gcfg.v1 v1.2.3 | ||
## explicit | ||
gopkg.in/gcfg.v1 | ||
gopkg.in/gcfg.v1/scanner | ||
gopkg.in/gcfg.v1/token | ||
gopkg.in/gcfg.v1/types | ||
# gopkg.in/routeros.v2 v2.0.0-20171228113335-2dc19c12445c | ||
## explicit | ||
gopkg.in/routeros.v2 | ||
gopkg.in/routeros.v2/proto | ||
# gopkg.in/warnings.v0 v0.1.2 | ||
## explicit | ||
gopkg.in/warnings.v0 | ||
# gopkg.in/yaml.v2 v2.2.2 | ||
## explicit | ||
gopkg.in/yaml.v2 | ||
# launchpad.net/gocheck v0.0.0-20140225173054-000000000087 | ||
## explicit |