2012-11-27 16:02:59 -06:00
|
|
|
# Converted to automake by thompson@dtosolutions.com 26NOV12
|
|
|
|
|
|
|
|
|
|
# setup is only used by distribution developers, not package developers.
|
|
|
|
|
# Still, as a matter of allowing patching, its not a bad idea to distribute
|
|
|
|
|
# the developer setup script in the tarball.
|
2013-02-04 07:01:18 -06:00
|
|
|
EXTRA_DIST = \
|
|
|
|
|
setup.sh \
|
|
|
|
|
config.h.in \
|
|
|
|
|
ChangeLog \
|
|
|
|
|
VERSION \
|
|
|
|
|
lexer.l \
|
|
|
|
|
lexer.h \
|
|
|
|
|
gen_utf8_tables.py \
|
|
|
|
|
jq.spec \
|
|
|
|
|
testdata \
|
|
|
|
|
docs/content/1.tutorial/default.yml \
|
|
|
|
|
docs/content/2.download/default.yml \
|
|
|
|
|
docs/content/3.manual/manual.yml \
|
|
|
|
|
docs/content/index/index.yml \
|
|
|
|
|
docs/Gemfile \
|
|
|
|
|
docs/Gemfile.lock \
|
|
|
|
|
docs/public/.htaccess \
|
|
|
|
|
docs/public/bootstrap/css/bootstrap-responsive.css \
|
|
|
|
|
docs/public/bootstrap/css/bootstrap-responsive.min.css \
|
|
|
|
|
docs/public/bootstrap/css/bootstrap.css \
|
|
|
|
|
docs/public/bootstrap/css/bootstrap.min.css \
|
|
|
|
|
docs/public/bootstrap/img/glyphicons-halflings-white.png \
|
|
|
|
|
docs/public/bootstrap/img/glyphicons-halflings.png \
|
|
|
|
|
docs/public/bootstrap/js/bootstrap.js \
|
|
|
|
|
docs/public/bootstrap/js/bootstrap.min.js \
|
|
|
|
|
docs/public/css/base.scss \
|
|
|
|
|
docs/public/jq.png \
|
|
|
|
|
docs/public/robots.txt \
|
|
|
|
|
docs/Rakefile \
|
|
|
|
|
docs/site.yml \
|
|
|
|
|
docs/templates/default.liquid \
|
|
|
|
|
docs/templates/index.liquid \
|
|
|
|
|
docs/templates/manual.liquid \
|
|
|
|
|
docs/templates/shared/_footer.liquid \
|
|
|
|
|
docs/templates/shared/_head.liquid \
|
|
|
|
|
docs/templates/shared/_header.liquid
|
2012-11-27 16:02:59 -06:00
|
|
|
|
|
|
|
|
# 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 INSTALL COPYING AUTHORS README NEWS
|
|
|
|
|
|
2013-02-02 20:39:23 -06:00
|
|
|
JQ_INCS = \
|
|
|
|
|
jq_parser.h \
|
|
|
|
|
builtin.h \
|
|
|
|
|
bytecode.h \
|
|
|
|
|
compile.h \
|
|
|
|
|
execute.h \
|
|
|
|
|
forkable_stack.h \
|
|
|
|
|
frame_layout.h \
|
|
|
|
|
jv.h \
|
|
|
|
|
jv_alloc.h \
|
|
|
|
|
jv_aux.h \
|
|
|
|
|
jv_dtoa.h \
|
|
|
|
|
jv_parse.h \
|
|
|
|
|
jv_unicode.h \
|
|
|
|
|
locfile.h \
|
|
|
|
|
opcode.h \
|
|
|
|
|
opcode_list.h \
|
|
|
|
|
parser.y \
|
|
|
|
|
jv_utf8_tables.gen.h
|
2012-11-28 01:08:23 -06:00
|
|
|
|
2013-02-02 20:39:23 -06:00
|
|
|
JQ_SRC = \
|
|
|
|
|
opcode.c \
|
|
|
|
|
bytecode.c \
|
|
|
|
|
compile.c \
|
|
|
|
|
execute.c \
|
|
|
|
|
builtin.c \
|
|
|
|
|
jv.c \
|
|
|
|
|
jv_parse.c \
|
|
|
|
|
jv_print.c \
|
|
|
|
|
jv_dtoa.c \
|
|
|
|
|
jv_unicode.c \
|
|
|
|
|
jv_aux.c \
|
|
|
|
|
jv_alloc.c \
|
|
|
|
|
lexer.c \
|
2013-02-03 14:49:03 -06:00
|
|
|
${JQ_INCS}
|
2012-11-27 16:02:59 -06:00
|
|
|
|
2013-02-03 14:49:03 -06:00
|
|
|
if DEVELOPMENT_ENABLED
|
|
|
|
|
DEVCFLAGS = -Wextra -Wall -Wno-missing-field-initializers -Wno-unused-parameter -std=gnu99 -ggdb -Wno-unused-function -O0 -DJQ_DEBUG=1
|
|
|
|
|
RPMBINS = jq jq_test
|
|
|
|
|
else
|
|
|
|
|
DEVCFLAGS = -DJQ_DEBUG=0
|
|
|
|
|
RPMBINS = jq
|
2012-11-27 16:02:59 -06:00
|
|
|
endif
|
|
|
|
|
|
2012-11-28 01:08:23 -06:00
|
|
|
# Tell YACC (bison) autoconf macros that you want a header file created.
|
|
|
|
|
# If the --warnings=all fails, you probably have an old version of bison
|
|
|
|
|
# OSX ships an old bison, so update with homebrew or macports
|
|
|
|
|
AM_YFLAGS = --warnings=all -d
|
|
|
|
|
|
2013-02-03 14:49:03 -06:00
|
|
|
bin_PROGRAMS = jq
|
2012-11-28 01:08:23 -06:00
|
|
|
BUILT_SOURCES = jv_utf8_tables.gen.h lexer.h lexer.c
|
2013-02-03 14:49:03 -06:00
|
|
|
jq_SOURCES = ${JQ_SRC} main.c
|
|
|
|
|
jq_CPPFLAGS = ${DEVCFLAGS}
|
2012-11-27 16:02:59 -06:00
|
|
|
|
2013-02-03 14:49:03 -06:00
|
|
|
# always test, but conditionally distribute to /usr/libexec/jq/jq_test
|
|
|
|
|
if DEVELOPMENT_ENABLED
|
|
|
|
|
pkglibexec_PROGRAMS = jq_test
|
|
|
|
|
# automake doesn't like putting data in libexec (pkglibexec_DATA)
|
|
|
|
|
# so we'll create our own macro and distribute testdata
|
|
|
|
|
mydatadir = ${libexecdir}/${PACKAGE}
|
|
|
|
|
mydata_DATA = testdata
|
2012-11-27 16:02:59 -06:00
|
|
|
|
2013-02-03 14:49:03 -06:00
|
|
|
DEVBUILD=yes
|
|
|
|
|
else
|
|
|
|
|
noinst_PROGRAMS = jq_test
|
|
|
|
|
|
|
|
|
|
DEVBUILD=no
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
jq_test_SOURCES = ${JQ_SRC} jq_test.c
|
|
|
|
|
jq_test_CPPFLAGS = ${DEVCFLAGS}
|
|
|
|
|
|
|
|
|
|
# this is what gets "make check" to work
|
2012-11-27 16:02:59 -06:00
|
|
|
TESTS = jq_test
|
|
|
|
|
LOG_COMPILER = valgrind
|
|
|
|
|
AM_LOG_FLAGS = --error-exitcode=1 -q --leak-check=full
|
|
|
|
|
|
2013-02-04 07:01:18 -06:00
|
|
|
man_MANS = jq.1
|
|
|
|
|
|
|
|
|
|
jq.1 :
|
|
|
|
|
cd ${abs_srcdir}/docs; rake manpage > ${abs_builddir}/$@
|
|
|
|
|
|
2012-11-28 01:08:23 -06:00
|
|
|
# nasty circular dependency on header files between the generated C files
|
|
|
|
|
parser.o: lexer.c
|
2012-11-27 16:02:59 -06:00
|
|
|
|
2012-11-28 01:08:23 -06:00
|
|
|
lexer.o: parcer.c
|
|
|
|
|
|
|
|
|
|
lexer.c: parser.h
|
|
|
|
|
|
|
|
|
|
# While there is some autoconf macro support for lex/flex, it doesn't support
|
|
|
|
|
# header file creation so we'll use good old make
|
|
|
|
|
lexer.c: lexer.l
|
|
|
|
|
flex -o lexer.c --header-file=lexer.h lexer.l
|
|
|
|
|
lexer.h: lexer.c
|
2012-11-27 16:02:59 -06:00
|
|
|
|
|
|
|
|
jv_utf8_tables.gen.h: gen_utf8_tables.py
|
|
|
|
|
python $^ > $@
|
2012-11-28 01:08:23 -06:00
|
|
|
|
2012-11-27 16:02:59 -06:00
|
|
|
jv_unicode.c: jv_utf8_tables.gen.h
|
|
|
|
|
|
|
|
|
|
ChangeLog:
|
2012-12-03 17:27:40 -06:00
|
|
|
git log --name-status > $@ || echo "no changelog" > $@
|
2012-11-27 16:02:59 -06:00
|
|
|
|
|
|
|
|
main.c: config.h
|
|
|
|
|
|
|
|
|
|
releasetag:
|
|
|
|
|
git tag -s "jq-$$(cat VERSION)" -m "jq release $$(cat VERSION)"
|
|
|
|
|
|
|
|
|
|
RELEASE ?= 1
|
2013-02-03 14:49:03 -06:00
|
|
|
rpm: ${RPMBINS}
|
2012-11-27 16:02:59 -06:00
|
|
|
@echo "Packaging jq as an RPM ..."
|
2012-12-03 17:27:40 -06:00
|
|
|
mkdir -p rpm/SOURCES rpm/BUILD rpm/BUILDROOT rpm/RPMS rpm/SPECS
|
|
|
|
|
cp jq-$$(cat VERSION).tar.gz rpm/SOURCES/
|
2013-02-03 14:49:03 -06:00
|
|
|
rpmbuild -tb --define "_topdir ${PWD}/rpm" --define "_prefix /usr" --define "myver $$(cat VERSION)" --define "myrel ${RELEASE}" --define "devbuild ${DEVBUILD}" rpm/SOURCES/jq-$$(cat VERSION).tar.gz
|
2012-12-04 16:29:01 -06:00
|
|
|
find rpm/RPMS/ -name "*.rpm" -exec mv {} ./ \;
|
2012-12-03 17:27:40 -06:00
|
|
|
rm -rf rpm
|
2012-11-28 01:08:23 -06:00
|
|
|
|
|
|
|
|
dist-clean-local:
|
2013-02-03 14:49:03 -06:00
|
|
|
rm -f ${BUILT_SOURCES}
|
2013-02-04 13:35:42 -06:00
|
|
|
|
|
|
|
|
# Not sure why this doesn't get cleaned up automatically, guess
|
|
|
|
|
# automake used to man pages which are hand coded?
|
|
|
|
|
clean-local:
|
|
|
|
|
rm -f jq.1
|