diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-24 16:31:15 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-24 16:31:15 +0000 |
commit | 93c202497fa12f75c393e686ed470f85faa72af2 (patch) | |
tree | dbf688f4f4bbd1ac162d5b1d03d6c5cdb62e5ee4 | |
parent | 0d98990eace7a5054dfbb927e16e67eadaf63653 (diff) | |
download | libhubbub-93c202497fa12f75c393e686ed470f85faa72af2.tar.gz libhubbub-93c202497fa12f75c393e686ed470f85faa72af2.tar.bz2 |
Fix determination of whether json is required
svn path=/trunk/hubbub/; revision=6846
-rw-r--r-- | Makefile | 27 | ||||
-rw-r--r-- | test/Makefile | 8 |
2 files changed, 26 insertions, 9 deletions
@@ -13,11 +13,36 @@ WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \ CFLAGS := $(CFLAGS) -std=c99 -D_BSD_SOURCE -I$(CURDIR)/include/ \ -I$(CURDIR)/src $(WARNFLAGS) +# Parserutils ifneq ($(PKGCONFIG),) CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) libparserutils --cflags) LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) libparserutils --libs) else - LDFLAGS := -lparserutils + LDFLAGS := $(LDFLAGS) -lparserutils +endif + +ifeq ($(MAKECMDGOALS),test) + NEED_JSON := yes +else + ifeq ($(MAKECMDGOALS),profile) + NEED_JSON := yes + else + ifeq ($(MAKECMDGOALS),coverage) + NEED_JSON := yes + endif + endif +endif + +ifeq ($(NEED_JSON),yes) + # We require the presence of libjson -- http://oss.metaparadigm.com/json-c/ + ifneq ($(PKGCONFIG),) + CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) $(PKGCONFIGFLAGS) --cflags json) + LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) $(PKGCONFIGFLAGS) --libs json) + else + LDFLAGS := $(LDFLAGS) -ljson + endif + + CFLAGS := $(CFLAGS) -Wno-unused-parameter endif include build/makefiles/Makefile.top diff --git a/test/Makefile b/test/Makefile index a592c56..693098b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,11 +1,3 @@ -ifeq ($(MAKECMDGOALS),test) -# Extend toolchain settings -# We require the presence of libjson -- http://oss.metaparadigm.com/json-c/ -CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) $(PKGCONFIGFLAGS) --cflags json) \ - -Wno-unused-parameter -LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) $(PKGCONFIGFLAGS) --libs json) -endif - # Tests DIR_TEST_SOURCES := csdetect.c dict.c entities.c hubbub.c parser.c \ tokeniser.c tokeniser2.c tokeniser3.c tree.c tree2.c tree-buf.c |