diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-09-18 22:17:13 +0100 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-09-18 22:17:13 +0100 |
commit | 20e45f363c91ef4a305eff5709212f1b2fb43523 (patch) | |
tree | 5fad025d47663b801d15a7cb805562cf6264a044 /Makefile | |
parent | 46af5238ce3e9327e0268d18373d07f67eed58b8 (diff) |
Separate the tests and the main program.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -8,8 +8,6 @@ clean: sed 's/.*`\(.*\)'\''.*/\1/' | grep -v '^all$$' | \ xargs rm -jv_utf8_tables.gen.h: gen_utf8_tables.py - python $^ > $@ lexer.gen.c: lexer.l flex -o lexer.gen.c --header-file=lexer.gen.h lexer.l @@ -19,21 +17,20 @@ parser.gen.c: parser.y lexer.gen.h bison -W -d parser.y -v --report-file=parser.gen.info -o $@ parser.gen.h: parser.gen.c +jv_utf8_tables.gen.h: gen_utf8_tables.py + python $^ > $@ jv_unicode.c: jv_utf8_tables.gen.h -parsertest: parser.gen.c lexer.gen.c main.c opcode.c bytecode.c compile.c execute.c builtin.c jv.c jv_parse.c jv_print.c jv_dtoa.c jv_unicode.c - $(CC) -DJQ_DEBUG=1 -o $@ $^ +JQ_SRC=parser.gen.c lexer.gen.c opcode.c bytecode.c compile.c execute.c builtin.c jv.c jv_parse.c jv_print.c jv_dtoa.c jv_unicode.c -jq: parser.gen.c lexer.gen.c main.c opcode.c bytecode.c compile.c execute.c builtin.c jv.c jv_parse.c jv_print.c jv_dtoa.c jv_unicode.c - $(CC) -DJQ_DEBUG=0 -o $@ $^ -jv_test: jv_test.c jv.c jv_print.c jv_dtoa.c jv_unicode.c - $(CC) -DNO_JANSSON -o $@ $^ +jq_test: $(JQ_SRC) jq_test.c + $(CC) -DJQ_DEBUG=1 -o $@ $^ -jv_parse: jv_parse.c jv.c jv_print.c jv_dtoa.c - $(CC) -DNO_JANSSON -o $@ $^ -DJV_PARSE_MAIN +jq: $(JQ_SRC) main.c + $(CC) -DJQ_DEBUG=0 -o $@ $^ -test: jv_test - valgrind --error-exitcode=1 -q --leak-check=full ./jv_test +test: jq_test + valgrind --error-exitcode=1 -q --leak-check=full ./jq_test >/dev/null |