created a header-only version (see issue #16)

This commit is contained in:
Niels 2015-01-09 18:16:27 +01:00
parent 2443aa6521
commit 52f399d55f
4 changed files with 2662 additions and 4 deletions

View file

@ -1,12 +1,17 @@
.PHONY: header_only
# the order is important: header before other sources
CORE_SOURCES = src/json.h src/json.cc
noinst_PROGRAMS = json_unit json_parser
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
json_unit_SOURCES = src/json.cc src/json.h test/catch.hpp test/json_unit.cc
json_unit_SOURCES = $(CORE_SOURCES) test/catch.hpp test/json_unit.cc
json_unit_CXXFLAGS = $(FLAGS) -std=c++11
json_unit_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/test -Dprivate=public
json_parser_SOURCES = src/json.cc src/json.h benchmark/parse.cc
json_parser_SOURCES = $(CORE_SOURCES) benchmark/parse.cc
json_parser_CXXFLAGS = -O3 -std=c++11 -flto
json_parser_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/benchmark
@ -26,4 +31,9 @@ pretty:
$(SOURCES)
parser:
make CXXFLAGS="" json_parser
make CXXFLAGS="" json_parser
header_only/json.h: $(CORE_SOURCES)
cat $(CORE_SOURCES) | $(SED) 's/#include "json.h"//' > header_only/json.h
BUILT_SOURCES = header_only/json.h