Skip to content

Commit 3640ab9

Browse files
committed
Fixing the makefile build.
1 parent 389f8b5 commit 3640ab9

3 files changed

Lines changed: 21 additions & 20 deletions

File tree

Makefile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66

77
.PHONY: clean cleandist
8-
COREDEPSINCLUDE = -Idependencies/rapidjson/include -Idependencies/sajson/include -Idependencies/cJSON -Idependencies/jsmn
8+
COREDEPSINCLUDE = -Idependencies/rapidjson/include -Idependencies/sajson/include -Idependencies/cJSON -Idependencies/jsmn
99
EXTRADEPSINCLUDE = -Idependencies/jsoncppdist -Idependencies/json11 -Idependencies/fastjson/src -Idependencies/fastjson/include -Idependencies/gason/src -Idependencies/ujson4c/3rdparty -Idependencies/ujson4c/src
10-
CXXFLAGS = -std=c++17 -march=native -Wall -Wextra -Wshadow -Iinclude -Ibenchmark/linux
10+
CXXFLAGS = -std=c++17 -march=native -Wall -Wextra -Wshadow -Iinclude -Ibenchmark/linux
1111
CFLAGS = -march=native -Idependencies/ujson4c/3rdparty -Idependencies/ujson4c/src
1212
ifeq ($(SANITIZE),1)
1313
CXXFLAGS += -g3 -O0 -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
@@ -23,12 +23,12 @@ endif
2323
endif
2424

2525
MAINEXECUTABLES=parse minify json2json jsonstats statisticalmodel
26-
TESTEXECUTABLES=jsoncheck numberparsingcheck stringparsingcheck
26+
TESTEXECUTABLES=jsoncheck numberparsingcheck stringparsingcheck
2727
COMPARISONEXECUTABLES=minifiercompetition parsingcompetition parseandstatcompetition distinctuseridcompetition allparserscheckfile allparsingcompetition
2828
SUPPLEMENTARYEXECUTABLES=parse_noutf8validation parse_nonumberparsing parse_nostringparsing
2929

3030
HEADERS= include/simdjson/simdutf8check.h include/simdjson/stringparsing.h include/simdjson/numberparsing.h include/simdjson/jsonparser.h include/simdjson/common_defs.h include/simdjson/jsonioutil.h benchmark/benchmark.h benchmark/linux/linux-perf-events.h include/simdjson/parsedjson.h include/simdjson/stage1_find_marks.h include/simdjson/stage2_build_tape.h include/simdjson/jsoncharutils.h include/simdjson/jsonformatutils.h
31-
LIBFILES=src/jsonioutil.cpp src/jsonparser.cpp src/stage1_find_marks.cpp src/stage2_build_tape.cpp
31+
LIBFILES=src/jsonioutil.cpp src/jsonparser.cpp src/stage1_find_marks.cpp src/stage2_build_tape.cpp src/parsedjson.cpp src/parsedjsoniterator.cpp
3232
MINIFIERHEADERS=include/simdjson/jsonminifier.h include/simdjson/simdprune_tables.h
3333
MINIFIERLIBFILES=src/jsonminifier.cpp
3434

@@ -39,7 +39,7 @@ JSON11_INCLUDE:=dependencies/json11/json11.hpp
3939
FASTJSON_INCLUDE:=dependencies/include/fastjson/fastjson.h
4040
GASON_INCLUDE:=dependencies/gason/src/gason.h
4141
UJSON4C_INCLUDE:=dependencies/ujson4c/src/ujdecode.c
42-
CJSON_INCLUDE:=dependencies/cJSON/cJSON.h
42+
CJSON_INCLUDE:=dependencies/cJSON/cJSON.h
4343
JSMN_INCLUDE:=dependencies/jsmn/jsmn.h
4444

4545

@@ -52,7 +52,7 @@ competition: $(COMPARISONEXECUTABLES)
5252

5353
.PHONY: benchmark test
5454

55-
benchmark:
55+
benchmark:
5656
bash ./scripts/parser.sh
5757
bash ./scripts/parseandstat.sh
5858

