Showing
2 changed files
with
16 additions
and
7 deletions
1 | 1 | PACKAGE = gitlab.weird-web-workers.org/golang/test |
2 | 2 | |
3 | -SOURCES = version.go | |
3 | +SOURCES = version.go \ | |
4 | + server.go \ | |
5 | + signal.go | |
4 | 6 | |
5 | 7 | VERSION = 0.0.1 |
6 | 8 | REVISION = $(shell git rev-parse HEAD) |
... | ... | @@ -19,14 +21,14 @@ $(LIBRARY): $(SOURCES) |
19 | 21 | go install $(PACKAGE) |
20 | 22 | |
21 | 23 | .version: |
22 | - -@printf "%s\n%s\n%s" \ | |
23 | - "$(VERSION)" "$(REVISION)" "$(BUILDTIME)" >$@.new | |
24 | + -@printf "%s\n%s\n%s" "$(VERSION)" "$(REVISION)" >$@.new | |
24 | 25 | -@diff $@ $@.new >/dev/null 2>&1 && rm $@.new || mv $@.new $@ |
25 | 26 | |
26 | 27 | version.go: version.go.m4 .version |
27 | 28 | -@m4 -Dm4_version=$(VERSION) \ |
28 | 29 | -Dm4_revision=$(REVISION) \ |
29 | 30 | -Dm4_build_time=$(BUILDTIME) \ |
31 | + -Dm4_package=$(PACKAGE) \ | |
30 | 32 | $< >$@ |
31 | 33 | |
32 | 34 | clean: | ... | ... |
... | ... | @@ -24,10 +24,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. |
24 | 24 | */ |
25 | 25 | package test |
26 | 26 | |
27 | -const ( | |
28 | - VERSION = "m4_version" | |
29 | - REVISION = "m4_revision" | |
30 | - BUILD_TIME = "m4_build_time" | |
27 | +import ( | |
28 | + "gitlab.weird-web-workers.org/golang/version" | |
29 | +) | |
30 | + | |
31 | +var ( | |
32 | + VERSION = version.Version{ | |
33 | + Package: "m4_package", | |
34 | + Version: "m4_version", | |
35 | + Revision: "m4_revision", | |
36 | + BuildTime: "m4_build_time", | |
37 | + } | |
31 | 38 | ) |
32 | 39 | |
33 | 40 | // vim: ts=4 sts=4 sw=4 noet tw=72: | ... | ... |
Please
register
or
login
to post a comment