Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Autogenerate version file

  • Loading branch information...
commit 7cd64a76f8f3fca5bfe4f439d90e1946ec84d059 1 parent 6a96157
Björn-Egil Dahlberg authored committed
Showing with 23 additions and 4 deletions.
  1. +8 −3 Makefile
  2. +15 −0 VERSION-GEN
  3. +0 −1  vsn.mk
11 Makefile
View
@@ -1,4 +1,3 @@
-include vsn.mk
ERLC = erlc
ESRC = src
@@ -28,11 +27,16 @@ else
RELEASE_DIR = $(DESTDIR)/$(prefix)
endif
+all: build
+
+vsn.mk:
+ @/bin/sh ./VERSION-GEN
+-include vsn.mk
+
RELEASE_LIB_DIR = $(RELEASE_DIR)/lib/erlang/lib/eplot-$(VSN)
-TARGETS = $(MODULES:%=$(EBIN)/%.beam)
+TARGETS = $(MODULES:%=$(EBIN)/%.beam) vsn.mk
-all: build
build: Makefile $(TARGETS)
@@ -60,4 +64,5 @@ info:
clean:
rm -f $(TARGETS)
+
.PHONY: install clean info test examples
15 VERSION-GEN
View
@@ -0,0 +1,15 @@
+#!/bin/sh
+# vim: set filetype=sh
+
+VSN_FILE=vsn.mk
+
+VSN=`git describe --abbrev=4 HEAD`
+
+VSN=`expr "$VSN" : v*'\(.*\)'`
+
+# Feed to file
+echo "# AUTOGENERATED BY $0 - DO NOT EDIT" > $VSN_FILE
+echo "VSN = $VSN" >> $VSN_FILE
+
+# Echo to screen
+echo "New version: $VSN"
1  vsn.mk
View
@@ -1 +0,0 @@
-VSN = 1.1
Please sign in to comment.
Something went wrong with that request. Please try again.