summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in1
-rw-r--r--src/perk.c18
2 files changed, 9 insertions, 10 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/perk.c b/src/perk.c
index 352d675..756c5a8 100644
--- a/src/perk.c
+++ b/src/perk.c
@@ -8,7 +8,6 @@
#include <unistd.h>
#include <perk/perk.h>
#include <perk/perk_output.h>
-#include "perk_version.h"
#include "perk_driver_impl.h"
#ifndef PERK_DRIVER_FLAGS
@@ -16,18 +15,19 @@
| PERK_DRIVER_VERBOSITY_USAGE
#endif
-static const char vermsg[] = "%s (git://midipix.org/perk): commit %s.\n";
+static const char vermsg[] = "%s (git://midipix.org/perk): "
+ "version %d.%d.%d.\n"
+ "[commit reference: %s]\n";
static ssize_t perk_version(struct pe_driver_ctx * dctx)
{
- char buf[512];
- size_t len;
+ const struct pe_source_version * verinfo;
- if (dctx->cctx->ioctx->fdout >= 0) {
- len = sprintf(buf,vermsg,dctx->program,PERK_GIT_VERSION);
- return write(dctx->cctx->ioctx->fdout,buf,len);
- } else
- return fprintf(stdout,vermsg,dctx->program,PERK_GIT_VERSION);
+ verinfo = pe_source_version();
+
+ return fprintf(stdout,vermsg,dctx->program,
+ verinfo->major,verinfo->minor,verinfo->revision,
+ verinfo->commit);
}
static ssize_t perk_paragraph_break(struct pe_unit_ctx * uctx, int * fpara)