From: Urban Wallasch Date: Fri, 5 Apr 2019 15:28:45 +0000 (+0200) Subject: * Incorporated generation of version.go into Makefile and dropped version.sh. X-Git-Tag: v0.2~7 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=80daac283cddf6d9ddba7a8681f4bf5498d16f7d;p=gogopherd.git * Incorporated generation of version.go into Makefile and dropped version.sh. --- diff --git a/Makefile b/Makefile index 7e8bded..f4c8757 100644 --- a/Makefile +++ b/Makefile @@ -4,17 +4,14 @@ PROJECT := gogopherd -GOBLD := go build -SH := /bin/sh - -GETVER := version.sh -VERFILE := version.go - - BIN := $(PROJECT) SRC := $(wildcard *.go) SELF := $(lastword $(MAKEFILE_LIST)) +VERSION := $(strip $(shell git describe 2> /dev/null)) +VERFILE := version.go + +GOBLD := go build .PHONY: all version clean distclean @@ -24,14 +21,16 @@ $(BIN): $(SRC) $(SELF) $(GOBLD) $(SRVSRC) version: - $(SH) $(GETVER) $(VERFILE) + @echo "generate version.go" + @echo "package main" > $(VERFILE) + @echo "" >> $(VERFILE) + @echo "const version = \"$(VERSION)\"" >> $(VERFILE) clean: $(RM) $(BIN) $(VERFILE) distclean: clean - ########### ## EOF ## ########### diff --git a/version.sh b/version.sh deleted file mode 100644 index 50007cc..0000000 --- a/version.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -VERSION=`git describe` -echo "package main" > "$1" -echo "const version = \"$VERSION\"" >> "$1"