### Building the jq binary
-main.c: config.h
+version.h:
+ @ { $(srcdir)/scripts/version || echo '$(VERSION)'; } | sed 's/.*/#define JQ_VERSION "&"/'> $@
+
+main.c: config.h version.h
bin_PROGRAMS = jq
jq_SOURCES = ${JQ_SRC} main.c
# the developer setup script in the tarball.
EXTRA_DIST = config.h.in $(BUILT_SOURCES) $(man_MANS) $(TESTS) \
$(TEST_LOG_COMPILER) gen_utf8_tables.py jq.spec \
- $(DOC_FILES)
+ $(DOC_FILES) scripts/version
# README.md is expected in Github projects, good stuff in it, so we'll
# distribute it and install it with the package in the doc directory.
docdir = ${datadir}/doc/${PACKAGE}
dist_doc_DATA = README.md COPYING AUTHORS README
-releasetag:
- git tag -s "jq-$$(cat VERSION)" -m "jq release $$(cat VERSION)"
-
RELEASE ?= 1
rpm: jq
@echo "Packaging jq as an RPM ..."
#include "execute.h"
#include "config.h" /* Autoconf generated header file */
#include "jv_alloc.h"
+#include "version.h"
int jq_testsuite(int argc, char* argv[]);
static const char* progname;
static void usage() {
- fprintf(stderr, "\njq - commandline JSON processor [version %s]\n", PACKAGE_VERSION);
+ fprintf(stderr, "\njq - commandline JSON processor [version %s]\n", JQ_VERSION);
fprintf(stderr, "Usage: %s [options] <jq filter> [file...]\n\n", progname);
fprintf(stderr, "For a description of the command line options and\n");
fprintf(stderr, "how to write jq filters (and why you might want to)\n");
} else if (isoption(argv[i], 'h', "help")) {
usage();
} else if (isoption(argv[i], 'V', "version")) {
- fprintf(stderr, "jq version %s\n", PACKAGE_VERSION);
+ fprintf(stderr, "jq-%s\n", JQ_VERSION);
return 0;
} else {
fprintf(stderr, "%s: Unknown option %s\n", progname, argv[i]);