diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-09-18 17:44:43 +0100 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-09-18 17:44:43 +0100 |
commit | a4eea165bbab6d13f89b59707e835d58b7014a66 (patch) | |
tree | b99ee5dde8540f8dbe5de3d87b99e04ac4dd2673 /Makefile | |
parent | 25cbab056b1f73e96b636c88779a92400d92dc15 (diff) |
Move everything around - delete old Haskell code, clean up build.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..db63b777 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +CC=gcc -Wextra -Wall -Wno-missing-field-initializers -Wno-unused-parameter -std=gnu99 -ggdb -Wno-unused-function + +.PHONY: all clean +all: parsertest + +clean: + make -Bnd | grep 'Must remake target' | \ + 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 +lexer.gen.h: lexer.gen.c + +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_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: 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 $@ $^ + +jv_parse: jv_parse.c jv.c jv_print.c jv_dtoa.c + $(CC) -DNO_JANSSON -o $@ $^ -DJV_PARSE_MAIN + + +test: jv_test + valgrind --error-exitcode=1 -q --leak-check=full ./jv_test + |