2015-01-09 17:16:27 +00:00
|
|
|
.PHONY: header_only
|
|
|
|
|
|
|
|
# the order is important: header before other sources
|
|
|
|
CORE_SOURCES = src/json.h src/json.cc
|
|
|
|
|
2014-12-29 20:13:03 +00:00
|
|
|
noinst_PROGRAMS = json_unit json_parser
|
2014-12-28 08:11:01 +00:00
|
|
|
|
|
|
|
FLAGS = -Wall -Wextra -pedantic -Weffc++ -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch -Wundef -Wno-unused -Wnon-virtual-dtor -Wreorder
|
2013-07-04 08:49:03 +00:00
|
|
|
|
2015-01-09 17:16:27 +00:00
|
|
|
json_unit_SOURCES = $(CORE_SOURCES) test/catch.hpp test/json_unit.cc
|
2014-12-28 08:11:01 +00:00
|
|
|
json_unit_CXXFLAGS = $(FLAGS) -std=c++11
|
|
|
|
json_unit_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/test -Dprivate=public
|
2013-07-04 08:49:03 +00:00
|
|
|
|
2015-01-09 17:16:27 +00:00
|
|
|
json_parser_SOURCES = $(CORE_SOURCES) benchmark/parse.cc
|
2014-12-30 09:54:01 +00:00
|
|
|
json_parser_CXXFLAGS = -O3 -std=c++11 -flto
|
2014-12-29 20:13:03 +00:00
|
|
|
json_parser_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/benchmark
|
|
|
|
|
2014-12-28 08:11:01 +00:00
|
|
|
cppcheck:
|
2015-01-04 19:43:25 +00:00
|
|
|
cppcheck --enable=all --inconclusive --std=c++11 src/json.*
|
2013-12-11 09:50:50 +00:00
|
|
|
|
2013-07-04 08:49:03 +00:00
|
|
|
svn-clean: maintainer-clean
|
2014-12-28 08:11:01 +00:00
|
|
|
rm -fr configure INSTALL aclocal.m4 build-aux depcomp install-sh missing test-driver
|
2013-07-04 08:49:03 +00:00
|
|
|
for DIR in $(DIST_SUBDIRS) .; do rm -f $$DIR/Makefile.in; done
|
2013-12-11 09:23:31 +00:00
|
|
|
|
2014-12-28 08:11:01 +00:00
|
|
|
pretty:
|
|
|
|
astyle --style=allman --indent=spaces=4 --indent-modifiers \
|
|
|
|
--indent-switches --indent-preproc-block --indent-preproc-define \
|
|
|
|
--indent-col1-comments --pad-oper --pad-header --align-pointer=type \
|
|
|
|
--align-reference=type --add-brackets --convert-tabs --close-templates \
|
|
|
|
--lineend=linux --preserve-date --suffix=none \
|
|
|
|
$(SOURCES)
|
2014-12-30 09:54:01 +00:00
|
|
|
|
|
|
|
parser:
|
2015-01-09 17:16:27 +00:00
|
|
|
make CXXFLAGS="" json_parser
|
|
|
|
|
|
|
|
header_only/json.h: $(CORE_SOURCES)
|
2015-01-13 18:07:53 +00:00
|
|
|
$(AM_V_GEN)
|
|
|
|
$(AM_V_at)mkdir -p header_only
|
|
|
|
$(AM_V_at)cat $(CORE_SOURCES) | $(SED) 's/#include "json.h"//' > header_only/json.h
|
2015-01-09 17:16:27 +00:00
|
|
|
|
|
|
|
BUILT_SOURCES = header_only/json.h
|