aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-04-23 09:37:53 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-04-23 09:37:53 +0200
commitb98f270b28eff320f8c97e074944867121b8d858 (patch)
tree86436f4b105b22a8f1762f8567d23185cd7a9645
parentdec884d42f7591cb94a6636a304d87c798bdd3fc (diff)
downloadtoolame-dab-b98f270b28eff320f8c97e074944867121b8d858.tar.gz
toolame-dab-b98f270b28eff320f8c97e074944867121b8d858.tar.bz2
toolame-dab-b98f270b28eff320f8c97e074944867121b8d858.zip
Show git version in usage screen
-rw-r--r--Makefile4
-rw-r--r--git-version.sh8
-rw-r--r--toolame.c10
3 files changed, 16 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 0b0c4d0..a030e68 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,8 @@ c_sources = \
OBJ = $(c_sources:.c=.o)
+GIT_VER = -DGIT_VERSION="\"`sh git-version.sh`\""
+
#Uncomment this if you want to do some profiling/debugging
#PG = -g -pg
PG = -g -fomit-frame-pointer
@@ -74,7 +76,7 @@ PG = -g -fomit-frame-pointer
OPTIM = -O2
# These flags are pretty much mandatory
-REQUIRED = -DINLINE=inline
+REQUIRED = -DINLINE=inline ${GIT_VER}
#pick your architecture
ARCH = -march=native
diff --git a/git-version.sh b/git-version.sh
new file mode 100644
index 0000000..ebd06d8
--- /dev/null
+++ b/git-version.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+if [ -d .git ]
+then
+ git rev-parse --short HEAD
+else
+ echo "unknown"
+fi
+
diff --git a/toolame.c b/toolame.c
index ac2c5c9..41c5dc7 100644
--- a/toolame.c
+++ b/toolame.c
@@ -33,7 +33,7 @@
music_in_t musicin;
Bit_stream_struc bs;
char *programName;
-char toolameversion[] = "0.2l-opendigitalradio";
+char toolameversion[] = "0.2l-ODR-" GIT_VERSION;
const int FPAD_LENGTH=2;
@@ -647,11 +647,11 @@ void usage (void)
{ /* print syntax & exit */
/* FIXME: maybe have an option to display better definitions of help codes, and
long equivalents of the flags */
- fprintf (stdout, "\ntooLAME version %s (http://opendigitalradio.org)\n",
+ fprintf (stdout, "\nToolame-DAB version %s\n (http://opendigitalradio.org)\n",
toolameversion);
fprintf (stdout, "MPEG Audio Layer II encoder for DAB\n\n");
fprintf (stdout, "usage: \n");
- fprintf (stdout, "\t%s [options] <input> <output>\n\n", programName);
+ fprintf (stdout, "\t%s [options] (<infile>|-j <jackname>|-V <libvlc url>) <output>\n\n", programName);
fprintf (stdout, "Options:\n");
fprintf (stdout, "Input\n");
@@ -710,10 +710,10 @@ void usage (void)
void short_usage (void)
{
/* print a bit of info about the program */
- fprintf (stderr, "tooLAME version %s\n (http://opendigitalradio.org)\n",
+ fprintf (stderr, "Toolame-DAB version %s\n (http://opendigitalradio.org)\n",
toolameversion);
fprintf (stderr, "MPEG Audio Layer II encoder for DAB\n\n");
- fprintf (stderr, "USAGE: %s [options] (<infile>|<jackname>|<libvlc url>) [outfile]\n\n", programName);
+ fprintf (stderr, "USAGE: %s [options] (<infile>|-j <jackname>|-V <libvlc url>) [output]\n\n", programName);
fprintf (stderr, "Try \"%s -h\" for more information.\n", programName);
exit (0);
}