aboutsummaryrefslogtreecommitdiff
path: root/dist/examples
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-03-16 08:16:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-03-16 08:16:43 +0200
commitbce9d5a76072ec697ef69021818aa68709036da5 (patch)
tree9ec56eff60abacaea121d1602a1e48388ca34216 /dist/examples
parentbe19f3aae4e16b4dc9c980cb9b53e807616662ef (diff)
Add support for type customization in C++/Hybrid
examples/cxx/hybrid/custom/wildcard/: new example
Diffstat (limited to 'dist/examples')
-rw-r--r--dist/examples/cxx/hybrid/custom/makefile25
-rw-r--r--dist/examples/cxx/hybrid/custom/nmakefile21
-rw-r--r--dist/examples/cxx/hybrid/custom/wildcard/makefile56
-rw-r--r--dist/examples/cxx/hybrid/custom/wildcard/nmakefile53
-rw-r--r--dist/examples/cxx/hybrid/custom/wildcard/options8
-rw-r--r--dist/examples/cxx/hybrid/makefile2
-rw-r--r--dist/examples/cxx/hybrid/nmakefile2
7 files changed, 165 insertions, 2 deletions
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"
diff --git a/dist/examples/cxx/hybrid/makefile b/dist/examples/cxx/hybrid/makefile
index 38ccd04..11af66b 100644
--- a/dist/examples/cxx/hybrid/makefile
+++ b/dist/examples/cxx/hybrid/makefile
@@ -2,7 +2,7 @@ root := ../../..
include $(root)/build/config.make
-dirs := binary compositors
+dirs := binary compositors custom
ifeq ($(XSDE_IOSTREAM),y)
ifeq ($(XSDE_EXCEPTIONS),y)
diff --git a/dist/examples/cxx/hybrid/nmakefile b/dist/examples/cxx/hybrid/nmakefile
index 5d0b337..d9d791c 100644
--- a/dist/examples/cxx/hybrid/nmakefile
+++ b/dist/examples/cxx/hybrid/nmakefile
@@ -2,7 +2,7 @@ root = ..\..\..
!include $(root)\build\config.nmake
-dirs = compositors
+dirs = binary compositors custom
!if "$(XSDE_IOSTREAM)" == "y"
!if "$(XSDE_EXCEPTIONS)" == "y"