"Fossies" - the Fresh Open Source Software Archive

Member "jq-1.6/Makefile.am" (2 Nov 2018, 6544 Bytes) of package /linux/misc/jq-1.6.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Makefile.am": 1.5_vs_1.6.

    1 
    2 ### C source files to be built and distributed.
    3 
    4 LIBJQ_INCS = src/builtin.h src/bytecode.h src/compile.h                 \
    5         src/exec_stack.h src/jq_parser.h src/jv_alloc.h src/jv_dtoa.h   \
    6         src/jv_unicode.h src/jv_utf8_tables.h src/lexer.l src/libm.h    \
    7         src/linker.h src/locfile.h src/opcode_list.h src/parser.y       \
    8         src/util.h
    9 
   10 LIBJQ_SRC = src/builtin.c src/bytecode.c src/compile.c src/execute.c    \
   11         src/jq_test.c src/jv.c src/jv_alloc.c src/jv_aux.c              \
   12         src/jv_dtoa.c src/jv_file.c src/jv_parse.c src/jv_print.c       \
   13         src/jv_unicode.c src/linker.c src/locfile.c src/util.c          \
   14         ${LIBJQ_INCS}
   15 
   16 ### C build options
   17 
   18 AM_CFLAGS = -Wextra -Wall -Wno-missing-field-initializers               \
   19         -Wno-unused-parameter -Wno-unused-function
   20 
   21 ACLOCAL_AMFLAGS = -I config/m4
   22 
   23 ### Generating the lexer and parser
   24 
   25 # While there is some autoconf macro support for lex/flex, it doesn't support
   26 # header file creation so we'll use good old make
   27 if MAINTAINER_MODE
   28 BUILT_SOURCES = src/lexer.h src/lexer.c src/parser.h src/parser.c 	\
   29 		src/builtin.inc src/version.h
   30 src/lexer.c: src/lexer.l
   31 	$(AM_V_LEX) flex -o src/lexer.c --header-file=src/lexer.h $<
   32 src/lexer.h: src/lexer.c
   33 else
   34 BUILT_SOURCES = src/builtin.inc src/version.h
   35 .y.c:
   36 	$(AM_V_YACC) echo "NOT building parser.c!"
   37 .l.c:
   38 	$(AM_V_LEX) echo "NOT building lexer.c!"
   39 endif
   40 
   41 # Tell YACC (bison) autoconf macros that you want a header file created.
   42 # If the --warnings=all fails, you probably have an old version of bison
   43 # OSX ships an old bison, so update with homebrew or macports
   44 AM_YFLAGS = --warnings=all -d
   45 
   46 ### libjq
   47 
   48 lib_LTLIBRARIES = libjq.la
   49 libjq_la_SOURCES = ${LIBJQ_SRC}
   50 libjq_la_LIBADD = -lm
   51 libjq_la_LDFLAGS = $(onig_LDFLAGS) -export-symbols-regex '^j[qv]_' -version-info 1:4:0
   52 
   53 if WIN32
   54 libjq_la_LIBADD += -lshlwapi
   55 endif
   56 
   57 include_HEADERS = src/jv.h src/jq.h
   58 
   59 if ENABLE_UBSAN
   60 AM_CFLAGS += -fsanitize=undefined
   61 endif
   62 
   63 ### Running tests under Valgrind
   64 
   65 if ENABLE_ASAN
   66 AM_CFLAGS += -fsanitize=address
   67 NO_VALGRIND = 1
   68 else
   69 if ENABLE_VALGRIND
   70 NO_VALGRIND =
   71 else
   72 NO_VALGRIND = 1
   73 endif
   74 endif
   75 
   76 ### Code coverage with gcov
   77 
   78 if ENABLE_GCOV
   79 AM_CFLAGS += --coverage --no-inline
   80 endif
   81 
   82 ### Error injection for testing
   83 
   84 if ENABLE_ERROR_INJECTION
   85 lib_LTLIBRARIES += libinject_errors.la
   86 libinject_errors_la_SOURCES = src/inject_errors.c
   87 libinject_errors_la_LIBADD = -ldl
   88 libinject_errors_la_LDFLAGS = -module
   89 endif
   90 
   91 ### Building the jq binary
   92 
   93 # Remake the version.h header file if, and only if, the git ID has changed
   94 .PHONY: .FORCE
   95 .FORCE:
   96 generate_ver = ver="`{ $(srcdir)/scripts/version || echo '$(VERSION)' ; } | sed 's/.*/\#define JQ_VERSION \"&\"/'`"
   97 .remake-version-h: .FORCE
   98 	@ $(generate_ver); test "x`cat src/version.h 2>/dev/null`" = "x$$ver" || touch .remake-version-h
   99 src/version.h: .remake-version-h
  100 	$(AM_V_GEN) $(generate_ver); echo "$$ver" > $@
  101 src/main.c: src/version.h
  102 
  103 src/builtin.inc: src/builtin.jq
  104 	$(AM_V_GEN) sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $^ > $@
  105 src/builtin.o: src/builtin.inc
  106 
  107 bin_PROGRAMS = jq
  108 jq_SOURCES = src/main.c src/version.h
  109 jq_LDFLAGS = -static-libtool-libs
  110 jq_LDADD = libjq.la -lm
  111 
  112 if WIN32
  113 jq_LDADD += -lshlwapi
  114 endif
  115 
  116 if ENABLE_ALL_STATIC
  117 jq_LDFLAGS += -all-static
  118 endif
  119 
  120 ### Tests (make check)
  121 
  122 TESTS = tests/optionaltest tests/mantest tests/jqtest tests/onigtest tests/shtest tests/utf8test tests/base64test
  123 TESTS_ENVIRONMENT = NO_VALGRIND=$(NO_VALGRIND)
  124 
  125 
  126 ### Building the manpage
  127 
  128 man_MANS = jq.1
  129 if ENABLE_DOCS
  130 jq.1: $(srcdir)/docs/content/3.manual/manual.yml
  131 	$(AM_V_GEN) ( cd ${abs_srcdir}/docs; '$(BUNDLER)' exec rake manpage ) > $@ || { rm -f $@; false; }
  132 jq.1.prebuilt: jq.1
  133 	$(AM_V_GEN) cp $^ $@ || { rm -f $@; false; }
  134 else
  135 jq.1: $(srcdir)/jq.1.prebuilt
  136 	$(AM_V_GEN) cp $^ $@
  137 endif
  138 
  139 
  140 ### Build oniguruma
  141 
  142 if BUILD_ONIGURUMA
  143 libjq_la_LIBADD += modules/oniguruma/src/.libs/libonig.la
  144 SUBDIRS = modules/oniguruma
  145 endif
  146 
  147 AM_CFLAGS += $(onig_CFLAGS)
  148 
  149 ### Packaging
  150 
  151 docs/site.yml: configure.ac
  152 	sed 's/^jq_version: .*/jq_version: "$(VERSION)"/' $@ > $@.new
  153 	mv $@.new $@
  154 
  155 install-binaries: $(BUILT_SOURCES)
  156 	$(MAKE) $(AM_MAKEFLAGS) install-exec
  157 
  158 DOC_FILES = docs/content docs/public docs/templates docs/site.yml       \
  159         docs/Gemfile docs/Gemfile.lock docs/Rakefile docs/README.md     \
  160         jq.1.prebuilt
  161 
  162 EXTRA_DIST = $(DOC_FILES) $(man_MANS) $(TESTS) $(TEST_LOG_COMPILER)     \
  163         jq.1.prebuilt jq.spec src/lexer.c src/lexer.h src/parser.c      \
  164         src/parser.h src/version.h src/builtin.jq                       \
  165         scripts/version tests/jq.test tests/modules/.jq                 \
  166         tests/modules/a.jq tests/modules/b/b.jq tests/modules/c/c.jq    \
  167         tests/modules/c/d.jq tests/modules/data.json                    \
  168         tests/modules/lib/jq/e/e.jq tests/modules/lib/jq/f.jq           \
  169         tests/modules/syntaxerror/syntaxerror.jq                        \
  170         tests/modules/test_bind_order.jq                                \
  171         tests/modules/test_bind_order0.jq                               \
  172         tests/modules/test_bind_order1.jq                               \
  173         tests/modules/test_bind_order2.jq tests/onig.supp               \
  174         tests/onig.test tests/setup tests/torture/input0.json		\
  175         tests/optional.test tests/optionaltest				\
  176 	tests/utf8-truncate.jq tests/utf8test				\
  177 	tests/base64.test tests/base64test 				\
  178 	tests/jq-f-test.sh tests/shtest
  179 
  180 
  181 
  182 # README.md is expected in Github projects, good stuff in it, so we'll
  183 # distribute it and install it with the package in the doc directory.
  184 docdir = ${datadir}/doc/${PACKAGE}
  185 dist_doc_DATA = README.md COPYING AUTHORS README
  186 
  187 RELEASE ?= 1
  188 rpm: dist jq.spec
  189 	@echo "Packaging jq as an RPM ..."
  190 	mkdir -p rpm/SOURCES rpm/BUILD rpm/BUILDROOT rpm/RPMS rpm/SPECS
  191 	cp jq-$(VERSION).tar.gz rpm/SOURCES/
  192 	rpmbuild -tb --define "_topdir ${PWD}/rpm" --define "_prefix /usr" --define "myver $(VERSION)" --define "myrel ${RELEASE}" rpm/SOURCES/jq-$(VERSION).tar.gz
  193 	find rpm/RPMS/ -name "*.rpm" -exec mv {} ./ \;
  194 	rm -rf rpm
  195 
  196 dist-clean-local:
  197 	rm -f ${BUILT_SOURCES}
  198 
  199 # Not sure why this doesn't get cleaned up automatically, guess
  200 # automake used to man pages which are hand coded?
  201 # 'make clean' doesn't delete the manpage if it can't be rebuilt
  202 clean-local-docs:
  203 if ENABLE_DOCS
  204 	rm -f jq.1
  205 endif
  206 
  207 clean-local-gcov:
  208 	rm -f src/*.gcno src/*.gcda src/*.gcov
  209 
  210 clean-local: clean-local-docs clean-local-gcov
  211 	rm -f src/version.h .remake-version-h
  212 
  213 .PHONY: clean-local-docs clean-local-gcov