2019-08-27 04:35:18 +08:00
|
|
|
REFERENCE_VERSION = master
|
2018-03-23 12:05:32 +08:00
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
#
|
|
|
|
.SUFFIXES: .cpp .o .c .h
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean cleandist
|
2019-08-03 07:48:34 +08:00
|
|
|
COREDEPSINCLUDE = -Idependencies/json/single_include -Idependencies/rapidjson/include -Idependencies/sajson/include -Idependencies/cJSON -Idependencies/jsmn
|
2019-01-25 03:28:26 +08:00
|
|
|
EXTRADEPSINCLUDE = -Idependencies/jsoncppdist -Idependencies/json11 -Idependencies/fastjson/src -Idependencies/fastjson/include -Idependencies/gason/src -Idependencies/ujson4c/3rdparty -Idependencies/ujson4c/src
|
2019-06-04 02:17:42 +08:00
|
|
|
# users can provide their own additional flags with make EXTRAFLAGS=something
|
2019-06-20 04:45:09 +08:00
|
|
|
architecture:=$(shell arch)
|
2019-07-05 05:19:05 +08:00
|
|
|
|
|
|
|
####
|
|
|
|
# If you want to specify your own target architecture,
|
|
|
|
# then define ARCHFLAGS. Otherwise, we set good default.
|
2020-02-25 06:13:10 +08:00
|
|
|
# E.g., type ' ARCHFLAGS="-march=westmere" make parse '
|
2019-07-05 05:19:05 +08:00
|
|
|
###
|
2019-04-17 10:07:03 +08:00
|
|
|
|
2020-03-03 07:19:20 +08:00
|
|
|
CXXFLAGS = $(ARCHFLAGS) -std=c++17 -pthread -Wall -Wextra -Wshadow -Ibenchmark/linux
|
2020-03-08 05:10:23 +08:00
|
|
|
CFLAGS = $(ARCHFLAGS) -Idependencies/ujson4c/3rdparty -Idependencies/ujson4c/src $(EXTRAFLAGS)
|
2019-07-05 05:19:05 +08:00
|
|
|
|
2019-04-25 05:31:47 +08:00
|
|
|
# This is a convenience flag
|
|
|
|
ifdef SANITIZEGOLD
|
|
|
|
SANITIZE = 1
|
|
|
|
LINKER = gold
|
2018-11-10 10:31:14 +08:00
|
|
|
endif
|
2019-04-25 05:31:47 +08:00
|
|
|
|
|
|
|
ifdef LINKER
|
|
|
|
CXXFLAGS += -fuse-ld=$(LINKER)
|
|
|
|
CFLAGS += -fuse-ld=$(LINKER)
|
2018-12-12 06:20:29 +08:00
|
|
|
endif
|
2018-11-10 10:31:14 +08:00
|
|
|
|
2019-04-25 05:31:47 +08:00
|
|
|
|
|
|
|
# SANITIZE *implies* DEBUG
|
2019-05-19 23:18:54 +08:00
|
|
|
ifeq ($(MEMSANITIZE),1)
|
2020-03-08 05:10:23 +08:00
|
|
|
CXXFLAGS += -g3 -O0 -fsanitize=memory -fno-omit-frame-pointer -fsanitize=undefined
|
|
|
|
CFLAGS += -g3 -O0 -fsanitize=memory -fno-omit-frame-pointer -fsanitize=undefined
|
2019-05-19 23:18:54 +08:00
|
|
|
else
|
2019-04-25 05:31:47 +08:00
|
|
|
ifeq ($(SANITIZE),1)
|
2019-11-06 23:39:26 +08:00
|
|
|
CXXFLAGS += -g3 -O0 -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
|
|
|
|
CFLAGS += -g3 -O0 -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
|
2019-04-25 05:31:47 +08:00
|
|
|
else
|
|
|
|
ifeq ($(DEBUG),1)
|
2020-03-08 05:10:23 +08:00
|
|
|
CXXFLAGS += -g3 -O0
|
|
|
|
CFLAGS += -g3 -O0
|
2019-04-25 05:31:47 +08:00
|
|
|
else
|
|
|
|
# we opt for -O3 for regular builds
|
|
|
|
CXXFLAGS += -O3
|
|
|
|
CFLAGS += -O3
|
|
|
|
endif # ifeq ($(DEBUG),1)
|
|
|
|
endif # ifeq ($(SANITIZE),1)
|
2019-05-19 23:18:54 +08:00
|
|
|
endif # ifeq ($(MEMSANITIZE),1)
|
2019-04-25 05:31:47 +08:00
|
|
|
|
2020-03-03 07:19:20 +08:00
|
|
|
# Headers and sources
|
2020-03-17 10:57:34 +08:00
|
|
|
SRCHEADERS_GENERIC=src/generic/atomparsing.h src/generic/numberparsing.h src/generic/json_scanner.h src/generic/json_string_scanner.h src/generic/json_structural_indexer.h src/generic/stage2_build_tape.h src/generic/stringparsing.h src/generic/stage2_streaming_build_tape.h src/generic/utf8_fastvalidate_algorithm.h src/generic/utf8_lookup_algorithm.h src/generic/utf8_lookup2_algorithm.h src/generic/utf8_range_algorithm.h src/generic/utf8_zwegner_algorithm.h
|
2020-03-03 07:19:20 +08:00
|
|
|
SRCHEADERS_ARM64= src/arm64/bitmanipulation.h src/arm64/bitmask.h src/arm64/intrinsics.h src/arm64/numberparsing.h src/arm64/simd.h src/arm64/stage1_find_marks.h src/arm64/stage2_build_tape.h src/arm64/stringparsing.h
|
|
|
|
SRCHEADERS_HASWELL= src/haswell/bitmanipulation.h src/haswell/bitmask.h src/haswell/intrinsics.h src/haswell/numberparsing.h src/haswell/simd.h src/haswell/stage1_find_marks.h src/haswell/stage2_build_tape.h src/haswell/stringparsing.h
|
2020-03-17 04:51:30 +08:00
|
|
|
SRCHEADERS_FALLBACK= src/fallback/bitmanipulation.h src/fallback/implementation.h src/fallback/numberparsing.h src/fallback/stage1_find_marks.h src/fallback/stage2_build_tape.h src/fallback/stringparsing.h
|
2020-03-03 07:19:20 +08:00
|
|
|
SRCHEADERS_WESTMERE=src/westmere/bitmanipulation.h src/westmere/bitmask.h src/westmere/intrinsics.h src/westmere/numberparsing.h src/westmere/simd.h src/westmere/stage1_find_marks.h src/westmere/stage2_build_tape.h src/westmere/stringparsing.h
|
2020-03-07 10:14:34 +08:00
|
|
|
SRCHEADERS_SRC=src/isadetection.h src/jsoncharutils.h src/simdprune_tables.h src/implementation.cpp src/stage1_find_marks.cpp src/stage2_build_tape.cpp src/document_parser_callbacks.h
|
2020-03-16 03:50:09 +08:00
|
|
|
SRCHEADERS=$(SRCHEADERS_SRC) $(SRCHEADERS_GENERIC) $(SRCHEADERS_ARM64) $(SRCHEADERS_HASWELL) $(SRCHEADERS_WESTMERE) $(SRCHEADERS_FALLBACK)
|
2018-03-23 12:05:32 +08:00
|
|
|
|
2020-03-07 10:14:34 +08:00
|
|
|
INCLUDEHEADERS=include/simdjson.h include/simdjson/common_defs.h include/simdjson/internal/jsonformatutils.h include/simdjson/jsonioutil.h include/simdjson/jsonminifier.h include/simdjson/jsonparser.h include/simdjson/padded_string.h include/simdjson/inline/padded_string.h include/simdjson/document.h include/simdjson/inline/document.h include/simdjson/document_iterator.h include/simdjson/inline/document_iterator.h include/simdjson/document_stream.h include/simdjson/inline/document_stream.h include/simdjson/implementation.h include/simdjson/parsedjson.h include/simdjson/jsonstream.h include/simdjson/inline/jsonstream.h include/simdjson/portability.h include/simdjson/error.h include/simdjson/inline/error.h include/simdjson/simdjson.h include/simdjson/simdjson_version.h
|
2019-12-05 23:42:30 +08:00
|
|
|
|
2020-03-03 07:19:20 +08:00
|
|
|
ifeq ($(SIMDJSON_TEST_AMALGAMATED_HEADERS),1)
|
|
|
|
HEADERS=singleheader/simdjson.h
|
|
|
|
LIBFILES=singleheader/simdjson.cpp
|
|
|
|
CXXFLAGS += -Isingleheader
|
|
|
|
else
|
|
|
|
HEADERS=$(INCLUDEHEADERS) $(SRCHEADERS)
|
|
|
|
LIBFILES=src/simdjson.cpp
|
|
|
|
CXXFLAGS += -Isrc -Iinclude
|
|
|
|
endif
|
2019-08-21 19:59:49 +08:00
|
|
|
|
2020-03-03 07:19:20 +08:00
|
|
|
# We put EXTRAFLAGS after all other CXXFLAGS so they can override if necessary
|
|
|
|
CXXFLAGS += $(EXTRAFLAGS)
|
2018-08-21 05:40:50 +08:00
|
|
|
|
2020-01-27 22:58:14 +08:00
|
|
|
FEATURE_JSON_FILES=jsonexamples/generated/0-structurals-full.json jsonexamples/generated/0-structurals-miss.json jsonexamples/generated/0-structurals.json jsonexamples/generated/15-structurals-full.json jsonexamples/generated/15-structurals-miss.json jsonexamples/generated/15-structurals.json jsonexamples/generated/23-structurals-full.json jsonexamples/generated/23-structurals-miss.json jsonexamples/generated/23-structurals.json jsonexamples/generated/7-structurals-full.json jsonexamples/generated/7-structurals-miss.json jsonexamples/generated/7-structurals.json jsonexamples/generated/escape-full.json jsonexamples/generated/escape-miss.json jsonexamples/generated/escape.json jsonexamples/generated/utf-8-full.json jsonexamples/generated/utf-8-miss.json jsonexamples/generated/utf-8.json
|
2018-03-23 12:05:32 +08:00
|
|
|
|
2018-08-21 05:27:25 +08:00
|
|
|
RAPIDJSON_INCLUDE:=dependencies/rapidjson/include
|
2018-09-28 12:00:52 +08:00
|
|
|
SAJSON_INCLUDE:=dependencies/sajson/include
|
2018-11-21 03:09:43 +08:00
|
|
|
JSON11_INCLUDE:=dependencies/json11/json11.hpp
|
2018-11-21 03:32:12 +08:00
|
|
|
FASTJSON_INCLUDE:=dependencies/include/fastjson/fastjson.h
|
2018-11-21 05:43:22 +08:00
|
|
|
GASON_INCLUDE:=dependencies/gason/src/gason.h
|
|
|
|
UJSON4C_INCLUDE:=dependencies/ujson4c/src/ujdecode.c
|
2019-02-23 04:34:35 +08:00
|
|
|
CJSON_INCLUDE:=dependencies/cJSON/cJSON.h
|
2019-01-18 06:24:29 +08:00
|
|
|
JSMN_INCLUDE:=dependencies/jsmn/jsmn.h
|
2019-08-03 07:48:34 +08:00
|
|
|
JSON_INCLUDE:=dependencies/json/single_include/nlohmann/json.hpp
|
2019-01-18 06:24:29 +08:00
|
|
|
|
2018-12-15 10:32:42 +08:00
|
|
|
EXTRAOBJECTS=ujdecode.o
|
2020-03-03 07:19:20 +08:00
|
|
|
|
|
|
|
MAINEXECUTABLES=parse minify json2json jsonstats statisticalmodel jsonpointer get_corpus_benchmark
|
2020-03-17 04:51:30 +08:00
|
|
|
TESTEXECUTABLES=jsoncheck jsoncheck_westmere jsoncheck_fallback integer_tests numberparsingcheck stringparsingcheck pointercheck parse_many_test basictests errortests readme_examples
|
2020-03-03 07:19:20 +08:00
|
|
|
COMPARISONEXECUTABLES=minifiercompetition parsingcompetition parseandstatcompetition distinctuseridcompetition allparserscheckfile allparsingcompetition
|
|
|
|
SUPPLEMENTARYEXECUTABLES=parse_noutf8validation parse_nonumberparsing parse_nostringparsing
|
|
|
|
|
2018-12-01 11:02:32 +08:00
|
|
|
all: $(MAINEXECUTABLES)
|
2018-08-18 07:57:31 +08:00
|
|
|
|
2018-12-15 10:32:42 +08:00
|
|
|
competition: $(COMPARISONEXECUTABLES)
|
|
|
|
|
2018-12-15 10:50:55 +08:00
|
|
|
.PHONY: benchmark test
|
|
|
|
|
2019-02-23 04:34:35 +08:00
|
|
|
benchmark:
|
2018-12-15 10:50:55 +08:00
|
|
|
bash ./scripts/parser.sh
|
|
|
|
bash ./scripts/parseandstat.sh
|
|
|
|
|
2019-10-07 03:39:55 +08:00
|
|
|
run_basictests: basictests
|
2019-05-09 10:33:11 +08:00
|
|
|
./basictests
|
2019-10-07 03:39:55 +08:00
|
|
|
|
2020-03-08 05:10:23 +08:00
|
|
|
run_errortests: errortests
|
|
|
|
./errortests
|
|
|
|
|
2020-02-18 11:59:30 +08:00
|
|
|
run_readme_examples: readme_examples
|
|
|
|
./readme_examples
|
|
|
|
|
2019-10-07 03:39:55 +08:00
|
|
|
run_numberparsingcheck: numberparsingcheck
|
2018-10-24 08:19:33 +08:00
|
|
|
./numberparsingcheck
|
2019-10-07 03:39:55 +08:00
|
|
|
|
|
|
|
run_integer_tests: integer_tests
|
2019-09-03 00:32:44 +08:00
|
|
|
./integer_tests
|
2019-10-07 03:39:55 +08:00
|
|
|
|
|
|
|
run_stringparsingcheck: stringparsingcheck
|
2018-10-24 08:19:33 +08:00
|
|
|
./stringparsingcheck
|
2019-10-07 03:39:55 +08:00
|
|
|
|
|
|
|
run_jsoncheck: jsoncheck
|
2018-08-18 07:57:31 +08:00
|
|
|
./jsoncheck
|
2019-10-07 03:39:55 +08:00
|
|
|
|
2020-03-06 03:05:37 +08:00
|
|
|
run_parse_many_test: parse_many_test
|
|
|
|
./parse_many_test
|
2019-11-09 06:39:45 +08:00
|
|
|
|
2020-03-17 04:51:30 +08:00
|
|
|
run_jsoncheck_westmere: jsoncheck_westmere
|
|
|
|
./jsoncheck_westmere
|
|
|
|
|
|
|
|
run_jsoncheck_fallback: jsoncheck_fallback
|
|
|
|
./jsoncheck_fallback
|
2019-11-06 23:39:26 +08:00
|
|
|
|
2019-10-07 03:39:55 +08:00
|
|
|
run_pointercheck: pointercheck
|
2019-07-27 06:38:10 +08:00
|
|
|
./pointercheck
|
2019-10-07 03:39:55 +08:00
|
|
|
|
|
|
|
run_issue150_sh: allparserscheckfile
|
2019-05-10 08:51:33 +08:00
|
|
|
./scripts/issue150.sh
|
2018-10-24 08:19:33 +08:00
|
|
|
|
2019-10-07 03:39:55 +08:00
|
|
|
run_testjson2json_sh: minify json2json
|
2019-02-23 03:12:16 +08:00
|
|
|
./scripts/testjson2json.sh
|
2019-10-07 03:39:55 +08:00
|
|
|
|
2019-12-19 04:38:05 +08:00
|
|
|
$(FEATURE_JSON_FILES): benchmark/genfeaturejson.rb
|
2019-09-11 23:38:13 +08:00
|
|
|
ruby ./benchmark/genfeaturejson.rb
|
|
|
|
|
2019-12-19 04:38:05 +08:00
|
|
|
run_benchfeatures: benchfeatures $(FEATURE_JSON_FILES)
|
2019-09-11 23:38:13 +08:00
|
|
|
./benchfeatures -n 1000
|
|
|
|
|
2020-03-17 04:51:30 +08:00
|
|
|
test: run_basictests run_readme_examples run_jsoncheck run_numberparsingcheck run_integer_tests run_stringparsingcheck run_parse_many_test run_pointercheck run_testjson2json_sh run_issue150_sh run_jsoncheck_westmere run_jsoncheck_fallback
|
2019-10-07 03:39:55 +08:00
|
|
|
@echo "It looks like the code is good!"
|
|
|
|
|
2020-03-17 04:51:30 +08:00
|
|
|
quiettest: run_basictests run_readme_examples run_jsoncheck run_numberparsingcheck run_integer_tests run_stringparsingcheck run_jsoncheck run_parse_many_test run_pointercheck run_testjson2json_sh run_issue150_sh run_jsoncheck_westmere run_jsoncheck_fallback
|
2019-10-07 03:39:55 +08:00
|
|
|
|
2020-03-17 04:51:30 +08:00
|
|
|
quicktests: run_basictests run_readme_examples run_jsoncheck run_numberparsingcheck run_integer_tests run_stringparsingcheck run_jsoncheck run_parse_many_test run_pointercheck run_jsoncheck_westmere run_jsoncheck_fallback
|
2019-10-07 03:39:55 +08:00
|
|
|
|
|
|
|
slowtests: run_testjson2json_sh run_issue150_sh
|
2019-02-23 03:09:03 +08:00
|
|
|
|
2018-12-31 10:50:10 +08:00
|
|
|
amalgamate:
|
|
|
|
./amalgamation.sh
|
2020-03-03 07:19:20 +08:00
|
|
|
|
|
|
|
singleheader/simdjson.h singleheader/simdjson.cpp singleheader/amalgamation_demo.cpp: amalgamation.sh src/simdjson.cpp $(SRCHEADERS) $(INCLUDEHEADERS)
|
|
|
|
./amalgamation.sh
|
|
|
|
|
|
|
|
singleheader/demo: singleheader/simdjson.h singleheader/simdjson.cpp singleheader/amalgamation_demo.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -o singleheader/demo singleheader/amalgamation_demo.cpp -Isingleheader
|
2018-08-21 05:27:25 +08:00
|
|
|
|
2019-11-06 23:39:26 +08:00
|
|
|
submodules:
|
2019-05-30 00:03:07 +08:00
|
|
|
-git submodule update --init --recursive
|
2019-07-11 23:54:17 +08:00
|
|
|
-touch submodules
|
2018-08-21 05:27:25 +08:00
|
|
|
|
2019-08-03 07:48:34 +08:00
|
|
|
$(JSON_INCLUDE) $(SAJSON_INCLUDE) $(RAPIDJSON_INCLUDE) $(JSON11_INCLUDE) $(FASTJSON_INCLUDE) $(GASON_INCLUDE) $(UJSON4C_INCLUDE) $(CJSON_INCLUDE) $(JSMN_INCLUDE) : submodules
|
2018-08-21 05:27:25 +08:00
|
|
|
|
2020-02-22 05:34:27 +08:00
|
|
|
parse: benchmark/parse.cpp benchmark/event_counter.h benchmark/benchmarker.h $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o parse benchmark/parse.cpp $(LIBFILES) $(LIBFLAGS)
|
2018-08-18 07:57:31 +08:00
|
|
|
|
2020-03-03 07:19:20 +08:00
|
|
|
get_corpus_benchmark: benchmark/get_corpus_benchmark.cpp $(HEADERS) $(LIBFILES)
|
|
|
|
$(CXX) $(CXXFLAGS) -o get_corpus_benchmark benchmark/get_corpus_benchmark.cpp $(LIBFILES) $(LIBFLAGS)
|
2020-01-21 06:27:25 +08:00
|
|
|
|
2020-02-22 05:34:27 +08:00
|
|
|
parse_stream: benchmark/parse_stream.cpp benchmark/event_counter.h benchmark/benchmarker.h $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o parse_stream benchmark/parse_stream.cpp $(LIBFILES) $(LIBFLAGS)
|
2020-01-04 11:22:47 +08:00
|
|
|
|
2020-02-22 05:34:27 +08:00
|
|
|
benchfeatures: benchmark/benchfeatures.cpp benchmark/event_counter.h benchmark/benchmarker.h $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o benchfeatures benchmark/benchfeatures.cpp $(LIBFILES) $(LIBFLAGS)
|
2019-09-11 23:38:13 +08:00
|
|
|
|
2019-08-13 04:03:56 +08:00
|
|
|
perfdiff: benchmark/perfdiff.cpp
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o perfdiff benchmark/perfdiff.cpp $(LIBFILES) $(LIBFLAGS)
|
2019-08-13 04:03:56 +08:00
|
|
|
|
|
|
|
checkperf:
|
2019-08-16 08:43:21 +08:00
|
|
|
bash ./scripts/checkperf.sh $(REFERENCE_VERSION)
|
2019-08-13 04:03:56 +08:00
|
|
|
|
2018-12-25 01:28:27 +08:00
|
|
|
statisticalmodel: benchmark/statisticalmodel.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o statisticalmodel benchmark/statisticalmodel.cpp $(LIBFILES) $(LIBFLAGS)
|
2018-12-25 01:28:27 +08:00
|
|
|
|
|
|
|
|
2018-12-20 10:23:37 +08:00
|
|
|
parse_noutf8validation: benchmark/parse.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o parse_noutf8validation -DSIMDJSON_SKIPUTF8VALIDATION benchmark/parse.cpp $(LIBFILES) $(LIBFLAGS)
|
2018-12-20 10:23:37 +08:00
|
|
|
|
|
|
|
parse_nonumberparsing: benchmark/parse.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o parse_nonumberparsing -DSIMDJSON_SKIPNUMBERPARSING benchmark/parse.cpp $(LIBFILES) $(LIBFLAGS)
|
2018-12-20 10:23:37 +08:00
|
|
|
|
|
|
|
parse_nostringparsing: benchmark/parse.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o parse_nostringparsing -DSIMDJSON_SKIPSTRINGPARSING benchmark/parse.cpp $(LIBFILES) $(LIBFLAGS)
|
2018-12-20 10:23:37 +08:00
|
|
|
|
|
|
|
|
2018-08-18 07:57:31 +08:00
|
|
|
jsoncheck:tests/jsoncheck.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o jsoncheck tests/jsoncheck.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2018-08-18 07:57:31 +08:00
|
|
|
|
2020-03-06 03:05:37 +08:00
|
|
|
parse_many_test:tests/parse_many_test.cpp $(HEADERS) $(LIBFILES)
|
|
|
|
$(CXX) $(CXXFLAGS) -o parse_many_test tests/parse_many_test.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2019-11-09 06:39:45 +08:00
|
|
|
|
2019-11-06 23:39:26 +08:00
|
|
|
|
2020-03-17 04:51:30 +08:00
|
|
|
jsoncheck_westmere:tests/jsoncheck.cpp $(HEADERS) $(LIBFILES)
|
|
|
|
$(CXX) $(CXXFLAGS) -o jsoncheck_westmere tests/jsoncheck.cpp -I. $(LIBFILES) $(LIBFLAGS) -DSIMDJSON_IMPLEMENTATION_HASWELL=0
|
|
|
|
|
|
|
|
jsoncheck_fallback:tests/jsoncheck.cpp $(HEADERS) $(LIBFILES)
|
|
|
|
$(CXX) $(CXXFLAGS) -o jsoncheck_fallback tests/jsoncheck.cpp -I. $(LIBFILES) $(LIBFLAGS) -DSIMDJSON_IMPLEMENTATION_HASWELL=0 -DSIMDJSON_IMPLEMENTATION_WESTMERE=0 -DSIMDJSON_IMPLEMENTATION_ARM64=0
|
2019-11-06 23:39:26 +08:00
|
|
|
|
2019-05-09 10:33:11 +08:00
|
|
|
basictests:tests/basictests.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o basictests tests/basictests.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2019-05-09 10:33:11 +08:00
|
|
|
|
2020-03-08 05:10:23 +08:00
|
|
|
errortests:tests/errortests.cpp $(HEADERS) $(LIBFILES)
|
|
|
|
$(CXX) $(CXXFLAGS) -o errortests tests/errortests.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
|
|
|
|
2020-02-18 11:59:30 +08:00
|
|
|
readme_examples: tests/readme_examples.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o readme_examples tests/readme_examples.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2020-02-18 11:59:30 +08:00
|
|
|
|
2019-05-09 10:33:11 +08:00
|
|
|
|
2020-03-03 07:19:20 +08:00
|
|
|
numberparsingcheck: tests/numberparsingcheck.cpp $(HEADERS) src/simdjson.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -o numberparsingcheck tests/numberparsingcheck.cpp -I. $(LIBFLAGS) -DJSON_TEST_NUMBERS
|
2018-09-28 05:38:15 +08:00
|
|
|
|
2019-09-03 00:32:44 +08:00
|
|
|
integer_tests:tests/integer_tests.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o integer_tests tests/integer_tests.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2019-09-03 00:32:44 +08:00
|
|
|
|
|
|
|
|
2018-10-24 08:19:33 +08:00
|
|
|
|
2020-03-03 07:19:20 +08:00
|
|
|
stringparsingcheck: tests/stringparsingcheck.cpp $(HEADERS) src/simdjson.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -o stringparsingcheck tests/stringparsingcheck.cpp -I. $(LIBFLAGS) -DJSON_TEST_STRINGS
|
2018-10-24 08:19:33 +08:00
|
|
|
|
2019-07-27 06:38:10 +08:00
|
|
|
pointercheck:tests/pointercheck.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o pointercheck tests/pointercheck.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2018-10-24 08:19:33 +08:00
|
|
|
|
2020-03-03 07:19:20 +08:00
|
|
|
minifiercompetition: benchmark/minifiercompetition.cpp submodules $(HEADERS) $(LIBFILES)
|
|
|
|
$(CXX) $(CXXFLAGS) -o minifiercompetition benchmark/minifiercompetition.cpp -I. $(LIBFILES) $(LIBFLAGS) $(COREDEPSINCLUDE)
|
2018-08-21 05:27:25 +08:00
|
|
|
|
2020-03-03 07:19:20 +08:00
|
|
|
minify: tools/minify.cpp $(HEADERS) $(LIBFILES)
|
|
|
|
$(CXX) $(CXXFLAGS) -o minify tools/minify.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2018-09-28 12:00:52 +08:00
|
|
|
|
2018-12-07 06:22:22 +08:00
|
|
|
json2json: tools/json2json.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o json2json $ tools/json2json.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2018-12-07 06:22:22 +08:00
|
|
|
|
2019-07-27 06:38:10 +08:00
|
|
|
jsonpointer: tools/jsonpointer.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o jsonpointer $ tools/jsonpointer.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2019-07-27 06:38:10 +08:00
|
|
|
|
2018-12-23 01:13:42 +08:00
|
|
|
jsonstats: tools/jsonstats.cpp $(HEADERS) $(LIBFILES)
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o jsonstats $ tools/jsonstats.cpp -I. $(LIBFILES) $(LIBFLAGS)
|
2018-12-07 06:22:22 +08:00
|
|
|
|
2018-11-21 05:43:22 +08:00
|
|
|
ujdecode.o: $(UJSON4C_INCLUDE)
|
2019-02-23 04:34:35 +08:00
|
|
|
$(CC) $(CFLAGS) -c dependencies/ujson4c/src/ujdecode.c
|
2018-11-21 05:43:22 +08:00
|
|
|
|
2019-07-11 23:54:17 +08:00
|
|
|
parseandstatcompetition: benchmark/parseandstatcompetition.cpp $(HEADERS) $(LIBFILES) submodules
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o parseandstatcompetition benchmark/parseandstatcompetition.cpp -I. $(LIBFILES) $(LIBFLAGS) $(COREDEPSINCLUDE)
|
2018-12-15 10:32:42 +08:00
|
|
|
|
2019-07-11 23:54:17 +08:00
|
|
|
distinctuseridcompetition: benchmark/distinctuseridcompetition.cpp $(HEADERS) $(LIBFILES) submodules
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o distinctuseridcompetition benchmark/distinctuseridcompetition.cpp -I. $(LIBFILES) $(LIBFLAGS) $(COREDEPSINCLUDE)
|
2018-12-12 11:39:39 +08:00
|
|
|
|
2019-11-06 23:39:26 +08:00
|
|
|
parsingcompetition: benchmark/parsingcompetition.cpp $(HEADERS) $(LIBFILES) submodules
|
2019-08-03 07:48:34 +08:00
|
|
|
@echo "In case of build error due to missing files, try 'make clean'"
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o parsingcompetition benchmark/parsingcompetition.cpp -I. $(LIBFILES) $(LIBFLAGS) $(COREDEPSINCLUDE)
|
2018-12-20 10:23:37 +08:00
|
|
|
|
2019-07-11 23:54:17 +08:00
|
|
|
allparsingcompetition: benchmark/parsingcompetition.cpp $(HEADERS) $(LIBFILES) $(EXTRAOBJECTS) submodules
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o allparsingcompetition benchmark/parsingcompetition.cpp $(EXTRAOBJECTS) -I. $(LIBFILES) $(LIBFLAGS) $(COREDEPSINCLUDE) $(EXTRADEPSINCLUDE) -DALLPARSER
|
2019-01-18 06:24:29 +08:00
|
|
|
|
2018-08-21 05:27:25 +08:00
|
|
|
|
2019-07-11 23:54:17 +08:00
|
|
|
allparserscheckfile: tests/allparserscheckfile.cpp $(HEADERS) $(LIBFILES) $(EXTRAOBJECTS) submodules
|
2020-03-03 07:19:20 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -o allparserscheckfile tests/allparserscheckfile.cpp $(EXTRAOBJECTS) -I. $(LIBFILES) $(LIBFLAGS) $(COREDEPSINCLUDE) $(EXTRADEPSINCLUDE)
|
2018-03-23 12:05:32 +08:00
|
|
|
|
2019-07-11 23:54:17 +08:00
|
|
|
.PHONY: clean cppcheck cleandist
|
2018-07-30 01:09:47 +08:00
|
|
|
|
2018-11-30 22:37:57 +08:00
|
|
|
cppcheck:
|
2019-02-23 04:34:35 +08:00
|
|
|
cppcheck --enable=all src/*.cpp benchmarks/*.cpp tests/*.cpp -Iinclude -I. -Ibenchmark/linux
|
2018-11-30 22:37:57 +08:00
|
|
|
|
2018-12-28 09:09:25 +08:00
|
|
|
everything: $(MAINEXECUTABLES) $(EXTRA_EXECUTABLES) $(TESTEXECUTABLES) $(COMPARISONEXECUTABLES) $(SUPPLEMENTARYEXECUTABLES)
|
2018-11-30 22:37:57 +08:00
|
|
|
|
2018-03-23 12:05:32 +08:00
|
|
|
clean:
|
2019-07-11 23:54:17 +08:00
|
|
|
rm -f submodules $(EXTRAOBJECTS) $(MAINEXECUTABLES) $(EXTRA_EXECUTABLES) $(TESTEXECUTABLES) $(COMPARISONEXECUTABLES) $(SUPPLEMENTARYEXECUTABLES)
|
2018-03-23 12:05:32 +08:00
|
|
|
|
|
|
|
cleandist:
|
2019-07-11 23:54:17 +08:00
|
|
|
rm -f submodules $(EXTRAOBJECTS) $(MAINEXECUTABLES) $(EXTRA_EXECUTABLES) $(TESTEXECUTABLES) $(COMPARISONEXECUTABLES) $(SUPPLEMENTARYEXECUTABLES)
|