From 71f4a46b3a94a406530ef000420795e49d17ebf4 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 25 Mar 2009 20:35:48 +0000 Subject: First cut at a port to the new buildsystem. DOMTS stuff currently disabled. svn path=/trunk/dom/; revision=6883 --- Makefile | 58 +++++++++++++------------ Makefile-riscos | 40 ----------------- Makefile.config | 11 +++++ bindings/Makefile | 52 +--------------------- bindings/hubbub/Makefile | 76 +++++--------------------------- bindings/xml/Makefile | 77 +++++--------------------------- build/Makefile.common | 45 ------------------- src/Makefile | 78 +-------------------------------- src/bootstrap/Makefile | 54 +---------------------- src/core/Makefile | 65 ++++----------------------- src/utils/Makefile | 55 ++--------------------- test/Makefile | 111 ++++++++++------------------------------------- test/lib/Makefile | 69 ----------------------------- 13 files changed, 103 insertions(+), 688 deletions(-) delete mode 100644 Makefile-riscos create mode 100644 Makefile.config delete mode 100644 build/Makefile.common delete mode 100644 test/lib/Makefile diff --git a/Makefile b/Makefile index 55332c5..e2aae21 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,38 @@ -# Toolchain definitions for building on the destination platform -export CC = gcc -export AR = ar -export LD = gcc - -export CP = cp -export RM = rm -export MKDIR = mkdir -export MV = mv -export ECHO = echo -export MAKE = make -export PERL = perl -export PKGCONFIG = pkg-config -export XSLT = xsltproc +# Component settings +COMPONENT := dom +# Default to a static library +COMPONENT_TYPE ?= lib-static + +# Setup the tooling +include build/makefiles/Makefile.tools + +TESTRUNNER := $(PERL) build/testtools/testrunner.pl # Toolchain flags -WARNFLAGS = -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \ +WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -Werror -pedantic -export CFLAGS = -std=c99 -D_BSD_SOURCE -I$(TOP)/include/ $(WARNFLAGS) -export ARFLAGS = -cru -export LDFLAGS = -L$(TOP)/ +CFLAGS := $(CFLAGS) -std=c99 -D_BSD_SOURCE -I$(CURDIR)/include/ \ + -I$(CURDIR)/src $(WARNFLAGS) + +include build/makefiles/Makefile.top -export CPFLAGS = -export RMFLAGS = -export MKDIRFLAGS = -p -export MVFLAGS = -export ECHOFLAGS = -export MAKEFLAGS = -export PKGCONFIGFLAGS = -export XSLTFLAGS = +# Extra installation rules +I := include/dom +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/dom.h;$(I)/functypes.h -export EXEEXT = +I := include/dom/bootstrap +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/implpriv.h;$(I)/implregistry.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/init_fini.h +I := include/dom/core +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/attr.h;$(I)/characterdata.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/document.h;$(I)/document_type.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/element.h;$(I)/exceptions.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/implementation.h;$(I)/impllist.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/namednodemap.h;$(I)/node.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/nodelist.h;$(I)/string.h +INSTALL_ITEMS := $(INSTALL_ITEMS) /$(I):$(I)/text.h -include build/Makefile.common +INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in +INSTALL_ITEMS := $(INSTALL_ITEMS) /lib:$(BUILDDIR)/lib$(COMPONENT)$(LIBEXT) diff --git a/Makefile-riscos b/Makefile-riscos deleted file mode 100644 index 43c0be3..0000000 --- a/Makefile-riscos +++ /dev/null @@ -1,40 +0,0 @@ -# Toolchain definitions for building for RISC OS using the GCCSDK cross-compiler -GCCSDK_INSTALL_CROSSBIN ?= /home/riscos/cross/bin -GCCSDK_INSTALL_ENV ?= /home/riscos/env - -export CC = $(GCCSDK_INSTALL_CROSSBIN)/gcc -export AR = $(GCCSDK_INSTALL_CROSSBIN)/ar -export LD = $(GCCSDK_INSTALL_CROSSBIN)/gcc - -export CP = cp -export RM = rm -export MKDIR = mkdir -export MV = mv -export ECHO = echo -export MAKE = make -export PERL = perl -export PKGCONFIG = $(GCCSDK_INSTALL_ENV)/ro-pkg-config -export XSLT = xsltproc - -# Toolchain flags -WARNFLAGS = -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \ - -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ - -Wmissing-declarations -Wnested-externs -Werror -pedantic -export CFLAGS = -std=c99 -D_BSD_SOURCE -I$(TOP)/include/ $(WARNFLAGS) \ - -mpoke-function-name -export ARFLAGS = -cru -export LDFLAGS = -L$(TOP)/ - -export CPFLAGS = -export RMFLAGS = -export MKDIRFLAGS = -p -export MVFLAGS = -export ECHOFLAGS = -export MAKEFLAGS = -export PKGCONFIGFLAGS = -export XSLTFLAGS = - -export EXEEXT = ,ff8 - - -include build/Makefile.common diff --git a/Makefile.config b/Makefile.config new file mode 100644 index 0000000..095f6d8 --- /dev/null +++ b/Makefile.config @@ -0,0 +1,11 @@ +# Configuration Makefile fragment + +# Build the libxml2 binding? +# yes | no +WITH_LIBXML_BINDING := yes + +# Build the hubbub binding? +# yes | no +WITH_HUBBUB_BINDING := yes + +include Makefile.config.override diff --git a/bindings/Makefile b/bindings/Makefile index 67c3f25..26e4927 100644 --- a/bindings/Makefile +++ b/bindings/Makefile @@ -1,51 +1 @@ -# Makefile for libdom -# -# Toolchain is exported by top-level makefile -# -# Top-level makefile also exports the following variables: -# -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root -# -# The top-level makefile requires the following targets to exist: -# -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases - -.PHONY: clean debug distclean export release setup test - -# Targets -release: - @${MAKE} -C xml release - @${MAKE} -C hubbub release - -debug: - @${MAKE} -C xml debug - @${MAKE} -C hubbub debug - -clean: - @${MAKE} -C xml clean - @${MAKE} -C hubbub clean - -distclean: - @${MAKE} -C xml distclean - @${MAKE} -C hubbub distclean - -setup: - @${MAKE} -C xml setup - @${MAKE} -C hubbub setup - -export: - @${MAKE} -C xml export - @${MAKE} -C hubbub export - -test: - @${MAKE} -C xml test - @${MAKE} -C hubbub test - +include build/makefiles/Makefile.subdir diff --git a/bindings/hubbub/Makefile b/bindings/hubbub/Makefile index d98565a..b575e27 100644 --- a/bindings/hubbub/Makefile +++ b/bindings/hubbub/Makefile @@ -1,68 +1,16 @@ -# Makefile for libdom -# -# Toolchain is exported by top-level makefile -# -# Top-level makefile also exports the following variables: -# -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root -# -# The top-level makefile requires the following targets to exist: -# -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases +ifeq ($(WITH_HUBBUB_BINDING),yes) + DIR_SOURCES := parser.c -# Manipulate include paths -CFLAGS += -I$(CURDIR) `$(PKGCONFIG) --cflags libhubbub` + DIR_INSTALL_ITEMS := /include/dom/bindings/hubbub:errors.h;parser.h -# Release output -RELEASE = ${TOP}/${COMPONENT}-libhubbub.a + # Hubbub + ifneq ($(PKGCONFIG),) + CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) libhubbub --cflags) + LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) libhubbub --libs) + else + LDFLAGS := $(LDFLAGS) -lhubbub -lparserutils + endif +endif -# Debug output -DEBUG = ${TOP}/${COMPONENT}-libhubbub-debug.a - -# Objects -OBJS = parser - -.PHONY: clean debug distclean export release setup test - -# Targets -release: $(addprefix Release/, $(addsuffix .o, $(OBJS))) - @${AR} ${ARFLAGS} $(RELEASE) Release/* - -debug: $(addprefix Debug/, $(addsuffix .o, $(OBJS))) - @${AR} ${ARFLAGS} $(DEBUG) Debug/* - -clean: - -@${RM} ${RMFLAGS} $(addprefix Release/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(addprefix Debug/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(RELEASE) $(DEBUG) - -distclean: - -@${RM} ${RMFLAGS} -r Release - -@${RM} ${RMFLAGS} -r Debug - -setup: - @${MKDIR} ${MKDIRFLAGS} Release - @${MKDIR} ${MKDIRFLAGS} Debug - -export: - @${CP} ${CPFLAGS} $(RELEASE) ${EXPORT}/lib/ - -test: - -# Pattern rules -Release/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c ${CFLAGS} -DNDEBUG -o $@ $< - -Debug/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@ $< +include build/makefiles/Makefile.subdir diff --git a/bindings/xml/Makefile b/bindings/xml/Makefile index b5b9757..bdebe41 100644 --- a/bindings/xml/Makefile +++ b/bindings/xml/Makefile @@ -1,69 +1,16 @@ -# Makefile for libdom -# -# Toolchain is exported by top-level makefile -# -# Top-level makefile also exports the following variables: -# -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root -# -# The top-level makefile requires the following targets to exist: -# -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases +ifeq ($(WITH_LIBXML_BINDING),yes) + DIR_SOURCES := xmlbinding.c xmlparser.c -# Manipulate include paths -CFLAGS += -I$(CURDIR) \ - `${PKGCONFIG} ${PKGCONFIGFLAGS} --cflags libxml-2.0` \ - -D_POSIX_C_SOURCE + DIR_INSTALL_ITEMS := /include/dom/bindings/libxml:xmlbinding.h;xmlerror.h;xmlparser.h -# Release output -RELEASE = ${TOP}/${COMPONENT}-libxml.a + # LibXML2 + ifneq ($(PKGCONFIG),) + CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) libxml-2.0 --cflags) + LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) libxml-2.0 --libs) + else + LDFLAGS := $(LDFLAGS) -lxml2 + endif +endif -# Debug output -DEBUG = ${TOP}/${COMPONENT}-libxml-debug.a +include build/makefiles/Makefile.subdir -# Objects -OBJS = xmlbinding xmlparser - -.PHONY: clean debug distclean export release setup test - -# Targets -release: $(addprefix Release/, $(addsuffix .o, $(OBJS))) - @${AR} ${ARFLAGS} $(RELEASE) Release/* - -debug: $(addprefix Debug/, $(addsuffix .o, $(OBJS))) - @${AR} ${ARFLAGS} $(DEBUG) Debug/* - -clean: - -@${RM} ${RMFLAGS} $(addprefix Release/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(addprefix Debug/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(RELEASE) $(DEBUG) - -distclean: - -@${RM} ${RMFLAGS} -r Release - -@${RM} ${RMFLAGS} -r Debug - -setup: - @${MKDIR} ${MKDIRFLAGS} Release - @${MKDIR} ${MKDIRFLAGS} Debug - -export: - @${CP} ${CPFLAGS} $(RELEASE) ${EXPORT}/lib/ - -test: - -# Pattern rules -Release/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c ${CFLAGS} -DNDEBUG -o $@ $< - -Debug/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@ $< diff --git a/build/Makefile.common b/build/Makefile.common deleted file mode 100644 index c445a4c..0000000 --- a/build/Makefile.common +++ /dev/null @@ -1,45 +0,0 @@ -# Top-level Makefile fragment for DOM library - -# Name of component -export COMPONENT = libdom - -# Environment -export EXPORT = $(CURDIR)/dist -export TOP = $(CURDIR) - -.PHONY: release debug test clean setup export distclean - -# Rules -release: setup - @$(MAKE) $(MAKEFLAGS) -C bindings release - @$(MAKE) $(MAKEFLAGS) -C src release - -debug: setup - @$(MAKE) $(MAKEFLAGS) -C bindings debug - @$(MAKE) $(MAKEFLAGS) -C src debug - -test: debug - @$(MAKE) $(MAKEFLAGS) -C test test - -clean: - @$(MAKE) $(MAKEFLAGS) -C bindings clean - @$(MAKE) $(MAKEFLAGS) -C src clean - @$(MAKE) $(MAKEFLAGS) -C test clean - -setup: - @$(MAKE) $(MAKEFLAGS) -C bindings setup - @$(MAKE) $(MAKEFLAGS) -C src setup - @$(MAKE) $(MAKEFLAGS) -C test setup - -export: release - @$(MKDIR) $(MKDIRFLAGS) $(TOP)/dist/lib - @$(CP) $(CPFLAGS) -r include $(EXPORT)/ - @$(MAKE) $(MAKEFLAGS) -C bindings export - @$(MAKE) $(MAKEFLAGS) -C src export - @$(MAKE) $(MAKEFLAGS) -C test export - -distclean: clean - -@$(RM) $(RMFLAGS) -r $(TOP)/dist - @$(MAKE) $(MAKEFLAGS) -C bindings distclean - @$(MAKE) $(MAKEFLAGS) -C src distclean - @$(MAKE) $(MAKEFLAGS) -C test distclean diff --git a/src/Makefile b/src/Makefile index 6c780a4..3cbaf86 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,78 +1,2 @@ -# Makefile for libdom -# -# Toolchain is exported by top-level makefile -# -# Top-level makefile also exports the following variables: -# -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root -# -# The top-level makefile requires the following targets to exist: -# -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases -# Manipulate include paths -CFLAGS += -I$(CURDIR) - -# Release output -RELEASE = ${TOP}/${COMPONENT}.a - -# Debug output -DEBUG = ${TOP}/${COMPONENT}-debug.a - -# Objects -OBJS = - -.PHONY: clean debug distclean export release setup test - -# Targets -release: $(addprefix Release/, $(addsuffix .o, $(OBJS))) - @${MAKE} -C bootstrap release - @${MAKE} -C core release - @${MAKE} -C utils release - @${AR} ${ARFLAGS} $(RELEASE) Release/* - -debug: $(addprefix Debug/, $(addsuffix .o, $(OBJS))) - @${MAKE} -C bootstrap debug - @${MAKE} -C core debug - @${MAKE} -C utils debug - @${AR} ${ARFLAGS} $(DEBUG) Debug/* - -clean: - @${MAKE} -C bootstrap clean - @${MAKE} -C core clean - @${MAKE} -C utils clean -ifneq (${OBJS}, ) - -@${RM} ${RMFLAGS} $(addprefix Release/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(addprefix Debug/, $(addsuffix .o, ${OBJS})) -endif - -@${RM} ${RMFLAGS} $(RELEASE) $(DEBUG) - -distclean: - -@${RM} ${RMFLAGS} -r Release - -@${RM} ${RMFLAGS} -r Debug - -setup: - @${MKDIR} ${MKDIRFLAGS} Release - @${MKDIR} ${MKDIRFLAGS} Debug - -export: - @${CP} ${CPFLAGS} $(RELEASE) ${EXPORT}/lib/ - -test: - -# Pattern rules -Release/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c ${CFLAGS} -DNDEBUG -o $@ $< - -Debug/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@ $< +include build/makefiles/Makefile.subdir diff --git a/src/bootstrap/Makefile b/src/bootstrap/Makefile index 0eed6c7..820a4f4 100644 --- a/src/bootstrap/Makefile +++ b/src/bootstrap/Makefile @@ -1,53 +1,3 @@ -# Makefile for libdom -# -# Toolchain is exported by top-level makefile -# -# Top-level makefile also exports the following variables: -# -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root -# -# The top-level makefile requires the following targets to exist: -# -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases +DIR_SOURCES := implregistry.c init_fini.c -# Manipulate include paths -CFLAGS += -I$(CURDIR) - -# Objects -OBJS = implregistry init_fini - -.PHONY: clean debug distclean export release setup test - -# Targets -release: $(addprefix ../Release/, $(addsuffix .o, $(OBJS))) - -debug: $(addprefix ../Debug/, $(addsuffix .o, $(OBJS))) - -clean: - -@${RM} ${RMFLAGS} $(addprefix ../Release/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(addprefix ../Debug/, $(addsuffix .o, ${OBJS})) - -distclean: - -setup: - -export: - -test: - -# Pattern rules -../Release/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c ${CFLAGS} -DNDEBUG -o $@ $< - -../Debug/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@ $< +include build/makefiles/Makefile.subdir diff --git a/src/core/Makefile b/src/core/Makefile index 3084012..9abadad 100644 --- a/src/core/Makefile +++ b/src/core/Makefile @@ -1,57 +1,8 @@ -# Makefile for libdom -# -# Toolchain is exported by top-level makefile -# -# Top-level makefile also exports the following variables: -# -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root -# -# The top-level makefile requires the following targets to exist: -# -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases - -# Manipulate include paths -CFLAGS += -I$(CURDIR) - -# Objects -OBJS = attr cdatasection characterdata comment \ - document document_type doc_fragment \ - element entity_ref implementation impllist \ - namednodemap node nodelist \ - pi string text - -.PHONY: clean debug distclean export release setup test - -# Targets -release: $(addprefix ../Release/, $(addsuffix .o, $(OBJS))) - -debug: $(addprefix ../Debug/, $(addsuffix .o, $(OBJS))) - -clean: - -@${RM} ${RMFLAGS} $(addprefix ../Release/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(addprefix ../Debug/, $(addsuffix .o, ${OBJS})) - -distclean: - -setup: - -export: - -test: - -# Pattern rules -../Release/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c ${CFLAGS} -DNDEBUG -o $@ $< - -../Debug/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@ $< +# Sources +DIR_SOURCES := attr.c cdatasection.c characterdata.c comment.c \ + document.c document_type.c doc_fragment.c \ + element.c entity_ref.c implementation.c impllist.c \ + namednodemap.c node.c nodelist.c \ + pi.c string.c text.c + +include build/makefiles/Makefile.subdir diff --git a/src/utils/Makefile b/src/utils/Makefile index 29369ae..c80f261 100644 --- a/src/utils/Makefile +++ b/src/utils/Makefile @@ -1,53 +1,4 @@ -# Makefile for libdom -# -# Toolchain is exported by top-level makefile -# -# Top-level makefile also exports the following variables: -# -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root -# -# The top-level makefile requires the following targets to exist: -# -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases +# Sources +DIR_SOURCES := namespace.c -# Manipulate include paths -CFLAGS += -I$(CURDIR) - -# Objects -OBJS = namespace - -.PHONY: clean debug distclean export release setup test - -# Targets -release: $(addprefix ../Release/, $(addsuffix .o, $(OBJS))) - -debug: $(addprefix ../Debug/, $(addsuffix .o, $(OBJS))) - -clean: - -@${RM} ${RMFLAGS} $(addprefix ../Release/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(addprefix ../Debug/, $(addsuffix .o, ${OBJS})) - -distclean: - -setup: - -export: - -test: - -# Pattern rules -../Release/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c ${CFLAGS} -DNDEBUG -o $@ $< - -../Debug/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@ $< +include build/makefiles/Makefile.subdir diff --git a/test/Makefile b/test/Makefile index 0fb57d9..b320a61 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,96 +1,31 @@ -# Makefile for DOM testcases -# -# Toolchain is exported by top-level makefile -# -# Top-level makefile also exports the following variables: -# -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root -# -# The top-level makefile requires the following targets to exist: -# -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases - -# Extend toolchain settings -CFLAGS += -I${TOP}/src/ -I${TOP}/bindings/xml/ -I${TOP}/bindings/hubbub/ \ - -I$(CURDIR) -LDFLAGS += `${PKGCONFIG} ${PKGCONFIGFLAGS} --libs libxml-2.0 libhubbub` - -# Libraries we link against -LIBS = -L./lib -ldomtest-debug -ldom-libxml-debug \ - -ldom-libhubbub-debug -ldom-debug +testlib_files := lib/comparators.c;lib/list.c;lib/testassert.c; +testlib_files := $(testlib_files);lib/testobject.c;lib/utils.c -# Release output -RELEASE = +DIR_TEST_ITEMS := binding:binding.c;$(testlib_files) \ + test-list:test-list.c;$(testlib_files) -# Debug output -DEBUG = +include build/makefiles/Makefile.subdir +# TODO: XML suite +# # Transformer input -XMLFILES = $(wildcard xml/tests/*.xml) - +#XMLFILES = $(wildcard xml/tests/*.xml) +# # Transformer output -CFILES = $(addprefix xml/c/, $(notdir $(XMLFILES:.xml=.c))) - +#CFILES = $(addprefix xml/c/, $(notdir $(XMLFILES:.xml=.c))) +# # Objects -XMLOBJS = $(addprefix xml/bin/, $(notdir $(XMLFILES:.xml=))) -OTHEROBJS = binding test-list -OBJS = $(OTHEROBJS) $(XMLOBJS) - -.PHONY: clean debug export release setup test transform - -# Targets -release: - @${MAKE} -C lib release - -debug: - @${MAKE} -C lib debug - -clean: - @${MAKE} -C lib clean -ifneq (${OBJS}, ) - -@${RM} ${RMFLAGS} $(addsuffix ${EXEEXT}, $(OTHEROBJS)) - -@${RM} ${RMFLAGS} -r xml/c/ - -@${RM} ${RMFLAGS} -r xml/bin/ -endif - -distclean: - @${MAKE} -C lib distclean - -@${RM} ${RMFLAGS} log - -setup: - @${MAKE} -C lib setup - @${MKDIR} ${MKDIRFLAGS} $(CURDIR)/xml/c - @${MKDIR} ${MKDIRFLAGS} $(CURDIR)/xml/bin - -export: - @${MAKE} -C lib export - -test: release debug $(OBJS) - @${PERL} testrunner.pl ${EXEEXT} - -transform: $(CFILES) - +#XMLOBJS = $(addprefix xml/bin/, $(notdir $(XMLFILES:.xml=))) +# +#transform: $(CFILES) +# # Pattern rules -xml/bin/%: xml/c/%.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@.o $< - @${LD} -g -o $@ $@.o ${LDFLAGS} $(LIBS) - @${RM} ${RMFLAGS} $@.o - -xml/c/%.c: xml/tests/%.xml - @${XSLT} ${XSLTFLAGS} -o $@ transform/test-to-c.xsl $< - -%: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@.o $< - @${LD} -g -o $@ $@.o $(LIBS) ${LDFLAGS} - @${RM} ${RMFLAGS} $@.o +#xml/bin/%: xml/c/%.c +# @${ECHO} ${ECHOFLAGS} "==> $<" +# @${CC} -c -g ${CFLAGS} -o $@.o $< +# @${LD} -g -o $@ $@.o ${LDFLAGS} $(LIBS) +# @${RM} ${RMFLAGS} $@.o +# +#xml/c/%.c: xml/tests/%.xml +# @${XSLT} ${XSLTFLAGS} -o $@ transform/test-to-c.xsl $< diff --git a/test/lib/Makefile b/test/lib/Makefile deleted file mode 100644 index 78e6bff..0000000 --- a/test/lib/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# Makefile for DOM testcase utility library -# -# Toolchain is exported by top-level makefile -# -# Top-level makefile also exports the following variables: -# -# COMPONENT Name of component -# EXPORT Absolute path of export directory -# TOP Absolute path of source tree root -# -# The top-level makefile requires the following targets to exist: -# -# clean Clean source tree -# debug Create a debug binary -# distclean Fully clean source tree, back to pristine condition -# export Export distributable components to ${EXPORT} -# release Create a release binary -# setup Perform any setup required prior to compilation -# test Execute any test cases - -# Manipulate include paths -CFLAGS += -I$(TOP) -I$(CURDIR) - -# Release output -RELEASE = libdomtest.a - -# Debug output -DEBUG = libdomtest-debug.a - -# Objects -OBJS = comparators list testassert testobject utils - -.PHONY: clean debug export release setup test - -# Targets -release: $(addprefix Release/, $(addsuffix .o, $(OBJS))) - @${AR} ${ARFLAGS} $(RELEASE) Release/* - -debug: $(addprefix Debug/, $(addsuffix .o, $(OBJS))) - @${AR} ${ARFLAGS} $(DEBUG) Debug/* - -clean: -ifneq (${OBJS}, ) - -@${RM} ${RMFLAGS} $(addprefix Release/, $(addsuffix .o, ${OBJS})) - -@${RM} ${RMFLAGS} $(addprefix Debug/, $(addsuffix .o, ${OBJS})) -endif - -@${RM} ${RMFLAGS} $(RELEASE) $(DEBUG) - -distclean: - -@${RM} ${RMFLAGS} -r Release - -@${RM} ${RMFLAGS} -r Debug - -setup: - @${MKDIR} ${MKDIRFLAGS} Release - @${MKDIR} ${MKDIRFLAGS} Debug - -export: - -test: - -# Pattern rules -Release/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c ${CFLAGS} -DNDEBUG -o $@ $< - -Debug/%.o: %.c - @${ECHO} ${ECHOFLAGS} "==> $<" - @${CC} -c -g ${CFLAGS} -o $@ $< - -- cgit v1.2.3