diff options
author | xengineering <mail2xengineering@protonmail.com> | 2021-06-10 11:10:57 +0200 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2021-06-10 11:10:57 +0200 |
commit | cce4dd8af1ceec9ad9c1097ee584af87e4033a2a (patch) | |
tree | 02dd1aa1e11e8bf49a622a39e269c73cf5660967 /src/Makefile | |
parent | 2adbac8efc7d651dd9cdf806fcbb59016a37126b (diff) | |
download | birdscan-cce4dd8af1ceec9ad9c1097ee584af87e4033a2a.tar birdscan-cce4dd8af1ceec9ad9c1097ee584af87e4033a2a.tar.zst birdscan-cce4dd8af1ceec9ad9c1097ee584af87e4033a2a.zip |
Implement basic Structure and Buildsystem
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..02e9e39 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,24 @@ +# vim: shiftwidth=4 tabstop=4 noexpandtab + +DESTDIR="" # leave empty for the current system or provide a fakeroot here +PREFIX="/usr" + +.PHONY: all clean install + +all: + # some recommended options for Go building (https://wiki.archlinux.org/title/Go_package_guidelines) + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + + mkdir -p build + go build -o build/birdscan ./... + +clean: + rm -rf build + +install: all + install -Dm 755 build/birdscan $(DESTDIR)$(PREFIX)/bin/birdscan + |