commit f89110b149c88f3a3f5a7a5c8544b07b0f3b4ffb Author: Georg Hopp Date: Sun Sep 30 13:25:27 2018 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3be229e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Generated with m4 +version.go diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1cf27c9 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +PACKAGE = gitlab.weird-web-workers.org/ghopp/test + +SOURCES = version.go + +VERSION = 0.0.1 +REVISION = $(shell git rev-parse HEAD) +BUILDTIME= "$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')" + +GOOS = $(shell go env GOOS) +GOARCH = $(shell go env GOARCH) + +LIBRARY = $(GOPATH)/pkg/$(GOOS)_$(GOARCH)/$(PACKAGE).a + +.PHONY: all clean + +all: $(LIBRARY) + +$(LIBRARY): $(SOURCES) + go install $(PACKAGE) + +version.go: version.go.m4 + -@m4 -Dm4_version=$(VERSION) \ + -Dm4_revision=$(REVISION) \ + -Dm4_build_time=$(BUILDTIME) \ + $< >$@ + +clean: + -@rm -f version.go 2>/dev/null + -@rm -f $(LIBRARY) 2>/dev/null diff --git a/version.go.m4 b/version.go.m4 new file mode 100644 index 0000000..e42dd3d --- /dev/null +++ b/version.go.m4 @@ -0,0 +1,33 @@ +/* +Package version information. + +Authors: +Georg Hopp + +Changes: +2018-09-30 [Georg Hopp] File created. + +Copyright © 2018 Georg Hopp + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +package test + +const ( + VERSION = "m4_version" + REVISION = "m4_revision" + BUILD_TIME = "m4_build_time" +) + +// vim: ts=4 sts=4 sw=4 noet tw=72: