Skip to content

Commit

Permalink
Move source files to src/
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 24, 2015
1 parent 891f28e commit 0c93eb3
Show file tree
Hide file tree
Showing 44 changed files with 31 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jq.1
# Autotools junk
.libs
.deps
.dirstamp
libtool
*.log
stamp-h1
Expand Down
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ addons:
- valgrind

before_install:
- rm lexer.h lexer.c parser.h parser.c
- rm src/{lexer,parser}.{c,h}

install:
- bundle install --gemfile=docs/Gemfile
Expand All @@ -41,8 +41,9 @@ script:
after_script:
- |
if [ -n "$COVERAGE" ]; then
rm -rf .libs usr # don't care about coverage for libjq and bison
coveralls -e lexer.c -e parser.c -e jv_dtoa.c --gcov-options '\-lp'
rm -rf src/.libs usr # don't care about coverage for libjq and bison
coveralls --gcov-options '\-lp' \
-e src/lexer.c -e src/parser.c -e src/jv_dtoa.c
fi
after_failure:
Expand Down
46 changes: 25 additions & 21 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@

### C source files to be built and distributed.

LIBJQ_INCS = builtin.h bytecode.h compile.h exec_stack.h jq_parser.h \
jv_alloc.h jv_dtoa.h jv_unicode.h jv_utf8_tables.h lexer.l \
libm.h linker.h locfile.h opcode_list.h parser.y util.h

LIBJQ_SRC = builtin.c bytecode.c compile.c execute.c jq_test.c jv.c \
jv_alloc.c jv_aux.c jv_dtoa.c jv_file.c jv_parse.c jv_print.c \
jv_unicode.c linker.c locfile.c util.c ${LIBJQ_INCS}
LIBJQ_INCS = src/builtin.h src/bytecode.h src/compile.h \
src/exec_stack.h src/jq_parser.h src/jv_alloc.h src/jv_dtoa.h \
src/jv_unicode.h src/jv_utf8_tables.h src/lexer.l src/libm.h \
src/linker.h src/locfile.h src/opcode_list.h src/parser.y \
src/util.h

LIBJQ_SRC = src/builtin.c src/bytecode.c src/compile.c src/execute.c \
src/jq_test.c src/jv.c src/jv_alloc.c src/jv_aux.c \
src/jv_dtoa.c src/jv_file.c src/jv_parse.c src/jv_print.c \
src/jv_unicode.c src/linker.c src/locfile.c src/util.c \
${LIBJQ_INCS}

### C build options

Expand All @@ -21,10 +25,10 @@ ACLOCAL_AMFLAGS = -I config/m4
# While there is some autoconf macro support for lex/flex, it doesn't support
# header file creation so we'll use good old make
if MAINTAINER_MODE
BUILT_SOURCES = lexer.h lexer.c parser.h parser.c version.h
lexer.c: lexer.l
$(AM_V_LEX) flex -o lexer.c --header-file=lexer.h $<
lexer.h: lexer.c
BUILT_SOURCES = src/lexer.h src/lexer.c src/parser.h src/parser.c src/version.h
src/lexer.c: src/lexer.l
$(AM_V_LEX) flex -o src/lexer.c --header-file=src/lexer.h $<
src/lexer.h: src/lexer.c
else
BUILT_SOURCES =
.y.c:
Expand All @@ -45,7 +49,7 @@ libjq_la_SOURCES = ${LIBJQ_SRC}
libjq_la_LIBADD = -lm
libjq_la_LDFLAGS = -export-symbols-regex '^j[qv]_' -version-info 1:4:0

include_HEADERS = jv.h jq.h
include_HEADERS = src/jv.h src/jq.h

### Running tests under Valgrind

Expand All @@ -65,7 +69,7 @@ endif

if ENABLE_ERROR_INJECTION
lib_LTLIBRARIES += libinject_errors.la
libinject_errors_la_SOURCES = inject_errors.c
libinject_errors_la_SOURCES = src/inject_errors.c
libinject_errors_la_LIBADD = -ldl
libinject_errors_la_LDFLAGS = -module
endif
Expand All @@ -77,13 +81,13 @@ endif
.FORCE:
generate_ver = ver="`{ $(srcdir)/scripts/version || echo '$(VERSION)' ; } | sed 's/.*/\#define JQ_VERSION \"&\"/'`"
.remake-version-h: .FORCE
@ $(generate_ver); test "x`cat version.h 2>/dev/null`" = "x$$ver" || touch .remake-version-h
version.h: .remake-version-h
@ $(generate_ver); test "x`cat src/version.h 2>/dev/null`" = "x$$ver" || touch .remake-version-h
src/version.h: .remake-version-h
$(AM_V_GEN) $(generate_ver); echo "$$ver" > $@
main.c: version.h
src/main.c: src/version.h

bin_PROGRAMS = jq
jq_SOURCES = main.c version.h
jq_SOURCES = src/main.c src/version.h
jq_LDFLAGS = -static-libtool-libs
jq_LDADD = libjq.la -lm

Expand Down Expand Up @@ -146,8 +150,8 @@ DOC_FILES = docs/content docs/public docs/templates docs/site.yml \
docs/default_manpage.md jq.1.default

EXTRA_DIST = $(DOC_FILES) $(man_MANS) $(TESTS) $(TEST_LOG_COMPILER) \
jq.1.prebuilt jq.spec lexer.c lexer.h parser.c parser.h \
scripts/version tests/jq.test tests/modules/.jq \
jq.1.prebuilt jq.spec src/lexer.c src/lexer.h src/parser.c \
src/parser.h scripts/version tests/jq.test tests/modules/.jq \
tests/modules/a.jq tests/modules/b/b.jq tests/modules/c/c.jq \
tests/modules/c/d.jq tests/modules/data.json \
tests/modules/lib/jq/e/e.jq tests/modules/lib/jq/f.jq \
Expand Down Expand Up @@ -185,9 +189,9 @@ if ENABLE_DOCS
endif

clean-local-gcov:
rm -f *.gcno *.gcda *.gcov
rm -f src/*.gcno src/*.gcda src/*.gcov

clean-local: clean-local-docs clean-local-gcov
rm -f version.h .remake-version-h
rm -f src/version.h .remake-version-h

.PHONY: clean-local-docs clean-local-gcov
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ m4_include([m4/ax_prog_bison_version.m4])
dnl Created autoconf implementation thompson@dtosolutions, 26NOV12
AC_PREREQ([2.64])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([1.11.2 parallel-tests foreign -Wall])
AM_INIT_AUTOMAKE([1.11.2 subdir-objects parallel-tests foreign -Wall])
AM_SILENT_RULES([yes])
AM_PROG_AR
AM_MAINTAINER_MODE([enable])
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0c93eb3

Please sign in to comment.