From 2226ad3d3035c4c18e4a5c94166ff6c691bf9065 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 25 Apr 2016 09:25:42 -0400 Subject: utility: integrated amgc_source_version(). --- Makefile.in | 1 - src/apimagic.c | 13 ++++++++++--- 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 #include #include -#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) -- cgit v1.2.3