Skip to content

Commit 206feef

Browse files
thorduripcmoore
authored andcommitted
build: create an initial Makefile
Recipes are loosely based on the libseccomp project, e.g. `check`, `check-build`, `check-syntax` are present. Additonally `fix-syntax`, `vet` and `lint` are provided. Add documentation blurbs to the README, again loosely based on the libseccomp project README. Addresses GH issue #1. Signed-off-by: Thordur Bjornsson <[email protected]> [PM: tweaked subject line, made GH references more clear] Signed-off-by: Paul Moore <[email protected]>
1 parent 1cb26b6 commit 206feef

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# libseccomp-golang
2+
3+
check-build:
4+
go build
5+
6+
check-syntax:
7+
gofmt -d .
8+
9+
fix-syntax:
10+
gofmt -w .
11+
12+
vet:
13+
go vet -v
14+
15+
test:
16+
go test -v
17+
18+
lint:
19+
@$(if $(shell which golint),true,$(error "install golint and include it in your PATH"))
20+
golint -set_exit_status
21+
22+
check: vet test
23+
24+
.PHONY: check-build check-syntax fix-syntax vet test lint check
25+
.DEFAULT_GOAL := check-build

README

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,29 @@ please note that a Google account is not required to subscribe to the mailing
2424
list.
2525

2626
-> https://groups.google.com/d/forum/libseccomp
27+
28+
Documentation is also available at:
29+
30+
-> https://godoc.org/github.com/seccomp/libseccomp-golang
31+
32+
33+
* Installing the package
34+
35+
Using go get:
36+
37+
$ go get github.com/seccomp/libseccomp-golang
38+
39+
* Testing the Library
40+
41+
Number of test and lint related recipes are provided in the Makefile, if
42+
you want to run the standard regression tests, you can excute the following:
43+
44+
$ make check
45+
46+
golint, available from
47+
48+
-> https://github.com/golang/lint
49+
50+
is required for the lint recipie
51+
52+
$ make lint

0 commit comments

Comments
 (0)