Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /branches/destination-access/src/xml/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1829 - (show annotations) (download)
Sat Oct 17 14:17:17 2015 UTC (9 years, 5 months ago) by amb
File size: 2939 byte(s)
Merge trunk back into routino-destination branch after completing the
loop and reverse changes.

1 # XML test programs Makefile
2 #
3 # Part of the Routino routing software.
4 #
5 # This file Copyright 2010-2015 Andrew M. Bishop
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
16 #
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #
20
21 # All configuration is in the top-level Makefile.conf
22
23 include ../../Makefile.conf
24
25 # Compilation targets
26
27 DEPDIR=.deps
28
29 XMLDIR=../../xml
30
31 X=$(notdir $(wildcard $(XMLDIR)/*.xsd))
32 C=$(foreach f,$(X),$(addsuffix -skeleton.c,$(basename $f)))
33 D=$(wildcard $(DEPDIR)/*.d)
34 O=$(foreach f,$(C),$(addsuffix .o,$(basename $f)))
35 E=$(foreach f,$(C),$(addsuffix $(.EXE),$(basename $f)))
36
37 EXE=xsd-to-xmlparser$(.EXE)
38
39 ########
40
41 all: $(EXE) $(C) $(E)
42
43 ########
44
45 xsd-to-xmlparser$(.EXE) : xsd-to-xmlparser.o ../xmlparse.o
46 $(LD) $^ -o $@ $(LDFLAGS)
47
48 ########
49
50 %-skeleton.c : $(XMLDIR)/%.xsd xsd-to-xmlparser$(.EXE)
51 -./xsd-to-xmlparser < $< > $@
52 @test -s $@ || rm $@
53
54 %-skeleton$(.EXE) : %-skeleton.o ../xmlparse.o
55 $(LD) $^ -o $@ $(LDFLAGS)
56
57 .SECONDARY : $(O)
58
59 ########
60
61 ../xmlparse.o : ../xmlparse.c ../xmlparse.h
62 cd .. && $(MAKE) xmlparse.o
63
64 ########
65
66 %.o : %.c
67 -@[ -d $(DEPDIR) ] || mkdir $(DEPDIR)
68 $(CC) -c $(CFLAGS) -I.. $< -o $@ -MMD -MP -MF $(addprefix $(DEPDIR)/,$(addsuffix .d,$(basename $@)))
69
70 ########
71
72 test: test-skeleton$(.EXE)
73 @status=true ;\
74 echo "" ;\
75 for good in test/good*.xml; do \
76 echo "Testing: $$good ... " ;\
77 if ./test-skeleton < $$good > /dev/null; then echo "... passed"; else echo "... FAILED"; status=false; fi ;\
78 echo "" ;\
79 done ;\
80 for bad in test/bad*.xml; do \
81 echo "Testing: $$bad ... " ;\
82 if ./test-skeleton < $$bad > /dev/null; then echo "... FAILED"; status=false; else echo "... passed"; fi ;\
83 echo "" ;\
84 done ;\
85 if $$status; then echo "Success: all tests passed"; else echo "Warning: Some tests FAILED"; fi ;\
86 $$status
87
88 test-skeleton$(.EXE) : test-skeleton.o ../xmlparse.o
89 $(LD) $^ -o $@ $(LDFLAGS)
90
91 test-skeleton.c : test/test.xsd xsd-to-xmlparser$(.EXE)
92 ./xsd-to-xmlparser < $< | sed -e 's/XMLPARSE_UNKNOWN_ATTR_WARN/XMLPARSE_UNKNOWN_ATTR_ERROR/' > $@
93
94 ########
95
96 install:
97
98 ########
99
100 clean:
101 rm -f *~
102 rm -f *.o
103 rm -f $(EXE)
104 rm -f $(E) test-skeleton$(.EXE)
105 rm -f $(D) $(DEPDIR)/test-skeleton.d
106 rm -f $(C) test-skeleton.c
107 rm -fr $(DEPDIR)
108 rm -f core
109 rm -f *.gcda *.gcno *.gcov gmon.out
110
111 ########
112
113 distclean: clean
114
115 ########
116
117 include $(D)
118
119 ########
120
121 .PHONY:: all test install clean distclean

Properties

Name Value
cvs:description A Makefile for the XML utilities.