1 |
MANAKAI_ROOT_DIR = ../ |
2 |
MANAKAI_BIN_DIR = $(MANAKAI_ROOT_DIR)bin/ |
3 |
MANAKAI_LIB_DIR = $(MANAKAI_ROOT_DIR)lib/ |
4 |
MANAKAI_TEST_DIR = $(MANAKAI_ROOT_DIR)t/ |
5 |
|
6 |
DIS_SUFFIX = .dis |
7 |
DAEM_SUFFIX = .dafm |
8 |
DAFX_SUFFIX = .dafx |
9 |
PM_SUFFIX = .pm |
10 |
PT_SUFFIX = .t |
11 |
|
12 |
CD = cd |
13 |
MAKE = make |
14 |
MKDIR = mkdir -p |
15 |
ECHO = echo |
16 |
|
17 |
RM = rm |
18 |
RMALL = $(RM) -fv |
19 |
|
20 |
TEST_VERBOSE = 0 |
21 |
INST_ARCHLIB = $(MANAKAI_ROOT_DIR)blib/arch |
22 |
INST_LIB = $(MANAKAI_ROOT_DIR)blib/lib |
23 |
|
24 |
PERL = perl |
25 |
PERL_OPTIONS = |
26 |
PERL_OPTIONS_ALL = $(PERL_OPTIONS) -I$(MANAKAI_LIB_DIR) |
27 |
PERL_ = $(PERL) $(PERL_OPTIONS_ALL) |
28 |
PERLC = $(PERL) -c -w |
29 |
PERLC_OPTIONS = |
30 |
PERLC_OPTIONS_ALL = $(PERLC_OPTIONS) -I$(MANAKAI_LIB_DIR) |
31 |
PERL_CHK = $(PERLC) $(PERLC_OPTIONS_ALL) |
32 |
PERL_TEST_ = $(PERL) $(PERL_OPTIONS_ALL) \ |
33 |
-MExtUtils::Command::MM \ |
34 |
-e "test_harness ($(TEST_VERBOSE), '$(INST_LIB)', \ |
35 |
'$(INST_ARCHLIB)')" |
36 |
|
37 |
DIS_OPTIONS = |
38 |
DIS_OPTIONS_ALL = $(DIS_OPTIONS) \ |
39 |
--search-path-catalog-file-name="$(MANAKAI_LIB_DIR)manakai/dis-catalog" \ |
40 |
--dis-file-suffix="$(DIS_SUFFIX)" \ |
41 |
--daem-file-suffix="$(DAEM_SUFFIX)" \ |
42 |
--dafx-file-suffix="$(DAFX_SUFFIX)" |
43 |
|
44 |
DAF_OPTIONS = |
45 |
DAF_PL = $(MANAKAI_BIN_DIR)daf.pl |
46 |
DAF = $(PERL_) $(DAF_PL) $(DAF_OPTIONS) $(DIS_OPTIONS_ALL) |
47 |
|
48 |
DOMTEST_TESTS_DIR = $(MANAKAI_ROOT_DIR)../domts/tests/ |
49 |
DOMTEST_PERL_DIR = $(MANAKAI_TEST_DIR)dom/ |
50 |
DOMTEST_FILE = *.xml |
51 |
|
52 |
DOMTS2PERL_PL = $(MANAKAI_BIN_DIR)domts2perl.pl |
53 |
DOMTS2PERL = $(PERL_) -I$(MANAKAI_BIN_DIR) $(DOMTS2PERL_PL) |
54 |
DOMTEST2PERL_PL = $(MANAKAI_BIN_DIR)domtest2perl.pl |
55 |
|
56 |
NS_CHARSET = http://suika.fam.cx/~wakaba/archive/2005/manakai/Charset/ |
57 |
NS_MDOM = http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom\#ManakaiDOM. |
58 |
NS_MANAKAIDOM = http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom\# |
59 |
NS_URI = http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/ |
60 |
NS_UTIL = http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ |
61 |
NS_UTIL_DIS = http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS\# |
62 |
|
63 |
TEST_PM_FILES = \ |
64 |
$(MANAKAI_LIB_DIR)Message/Util/DIS/Test$(PM_SUFFIX) |
65 |
|
66 |
NS_CHARSET_PT_FILES = \ |
67 |
charset-Encode$(PT_SUFFIX) |
68 |
NS_MDOM_PT_FILES = \ |
69 |
dom-DOMFeature$(PT_SUFFIX) dom-GenericLS$(PT_SUFFIX) \ |
70 |
dom-DOMCore$(PT_SUFFIX) \ |
71 |
dom-TreeCore$(PT_SUFFIX) dom-Document$(PT_SUFFIX) dom-Element$(PT_SUFFIX) \ |
72 |
dom-XML$(PT_SUFFIX) dom-XDoctype$(PT_SUFFIX) \ |
73 |
dom-DOMLS$(PT_SUFFIX) dom-XMLParser$(PT_SUFFIX) \ |
74 |
dom-TreeStore$(PT_SUFFIX) |
75 |
NS_URI_PT_FILES = \ |
76 |
uri-Generic$(PT_SUFFIX) |
77 |
NS_UTIL_PT_FILES = \ |
78 |
util-ManakaiNodeTest$(PT_SUFFIX) \ |
79 |
util-PerlCode$(PT_SUFFIX) \ |
80 |
util-DIS$(PT_SUFFIX) |
81 |
NS_UTIL_DIS_PT_FILES = \ |
82 |
util-dis-DNLite$(PT_SUFFIX) \ |
83 |
util-dis-DPG$(PT_SUFFIX) |
84 |
|
85 |
PT_FILES = \ |
86 |
$(NS_MDOM_PT_FILES) \ |
87 |
$(NS_URI_PT_FILES) \ |
88 |
$(NS_UTIL_PT_FILES) $(NS_UTIL_DIS_PT_FILES) |
89 |
|
90 |
GENERATED_FILES = $(PT_FILES) |
91 |
|
92 |
all: $(GENERATED_FILES) |
93 |
|
94 |
dom1core-perl: $(DOMTS2PERL_PL) |
95 |
$(MKDIR) $(DOMTEST_PERL_DIR)level1/core/ |
96 |
$(DOMTS2PERL) --test-directory="$(DOMTEST_TESTS_DIR)level1/core/" \ |
97 |
--output-directory="$(DOMTEST_PERL_DIR)level1/core/" \ |
98 |
--domtest2perl-path="$(DOMTEST2PERL_PL)" |
99 |
|
100 |
dom1core: |
101 |
MANAKAI_DOMTEST_FILE_DIR=$(DOMTEST_TESTS_DIR)level1/core/files/ \ |
102 |
$(PERL_TEST_) $(DOMTEST_PERL_DIR)level1/core/$(DOMTEST_FILE).pl |
103 |
|
104 |
test-module-all: \ |
105 |
test-module-charset \ |
106 |
test-module-dom \ |
107 |
test-module-uri \ |
108 |
test-module-util |
109 |
|
110 |
test-module-charset: $(NS_CHARSET_PT_FILES) $(TEST_PM_FILES) |
111 |
$(PERL_TEST_) charset-*$(PT_SUFFIX) |
112 |
|
113 |
$(NS_CHARSET_PT_FILES): charset-%$(PT_SUFFIX): \ |
114 |
$(MANAKAI_LIB_DIR)Message/Charset/%$(DIS_SUFFIX) $(DAF_PL) |
115 |
$(DAF) --create-perl-test="$(NS_CHARSET)$* $@" |
116 |
$(PERL_CHK) $@ |
117 |
|
118 |
test-module-dom: $(NS_MDOM_PT_FILES) $(TEST_PM_FILES) |
119 |
$(PERL_TEST_) dom-*$(PT_SUFFIX) |
120 |
|
121 |
$(NS_MDOM_PT_FILES): dom-%$(PT_SUFFIX): \ |
122 |
$(MANAKAI_LIB_DIR)Message/DOM/%$(DIS_SUFFIX) $(DAF_PL) |
123 |
$(DAF) --create-perl-test="$(NS_MDOM)$* $@" |
124 |
$(ECHO) "BEGIN {" >> $@ |
125 |
$(ECHO) " require 'manakai/mndebug.pl';" >> $@ |
126 |
$(ECHO) " manakai::mndebug::define_nodestem_destroy ();" >> $@ |
127 |
#$(ECHO) " manakai::mndebug::define_nodestem_destroy_all ();" >> $@ |
128 |
#$(ECHO) " manakai::mndebug::define_noderef_destroy_all ();" >> $@ |
129 |
$(ECHO) "}" >> $@ |
130 |
$(PERL_CHK) $@ |
131 |
|
132 |
test-module-uri: $(NS_URI_PT_FILES) $(TEST_PM_FILES) |
133 |
$(PERL_TEST_) uri-*$(PT_SUFFIX) |
134 |
|
135 |
$(NS_URI_PT_FILES): uri-%$(PT_SUFFIX): \ |
136 |
$(MANAKAI_LIB_DIR)Message/URI/%$(DIS_SUFFIX) $(DAF_PL) |
137 |
$(DAF) --create-perl-test="$(NS_URI)$* $@" |
138 |
$(PERL_CHK) $@ |
139 |
|
140 |
test-module-util: $(NS_UTIL_PT_FILES) $(NS_UTIL_DIS_PT_FILES) $(TEST_PM_FILES) |
141 |
$(PERL_TEST_) util-*$(PT_SUFFIX) |
142 |
|
143 |
$(NS_UTIL_PT_FILES): util-%$(PT_SUFFIX): \ |
144 |
$(MANAKAI_LIB_DIR)Message/Util/%$(DIS_SUFFIX) $(DAF_PL) |
145 |
$(DAF) --create-perl-test="$(NS_UTIL)$* $@" |
146 |
$(PERL_CHK) $@ |
147 |
|
148 |
util-ManakaiNode$(PT_SUFFIX): \ |
149 |
$(MANAKAI_LIB_DIR)Message/Util/%$(DIS_SUFFIX) $(UTIL_MNTEST_PM) $(DAF_PL) |
150 |
$(DAF) --create-perl-test="$(NS_UTIL)$* $@" |
151 |
$(ECHO) "BEGIN {" >> $@ |
152 |
$(ECHO) " require 'manakai/mndebug.pl';" >> $@ |
153 |
$(ECHO) " manakai::mndebug::define_nodestem_destroy ();" >> $@ |
154 |
#$(ECHO) " manakai::mndebug::define_nodestem_destroy_all ();" >> $@ |
155 |
#$(ECHO) " manakai::mndebug::define_noderef_destroy_all ();" >> $@ |
156 |
$(ECHO) "}" >> $@ |
157 |
$(PERL_CHK) $@ |
158 |
|
159 |
$(NS_UTIL_DIS_PT_FILES): util-dis-%$(PT_SUFFIX): \ |
160 |
$(MANAKAI_LIB_DIR)Message/Util/DIS/%$(DIS_SUFFIX) $(DAF_PL) |
161 |
$(DAF) --create-perl-test="$(NS_UTIL_DIS)$* $@" |
162 |
$(PERL_CHK) $@ |
163 |
|
164 |
$(UTIL_MNTEST_PM): $(MANAKAI_LIB_DIR)Message/Util/%: always |
165 |
$(CD) $(MANAKAI_LIB_DIR)Message/Util/ && $(MAKE) $* |
166 |
|
167 |
$(MANAKAI_LIB_DIR)Message/Util/DIS/Test$(PM_SUFFIX): \ |
168 |
$(MANAKAI_LIB_DIR)Message/Util/DIS/Test$(DIS_SUFFIX) |
169 |
$(CD) $(MANAKAI_LIB_DIR)Message/Util/ && $(MAKE) DIS/Test$(PM_SUFFIX) |
170 |
|
171 |
clean: clean-dom1core-perl |
172 |
$(RMALL) $(GENERATED_FILES) |
173 |
|
174 |
clean-dom1core-perl: |
175 |
$(RMALL) $(DOMTEST_PERL_DIR)level1/core/* |
176 |
$(RMALL) *~ .*~ *.BAK .*.BAK |
177 |
|
178 |
distclean: clean |
179 |
|
180 |
always: |