aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-02-25 12:07:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-02-25 12:07:33 +0200
commit2ef165437ce47f50110a9b230f302c5cd5fde1d4 (patch)
treeb1b7c14b9b264e8571ec37c3098c8763ef655ca2
parent10d9fed7123cdc7fd9287d2cf6fea8c40c2402a0 (diff)
Add support for examples in subdirectories
Move the schema example to schema/custom.
-rw-r--r--README2
-rw-r--r--boost/makefile2
-rw-r--r--composite/makefile2
-rw-r--r--container/makefile2
-rw-r--r--hello/makefile2
-rw-r--r--inverse/makefile2
-rw-r--r--makefile2
-rw-r--r--mapping/makefile2
-rw-r--r--query/makefile2
-rw-r--r--relationship/makefile2
-rw-r--r--schema/custom/README (renamed from schema/README)0
-rw-r--r--schema/custom/database.hxx (renamed from schema/database.hxx)2
-rw-r--r--schema/custom/driver.cxx (renamed from schema/driver.cxx)2
-rw-r--r--schema/custom/employee.hxx (renamed from schema/employee.hxx)2
-rw-r--r--schema/custom/makefile (renamed from schema/makefile)13
-rw-r--r--template/makefile2
16 files changed, 20 insertions, 21 deletions
diff --git a/README b/README
index ebbb243..87c5ff5 100644
--- a/README
+++ b/README
@@ -36,7 +36,7 @@ boost
Shows how to persist objects that use Boost smart pointers, containers,
and value types with the help of the Boost profile library (libodb-boost).
-schema
+schema/custom
Shows how to map persistent C++ classes to a custom database schema.
mapping
diff --git a/boost/makefile b/boost/makefile
index 5d7e0e2..a6c3517 100644
--- a/boost/makefile
+++ b/boost/makefile
@@ -76,7 +76,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
diff --git a/composite/makefile b/composite/makefile
index dcaeb82..4f12b40 100644
--- a/composite/makefile
+++ b/composite/makefile
@@ -63,7 +63,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
diff --git a/container/makefile b/container/makefile
index fc13437..ff2eab8 100644
--- a/container/makefile
+++ b/container/makefile
@@ -62,7 +62,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
diff --git a/hello/makefile b/hello/makefile
index c770a19..c978ff7 100644
--- a/hello/makefile
+++ b/hello/makefile
@@ -63,7 +63,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
diff --git a/inverse/makefile b/inverse/makefile
index b56754e..e6c5a05 100644
--- a/inverse/makefile
+++ b/inverse/makefile
@@ -63,7 +63,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
diff --git a/makefile b/makefile
index aa62968..b5737d0 100644
--- a/makefile
+++ b/makefile
@@ -6,7 +6,7 @@
include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make
dirs := composite container hello query mapping
-tr1_dirs := relationship inverse schema
+tr1_dirs := relationship inverse schema/custom
boost_dirs := boost
dist_dirs := $(dirs) $(tr1_dirs) $(boost_dirs)
diff --git a/mapping/makefile b/mapping/makefile
index 77a4b11..f90e4a7 100644
--- a/mapping/makefile
+++ b/mapping/makefile
@@ -63,7 +63,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
diff --git a/query/makefile b/query/makefile
index 560555c..c4a9627 100644
--- a/query/makefile
+++ b/query/makefile
@@ -63,7 +63,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
diff --git a/relationship/makefile b/relationship/makefile
index 56a7734..b879201 100644
--- a/relationship/makefile
+++ b/relationship/makefile
@@ -63,7 +63,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
diff --git a/schema/README b/schema/custom/README
index 373169f..373169f 100644
--- a/schema/README
+++ b/schema/custom/README
diff --git a/schema/database.hxx b/schema/custom/database.hxx
index 8e27e16..88536ab 100644
--- a/schema/database.hxx
+++ b/schema/custom/database.hxx
@@ -1,4 +1,4 @@
-// file : schema/database.hxx
+// file : schema/custom/database.hxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain
diff --git a/schema/driver.cxx b/schema/custom/driver.cxx
index 3f36f03..3e49c72 100644
--- a/schema/driver.cxx
+++ b/schema/custom/driver.cxx
@@ -1,4 +1,4 @@
-// file : schema/driver.cxx
+// file : schema/custom/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain
diff --git a/schema/employee.hxx b/schema/custom/employee.hxx
index 25f8d8f..742ad42 100644
--- a/schema/employee.hxx
+++ b/schema/custom/employee.hxx
@@ -1,4 +1,4 @@
-// file : schema/employee.hxx
+// file : schema/custom/employee.hxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain
diff --git a/schema/makefile b/schema/custom/makefile
index ed5114e..e03c31c 100644
--- a/schema/makefile
+++ b/schema/custom/makefile
@@ -1,9 +1,9 @@
-# file : schema/makefile
+# file : schema/custom/makefile
# author : Boris Kolpackov <boris@codesynthesis.com>
# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
# license : GNU GPL v2; see accompanying LICENSE file
-include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make
+include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make
cxx_tun := driver.cxx
odb_hdr := employee.hxx
@@ -63,7 +63,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
@@ -74,13 +74,12 @@ $(dist): export extra_dist := README $(call vc9projs,$(name)) \
$(call vc10projs,$(name))
$(dist):
$(call dist-data,$(sources) $(headers) README database.hxx)
- $(call meta-automake,../template/Makefile.am)
- $(call meta-vc9projs,../template/template,$(name))
- $(call meta-vc10projs,../template/template,$(name))
+ $(call meta-automake,../../template/Makefile.am)
+ $(call meta-vc9projs,../../template/template,$(name))
+ $(call meta-vc10projs,../../template/template,$(name))
# Test.
#
-$(test): schema := $(src_base)/$(basename $(odb_hdr)).sql
$(test): $(driver)
$(call message,test $<,$< --options-file $(dcf_root)/db.options)
diff --git a/template/makefile b/template/makefile
index e2f9ee5..44f393a 100644
--- a/template/makefile
+++ b/template/makefile
@@ -62,7 +62,7 @@ $(out_base)/: $(driver)
# Dist
#
-name := $(notdir $(src_base))
+name := $(subst /,-,$(subst $(src_root)/,,$(src_base)))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)