summaryrefslogtreecommitdiff
path: root/go/Makefile
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2019-11-16 09:14:22 -0800
committerAndrew G. Morgan <morgan@kernel.org>2019-11-16 09:46:29 -0800
commit2d2b7023e9a0a4c397fd74c545e4caa6501a5096 (patch)
treec71ff26317187a905df5a52e585eff2cb8a7a260 /go/Makefile
parent1e4c28c0e54eb42fffdf9583a00889aa352bf4fb (diff)
downloadlibcap2-2d2b7023e9a0a4c397fd74c545e4caa6501a5096.tar.gz
Implement a meaningful Go port of libcap
This version of the Go package libcap/cap works well enough to be used by others. Unfortunately, to use it we need to apply something like the included patch (contrib/go.patch) to the build sources for the Go runtime and syscall packages. I'll be trying to get these accepted by the Go team in parallel. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'go/Makefile')
-rw-r--r--go/Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/go/Makefile b/go/Makefile
index 1381f3d..0791768 100644
--- a/go/Makefile
+++ b/go/Makefile
@@ -22,8 +22,11 @@ install: all
src/libcap/cap/names.go: ../libcap/cap_names.h src/libcap/cap mknames.go
go run mknames.go --header=$< | gofmt > $@ || rm -f $@
+src/libcap/cap/syscalls.go: src/libcap/cap ./syscalls.sh
+ ./syscalls.sh > $@
+
GOPACKAGE=pkg/$(GOOSARCH)/libcap/cap.a
-$(GOPACKAGE): src/libcap/cap/names.go src/libcap/cap/cap.go src/libcap/cap/text.go
+$(GOPACKAGE): src/libcap/cap/syscalls.go src/libcap/cap/names.go src/libcap/cap/cap.go src/libcap/cap/text.go
echo testing Go package
GOPATH=$(realpath .) go test libcap/cap
echo building $(GOPACKAGE)
@@ -37,6 +40,7 @@ web: web.go $(GOPACKAGE)
GOPATH=$(realpath .) go build $<
clean:
- GOPATH=$(realpath .) go clean -x -i libcap/cap || exit 0
- rm -f *.o *.so mknames web compare-cap *~ ../cap/*~ ../cap/names.go
+ GOPATH=$(realpath .) go clean -x -i libcap/cap 2> /dev/null || exit 0
+ rm -f *.o *.so mknames web compare-cap *~
+ rm -f ../cap/*~ ../cap/names.go ../cap/syscalls.go
rm -fr pkg src