summaryrefslogtreecommitdiff
path: root/examples/cxx/tree/binary/xdr
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-17 18:56:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-17 18:56:22 +0200
commitc34af468acc94691d0a5954eae38a89506bc620e (patch)
tree828e27a83547c0c12fa54512e12285d680f805f3 /examples/cxx/tree/binary/xdr
parentb3ede28237491c6c5ce2338d4f552d095f9430d6 (diff)
Generate .gitignore in compiler, test and example makefiles
Diffstat (limited to 'examples/cxx/tree/binary/xdr')
-rw-r--r--examples/cxx/tree/binary/xdr/makefile40
1 files changed, 19 insertions, 21 deletions
diff --git a/examples/cxx/tree/binary/xdr/makefile b/examples/cxx/tree/binary/xdr/makefile
index 6414fe9..cd61637 100644
--- a/examples/cxx/tree/binary/xdr/makefile
+++ b/examples/cxx/tree/binary/xdr/makefile
@@ -14,39 +14,26 @@ dep := $(obj:.o=.o.d)
driver := $(out_base)/driver
clean := $(out_base)/.clean
-
# Import.
#
$(call import,\
$(scf_root)/import/libxerces-c/stub.make,\
l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
-$(call import,\
- $(scf_root)/import/libace/stub.make,\
- l: ace.l,cpp-options: ace.l.cpp-options)
-
-
# Build.
#
-$(driver): $(obj) $(xerces_c.l) $(ace.l) -lnsl
+$(driver): $(obj) $(xerces_c.l) -lnsl
$(obj) $(dep): cpp_options := -I$(src_root)/libxsd
-$(obj) $(dep): $(xerces_c.l.cpp-options) $(ace.l.cpp-options)
+$(obj) $(dep): $(xerces_c.l.cpp-options)
-$(out_base)/$(xsd:.xsd=.hxx) \
-$(out_base)/$(xsd:.xsd=.ixx) \
-$(out_base)/$(xsd:.xsd=.cxx): xsd := $(out_root)/xsd/xsd
+genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx)
+gen := $(addprefix $(out_base)/,$(genf))
-$(out_base)/$(xsd:.xsd=.hxx) \
-$(out_base)/$(xsd:.xsd=.ixx) \
-$(out_base)/$(xsd:.xsd=.cxx): xsd_options := \
---generate-ostream \
---generate-insertion XDR \
---generate-extraction XDR
-
-$(out_base)/$(xsd:.xsd=.hxx) \
-$(out_base)/$(xsd:.xsd=.ixx) \
-$(out_base)/$(xsd:.xsd=.cxx): $(out_root)/xsd/xsd
+$(gen): xsd := $(out_root)/xsd/xsd
+$(gen): xsd_options := --generate-ostream \
+--generate-insertion XDR --generate-extraction XDR
+$(gen): $(out_root)/xsd/xsd
$(call include-dep,$(dep))
@@ -65,6 +52,17 @@ $(clean): $(driver).o.clean \
$(addsuffix .cxx.clean,$(dep)) \
$(addprefix $(out_base)/,$(xsd:.xsd=.cxx.xsd.clean))
+# Generated .gitignore.
+#
+ifeq ($(out_base),$(src_base))
+$(gen): | $(out_base)/.gitignore
+$(driver): | $(out_base)/.gitignore
+
+$(out_base)/.gitignore: files := driver $(genf)
+$(clean): $(out_base)/.gitignore.clean
+
+$(call include,$(bld_root)/git/gitignore.make)
+endif
# How to.
#