From cce4dd8af1ceec9ad9c1097ee584af87e4033a2a Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 10 Jun 2021 11:10:57 +0200 Subject: Implement basic Structure and Buildsystem --- src/Makefile | 24 ++++++++++++++++++++++++ src/go.mod | 3 +++ src/main.go | 16 ++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 src/Makefile create mode 100644 src/go.mod create mode 100644 src/main.go (limited to 'src') 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 + diff --git a/src/go.mod b/src/go.mod new file mode 100644 index 0000000..33a7a6a --- /dev/null +++ b/src/go.mod @@ -0,0 +1,3 @@ +module src.xengineering.eu/xengineering/birdscan + +go 1.16 diff --git a/src/main.go b/src/main.go new file mode 100644 index 0000000..6e413c8 --- /dev/null +++ b/src/main.go @@ -0,0 +1,16 @@ +// vim: shiftwidth=4 tabstop=4 noexpandtab + +package main + +import ( + "fmt" + "time" +) + +func main() { + for { + fmt.Println("Hey!") + time.Sleep(2 * time.Second) + } +} + -- cgit v1.2.3-70-g09d2