summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-25 09:25:42 -0400
committermidipix <writeonce@midipix.org>2016-04-25 09:25:42 -0400
commit2226ad3d3035c4c18e4a5c94166ff6c691bf9065 (patch)
tree4f2e596e636f6567107ac6a8f86f83ee2f569cb8
parentf836238670793d801b09c5a5423dc2ffec3dd4a7 (diff)
downloadapimagic-2226ad3d3035c4c18e4a5c94166ff6c691bf9065.tar.bz2
apimagic-2226ad3d3035c4c18e4a5c94166ff6c691bf9065.tar.xz
utility: integrated amgc_source_version().
-rw-r--r--Makefile.in1
-rw-r--r--src/apimagic.c13
2 files changed, 10 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index d8ae066..abf9377 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -83,7 +83,6 @@ include $(PROJECT_DIR)/project/overrides.mk
-$(APP_SRCS:%.c=%.o): version.tag
$(APP_SRCS:%.c=%.o): CFLAGS_STATIC = $(CFLAGS_APP)
src/%.lo: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag version.tag
diff --git a/src/apimagic.c b/src/apimagic.c
index 670a6cc..f7fbf2f 100644
--- a/src/apimagic.c
+++ b/src/apimagic.c
@@ -7,7 +7,6 @@
#include <stdio.h>
#include <unistd.h>
#include <apimagic/apimagic.h>
-#include "apimagic_version.h"
#include "apimagic_driver_impl.h"
#ifndef AMGC_DRIVER_FLAGS
@@ -15,11 +14,19 @@
| AMGC_DRIVER_VERBOSITY_USAGE
#endif
-static const char vermsg[] = "%s (git://midipix.org/apimagic): commit %s.\n";
+static const char vermsg[] = "%s (git://midipix.org/apimagic): "
+ "version %d.%d.%d.\n"
+ "[commit reference: %s]\n";
static ssize_t apimagic_version(struct amgc_driver_ctx * dctx)
{
- return fprintf(stdout,vermsg,dctx->program,APIMAGIC_GIT_VERSION);
+ const struct amgc_source_version * verinfo;
+
+ verinfo = amgc_source_version();
+
+ return fprintf(stdout,vermsg,dctx->program,
+ verinfo->major,verinfo->minor,verinfo->revision,
+ verinfo->commit);
}
static void apimagic_perform_unit_actions(struct amgc_unit_ctx * uctx)