@@ -61,7 +61,7 @@ test: jsoncheck numberparsingcheck stringparsingcheck
6161
./stringparsingcheck
6262
./jsoncheck
6363
./scripts/testjson2json.sh
64-
@echo
64+
@echo
6565
@tput setaf 2
6666
@echo "It looks like the code is good!"
6767
@tput sgr0
@@ -116,47 +116,47 @@ jsoncheck:tests/jsoncheck.cpp $(HEADERS) $(LIBFILES)
116116
$(CXX) $(CXXFLAGS) -o jsoncheck $(LIBFILES) tests/jsoncheck.cpp -I. $(LIBFLAGS)
117117

118118
numberparsingcheck:tests/numberparsingcheck.cpp $(HEADERS) $(LIBFILES)
119-
$(CXX) $(CXXFLAGS) -o numberparsingcheck tests/numberparsingcheck.cpp src/jsonioutil.cpp src/jsonparser.cpp src/stage1_find_marks.cpp -I. $(LIBFLAGS) -DJSON_TEST_NUMBERS
119+
$(CXX) $(CXXFLAGS) -o numberparsingcheck tests/numberparsingcheck.cpp src/jsonioutil.cpp src/jsonparser.cpp src/stage1_find_marks.cpp src/parsedjson.cpp -I. $(LIBFLAGS) -DJSON_TEST_NUMBERS
120120

121121

122122
stringparsingcheck:tests/stringparsingcheck.cpp $(HEADERS) $(LIBFILES)
123-
$(CXX) $(CXXFLAGS) -o stringparsingcheck tests/stringparsingcheck.cpp src/jsonioutil.cpp src/jsonparser.cpp src/stage1_find_marks.cpp -I. $(LIBFLAGS) -DJSON_TEST_STRINGS
123+
$(CXX) $(CXXFLAGS) -o stringparsingcheck tests/stringparsingcheck.cpp src/jsonioutil.cpp src/jsonparser.cpp src/stage1_find_marks.cpp src/parsedjson.cpp -I. $(LIBFLAGS) -DJSON_TEST_STRINGS
124124

125125

126126
minifiercompetition: benchmark/minifiercompetition.cpp $(HEADERS) $(LIBS) $(MINIFIERHEADERS) $(LIBFILES) $(MINIFIERLIBFILES)
127127
$(CXX) $(CXXFLAGS) -o minifiercompetition $(LIBFILES) $(MINIFIERLIBFILES) benchmark/minifiercompetition.cpp -I. $(LIBFLAGS) $(COREDEPSINCLUDE)
128128

129129
minify: tools/minify.cpp $(HEADERS) $(MINIFIERHEADERS) $(LIBFILES) $(MINIFIERLIBFILES)
130-
$(CXX) $(CXXFLAGS) -o minify $(MINIFIERLIBFILES) $(LIBFILES) tools/minify.cpp -I.
130+
$(CXX) $(CXXFLAGS) -o minify $(MINIFIERLIBFILES) $(LIBFILES) tools/minify.cpp -I.
131131

132132
json2json: tools/json2json.cpp $(HEADERS) $(LIBFILES)
133-
$(CXX) $(CXXFLAGS) -o json2json $ tools/json2json.cpp $(LIBFILES) -I.
133+
$(CXX) $(CXXFLAGS) -o json2json $ tools/json2json.cpp $(LIBFILES) -I.
134134

135135
jsonstats: tools/jsonstats.cpp $(HEADERS) $(LIBFILES)
136-
$(CXX) $(CXXFLAGS) -o jsonstats $ tools/jsonstats.cpp $(LIBFILES) -I.
136+
$(CXX) $(CXXFLAGS) -o jsonstats $ tools/jsonstats.cpp $(LIBFILES) -I.
137137

138138
ujdecode.o: $(UJSON4C_INCLUDE)
139-
$(CC) $(CFLAGS) -c dependencies/ujson4c/src/ujdecode.c
139+
$(CC) $(CFLAGS) -c dependencies/ujson4c/src/ujdecode.c
140140

