From bce9d5a76072ec697ef69021818aa68709036da5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Mar 2009 08:16:43 +0200 Subject: Add support for type customization in C++/Hybrid examples/cxx/hybrid/custom/wildcard/: new example --- dist/examples/cxx/hybrid/custom/makefile | 25 ++++++++++ dist/examples/cxx/hybrid/custom/nmakefile | 21 ++++++++ dist/examples/cxx/hybrid/custom/wildcard/makefile | 56 ++++++++++++++++++++++ dist/examples/cxx/hybrid/custom/wildcard/nmakefile | 53 ++++++++++++++++++++ dist/examples/cxx/hybrid/custom/wildcard/options | 8 ++++ 5 files changed, 163 insertions(+) create mode 100644 dist/examples/cxx/hybrid/custom/makefile create mode 100644 dist/examples/cxx/hybrid/custom/nmakefile create mode 100644 dist/examples/cxx/hybrid/custom/wildcard/makefile create mode 100644 dist/examples/cxx/hybrid/custom/wildcard/nmakefile create mode 100644 dist/examples/cxx/hybrid/custom/wildcard/options (limited to 'dist/examples/cxx/hybrid/custom') diff --git a/dist/examples/cxx/hybrid/custom/makefile b/dist/examples/cxx/hybrid/custom/makefile new file mode 100644 index 0000000..029327d --- /dev/null +++ b/dist/examples/cxx/hybrid/custom/makefile @@ -0,0 +1,25 @@ +root := ../../../.. + +include $(root)/build/config.make + +dirs := + +ifeq ($(XSDE_IOSTREAM),y) +ifeq ($(XSDE_EXCEPTIONS),y) + +dirs += wildcard + +endif +endif + +.PHONY: all $(dirs) + +all: $(dirs) + +$(dirs): + @$(MAKE) -C $@ $(MAKECMDGOALS) + +makefile: ; +%.make:: ; + +%:: $(dirs) ; diff --git a/dist/examples/cxx/hybrid/custom/nmakefile b/dist/examples/cxx/hybrid/custom/nmakefile new file mode 100644 index 0000000..df8ad08 --- /dev/null +++ b/dist/examples/cxx/hybrid/custom/nmakefile @@ -0,0 +1,21 @@ +root = ..\..\..\.. + +!include $(root)\build\config.nmake + +dirs = + +!if "$(XSDE_IOSTREAM)" == "y" +!if "$(XSDE_EXCEPTIONS)" == "y" + +dirs = $(dirs) wildcard + +!endif +!endif + +all: + @for %i in ( $(dirs) ) do \ +@cmd /c "cd %i & $(MAKE) /nologo /f nmakefile" + +test clean: + @for %i in ( $(dirs) ) do \ +@cmd /c "cd %i & $(MAKE) /nologo /f nmakefile $@" diff --git a/dist/examples/cxx/hybrid/custom/wildcard/makefile b/dist/examples/cxx/hybrid/custom/wildcard/makefile new file mode 100644 index 0000000..e0a881d --- /dev/null +++ b/dist/examples/cxx/hybrid/custom/wildcard/makefile @@ -0,0 +1,56 @@ +root := ../../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS := -I$(root)/libxsde + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-validation +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +EXTRA_XSDFLAGS += --reuse-style-mixin +endif + +driver: driver.o email.o body.o email-pskel.o email-pimpl.o \ +email-sskel.o email-simpl.o envelope-pimpl.o envelope-simpl.o \ +$(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx email.hxx envelope.hxx body.hxx email-pimpl.hxx email-simpl.hxx +email.o: email.cxx email.hxx envelope.hxx +body.o: body.cxx body.hxx email.hxx +email-pskel.o: email-pskel.cxx +email-pimpl.o: email-pimpl.cxx +email-simpl.o: email-simpl.cxx +email-simpl.o: email-simpl.cxx +envelope-pimpl.o: envelope-pimpl.cxx envelope-pimpl.hxx email.hxx body.hxx +envelope-simpl.o: envelope-simpl.cxx envelope-simpl.hxx email.hxx body.hxx + +.PRECIOUS: %.hxx %.cxx %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx \ +%-sskel.hxx %-sskel.cxx %-simpl.hxx %-simpl.cxx + +%.hxx %.cxx %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx \ +%-sskel.hxx %-sskel.cxx %-simpl.hxx %-simpl.cxx: %.xsd + $(root)/bin/xsde cxx-hybrid $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--options-file options $< + +# Test. +# +.PHONY: test +test: driver email.xml + ./driver email.xml + +# Clean. +# +.PHONY: clean +clean: + rm -f email-pimpl.?xx email-pskel.?xx email-simpl.?xx \ +email-sskel.?xx email.?xx envelope-pimpl.o envelope-simpl.o \ +email-pimpl.o email-pskel.o email-simpl.o email-sskel.o \ +body.o email.o driver.o driver diff --git a/dist/examples/cxx/hybrid/custom/wildcard/nmakefile b/dist/examples/cxx/hybrid/custom/wildcard/nmakefile new file mode 100644 index 0000000..0a88820 --- /dev/null +++ b/dist/examples/cxx/hybrid/custom/wildcard/nmakefile @@ -0,0 +1,53 @@ +root = ..\..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-validation +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin +!endif + +driver.exe: driver.obj email.obj body.obj email-pskel.obj email-pimpl.obj \ +email-sskel.obj email-simpl.obj envelope-pimpl.obj envelope-simpl.obj \ +$(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx email.hxx envelope.hxx body.hxx email-pimpl.hxx email-simpl.hxx +email.obj: email.cxx email.hxx envelope.hxx +body.obj: body.cxx body.hxx email.hxx +email-pskel.obj: email-pskel.cxx +email-pimpl.obj: email-pimpl.cxx +email-simpl.obj: email-simpl.cxx +email-simpl.obj: email-simpl.cxx +envelope-pimpl.obj: envelope-pimpl.cxx envelope-pimpl.hxx email.hxx body.hxx +envelope-simpl.obj: envelope-simpl.cxx envelope-simpl.hxx email.hxx body.hxx + +email.cxx email.hxx \ +email-pskel.cxx email-pskel.hxx email-pimpl.cxx email-pimpl.hxx \ +email-sskel.cxx email-sskel.hxx email-simpl.cxx email-simpl.hxx \ +: email.xsd + $(root)\bin\xsde.exe cxx-hybrid $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--options-file options email.xsd + +# Test. +# +test: driver.exe email.xml + .\driver.exe email.xml + +# Clean. +# +clean: + -del email-pimpl.?xx email-pskel.?xx email-simpl.?xx \ +email-sskel.?xx email.?xx envelope-pimpl.obj envelope-simpl.obj \ +email-pimpl.obj email-pskel.obj email-simpl.obj email-sskel.obj \ +body.obj email.obj driver.obj driver.exe diff --git a/dist/examples/cxx/hybrid/custom/wildcard/options b/dist/examples/cxx/hybrid/custom/wildcard/options new file mode 100644 index 0000000..688bf0c --- /dev/null +++ b/dist/examples/cxx/hybrid/custom/wildcard/options @@ -0,0 +1,8 @@ +--generate-parser +--generate-serializer +--generate-aggregate +--root-element-all +--custom-type envelope=v//envelope_base/envelope.hxx +--custom-parser envelope=envelope_base_pimpl/envelope-pimpl.hxx +--custom-serializer envelope=envelope_base_simpl/envelope-simpl.hxx +--hxx-epilogue #include "body.hxx" -- cgit v1.1