Imported Upstream version 2.35.3
[platform/upstream/libxml++.git] / examples / Makefile.am
1 ## Copyright (C) 2012 The libxml++ development team
2 ##
3 ## This file is part of libxml++.
4 ##
5 ## This library is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU Lesser General Public
7 ## License as published by the Free Software Foundation; either
8 ## version 2.1 of the License, or (at your option) any later version.
9 ##
10 ## This library is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 ## Lesser General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU Lesser General Public
16 ## License along with this library. If not, see <http://www.gnu.org/licenses/>.
17
18 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I. $(LIBXMLXX_CFLAGS)
19 AM_CXXFLAGS = $(LIBXMLXX_WXXFLAGS)
20 LDADD = $(top_builddir)/libxml++/libxml++-$(LIBXMLXX_API_VERSION).la $(LIBXMLXX_LIBS)
21
22 check_PROGRAMS = \
23   dom_build/dom_build \
24   dom_parse_entities/dom_parse_entities \
25   dom_parser/dom_parser \
26   dom_parser_raw/dom_parser_raw \
27   dom_read_write/dom_read_write \
28   dom_xpath/dom_xpath \
29   dtdvalidation/dtdvalidation \
30   import_node/import_node \
31   sax_exception/sax_exception \
32   sax_parser/sax_parser \
33   sax_parser_build_dom/sax_parser_build_dom \
34   sax_parser_entities/sax_parser_entities \
35   schemavalidation/schemavalidation \
36   textreader/textreader
37
38 # Shell scripts that call the example programs.
39 check_SCRIPTS = $(addsuffix make-check-sh,$(dir $(check_PROGRAMS)))
40 TESTS = $(check_SCRIPTS)
41
42 dom_build_dom_build_SOURCES = \
43   dom_build/main.cc
44 dom_parse_entities_dom_parse_entities_SOURCES = \
45   dom_parse_entities/main.cc
46 dom_parser_dom_parser_SOURCES = \
47   dom_parser/main.cc
48 dom_parser_raw_dom_parser_raw_SOURCES = \
49   dom_parser_raw/main.cc
50 dom_read_write_dom_read_write_SOURCES = \
51   dom_read_write/main.cc
52 dom_xpath_dom_xpath_SOURCES = \
53   dom_xpath/main.cc
54 dtdvalidation_dtdvalidation_SOURCES = \
55   dtdvalidation/main.cc
56 import_node_import_node_SOURCES = \
57   import_node/main.cc
58 sax_exception_sax_exception_SOURCES = \
59   sax_exception/main.cc \
60   sax_exception/myparser.cc \
61   sax_exception/myparser.h
62 sax_parser_sax_parser_SOURCES = \
63   sax_parser/main.cc \
64   sax_parser/myparser.cc \
65   sax_parser/myparser.h
66 sax_parser_build_dom_sax_parser_build_dom_SOURCES = \
67   sax_parser_build_dom/main.cc \
68   sax_parser_build_dom/svgparser.cc \
69   sax_parser_build_dom/svgparser.h \
70   sax_parser_build_dom/svgdocument.cc \
71   sax_parser_build_dom/svgdocument.h \
72   sax_parser_build_dom/svgelement.cc \
73   sax_parser_build_dom/svgelement.h \
74   sax_parser_build_dom/svgpath.h \
75   sax_parser_build_dom/svggroup.h
76 sax_parser_entities_sax_parser_entities_SOURCES = \
77   sax_parser_entities/main.cc \
78   sax_parser_entities/myparser.cc \
79   sax_parser_entities/myparser.h
80 schemavalidation_schemavalidation_SOURCES = \
81   schemavalidation/main.cc
82 textreader_textreader_SOURCES = \
83   textreader/main.cc
84
85 dist_noinst_DATA = \
86   README \
87   dom_parse_entities/example.xml \
88   dom_parse_entities/example.dtd \
89   dom_parser/example.xml \
90   dom_parser/example_with_namespace.xml \
91   dom_parser/example_invalid.xml \
92   dom_parser/example.dtd \
93   dom_parser_raw/example.xml \
94   dom_parser_raw/example_invalid.xml \
95   dom_parser_raw/example.dtd \
96   dom_read_write/README \
97   dom_read_write/example.xml \
98   dom_read_write/example.dtd \
99   dom_xpath/example.xml \
100   dtdvalidation/example.dtd \
101   import_node/example1.xml \
102   import_node/example2.xml \
103   sax_exception/example.xml \
104   sax_parser/example.xml \
105   sax_parser_build_dom/README \
106   sax_parser_build_dom/example.xml \
107   sax_parser_entities/example.xml \
108   schemavalidation/example.xml \
109   schemavalidation/example.xsd \
110   textreader/example.xml
111
112 # Build the shell scripts that call the example programs.
113 #
114 # Some programs can find their input file(s) only if the current directory,
115 # when they are executed, is the program's own source directory.
116 # To make these program invocations as consistent as possible, and to avoid
117 # having to specify parameters for the programs, most programs are executed
118 # from their own source directory.
119
120 # dom_read_write shall write its output file in the build directory,
121 # which may or may not be the same as the source directory.
122 # Here it's necessary to specify parameters when the input file and the output
123 # file are located in different directories.
124 dom_read_write/make-check-sh: Makefile
125         echo '# Generated and used by "make check"' >$@
126         echo 'dom_read_write/dom_read_write "$(srcdir)/dom_read_write/example.xml" dom_read_write/example_output.xml >/dev/null' >>$@
127         chmod +x $@
128
129 script_template = cd "$(srcdir)/<!progname!>" && "$(abs_builddir)/<!progname!>/<!progname!>" >/dev/null
130 standard_scripts = $(filter-out dom_read_write/make-check-sh,$(check_SCRIPTS))
131
132 # All other script files are generated like so:
133 $(standard_scripts): Makefile
134         echo '# Generated and used by "make check"' >$@
135         echo '$(subst <!progname!>,$(subst /make-check-sh,,$@),$(script_template))' >>$@
136         chmod +x $@
137
138 CLEANFILES = \
139   dom_read_write/example_output.xml \
140   $(check_SCRIPTS)