141-
parseandstatcompetition: benchmark/parseandstatcompetition.cpp $(HEADERS) $(LIBFILES)
141+
parseandstatcompetition: benchmark/parseandstatcompetition.cpp $(HEADERS) $(LIBFILES)
142142
$(CXX) $(CXXFLAGS) -o parseandstatcompetition $(LIBFILES) benchmark/parseandstatcompetition.cpp -I. $(LIBFLAGS) $(COREDEPSINCLUDE)
143143

144-
distinctuseridcompetition: benchmark/distinctuseridcompetition.cpp $(HEADERS) $(LIBFILES)
144+
distinctuseridcompetition: benchmark/distinctuseridcompetition.cpp $(HEADERS) $(LIBFILES)
145145
$(CXX) $(CXXFLAGS) -o distinctuseridcompetition $(LIBFILES) benchmark/distinctuseridcompetition.cpp -I. $(LIBFLAGS) $(COREDEPSINCLUDE)
146146

147-
parsingcompetition: benchmark/parsingcompetition.cpp $(HEADERS) $(LIBFILES)
148-
$(CXX) $(CXXFLAGS) -o parsingcompetition $(LIBFILES) benchmark/parsingcompetition.cpp -I. $(LIBFLAGS) $(COREDEPSINCLUDE)
147+
parsingcompetition: benchmark/parsingcompetition.cpp $(HEADERS) $(LIBFILES)
148+
$(CXX) $(CXXFLAGS) -o parsingcompetition $(LIBFILES) benchmark/parsingcompetition.cpp -I. $(LIBFLAGS) $(COREDEPSINCLUDE)
149149

150150
allparsingcompetition: benchmark/parsingcompetition.cpp $(HEADERS) $(LIBFILES) $(EXTRAOBJECTS) $(LIBS)
151151
$(CXX) $(CXXFLAGS) -o allparsingcompetition $(LIBFILES) benchmark/parsingcompetition.cpp $(EXTRAOBJECTS) -I. $(LIBFLAGS) $(COREDEPSINCLUDE) $(EXTRADEPSINCLUDE) -DALLPARSER
152152

153153

154-
allparserscheckfile: tests/allparserscheckfile.cpp $(HEADERS) $(LIBFILES) $(EXTRAOBJECTS) $(LIBS)
154+
allparserscheckfile: tests/allparserscheckfile.cpp $(HEADERS) $(LIBFILES) $(EXTRAOBJECTS) $(LIBS)
155155
$(CXX) $(CXXFLAGS) -o allparserscheckfile $(LIBFILES) tests/allparserscheckfile.cpp $(EXTRAOBJECTS) -I. $(LIBFLAGS) $(COREDEPSINCLUDE) $(EXTRADEPSINCLUDE)
156156

157157

158158
cppcheck:
159-
cppcheck --enable=all src/*.cpp benchmarks/*.cpp tests/*.cpp -Iinclude -I. -Ibenchmark/linux
159+
cppcheck --enable=all src/*.cpp benchmarks/*.cpp tests/*.cpp -Iinclude -I. -Ibenchmark/linux
160160

161161
everything: $(MAINEXECUTABLES) $(EXTRA_EXECUTABLES) $(TESTEXECUTABLES) $(COMPARISONEXECUTABLES) $(SUPPLEMENTARYEXECUTABLES)
162162

include/simdjson/jsoncharutils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const char digittoval[256] = {
7979
}*/
8080

8181
// returns a value with the highest bit set if it is not valid
82-
uint32_t hex_to_u32_nocheck(const uint8_t *src) {
82+
static inline uint32_t hex_to_u32_nocheck(const uint8_t *src) {// strictly speaking, static inline is a C-ism
8383
uint8_t v1 = src[0];
8484
uint8_t v2 = src[1];
8585
uint8_t v3 = src[2];

include/simdjson/stage2_build_tape.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ void init_state_machine();
99
WARN_UNUSED
1010
bool unified_machine(const uint8_t *buf, size_t len, ParsedJson &pj);
1111

12+
1213
WARN_UNUSED
1314
static inline bool unified_machine(const char *buf, size_t len, ParsedJson &pj) {
1415
return unified_machine((const uint8_t *)buf,len,pj);

0 commit comments

Comments
 (0)