1 |
MANAKAI_ROOT_DIR = ../ |
2 |
MANAKAI_LIB_DIR = $(MANAKAI_ROOT_DIR)lib/ |
3 |
MANAKAI_BIN_DIR = $(MANAKAI_ROOT_DIR)bin/ |
4 |
TEMP_LIB_DIR = $(MANAKAI_LIB_DIR).phase1.tmp/ |
5 |
TEMP_LIB2_DIR = $(MANAKAI_LIB_DIR).phase2.tmp/ |
6 |
|
7 |
NS_MDOM = http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom\#ManakaiDOM. |
8 |
NS_MARKUP = http://suika.fam.cx/~wakaba/archive/2005/manakai/Markup\# |
9 |
NS_UTIL = http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ |
10 |
NS_UTIL_ERR = http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/ |
11 |
|
12 |
MKDIR = mkdir |
13 |
RM = rm |
14 |
MAKE = make |
15 |
CD = cd |
16 |
|
17 |
PERL = perl |
18 |
PERL1 = $(PERL) -I$(MANAKAI_LIB_DIR) |
19 |
PERL1_CHK = $(PERL) -I$(TEMP_LIB_DIR) -I$(MANAKAI_LIB_DIR) -c -w |
20 |
PERL2 = $(PERL) -I$(TEMP_LIB_DIR) -I$(MANAKAI_LIB_DIR) |
21 |
PERL2_CHK = $(PERL) -I$(TEMP_LIB2_DIR) -I$(TEMP_LIB_DIR) -I$(MANAKAI_LIB_DIR) |
22 |
|
23 |
DISC_PL = $(MANAKAI_BIN_DIR)disc.pl |
24 |
DISC = $(PERL1) $(DISC_PL) \ |
25 |
-I=$(MANAKAI_LIB_DIR)manakai/ \ |
26 |
-I=$(MANAKAI_LIB_DIR)Message/Util/ \ |
27 |
-I=$(MANAKAI_LIB_DIR)Message/Util/Error/ \ |
28 |
-I=$(MANAKAI_LIB_DIR)Message/Markup/ \ |
29 |
-I=$(MANAKAI_LIB_DIR)Message/DOM/ |
30 |
CDIS2PM_OPTIONS = |
31 |
CDIS2PM_PL = $(MANAKAI_BIN_DIR)cdis2pm.pl |
32 |
CDIS2PM = $(PERL1) $(CDIS2PM_PL) $(CDIS2PM_OPTIONS) |
33 |
|
34 |
DAC_PL = $(MANAKAI_BIN_DIR)dac.pl |
35 |
DAC = $(PERL2) \ |
36 |
-MMessage::Util::Error::DOMException \ |
37 |
$(DAC_PL) \ |
38 |
--search-path-catalog-file-name="$(MANAKAI_LIB_DIR)manakai/dis-catalog" \ |
39 |
--db-base-directory-path="$(MANAKAI_ROOT_DIR)" \ |
40 |
--implementation-registry-package \ |
41 |
"Message::DOM::DOMMetaImpl::ManakaiDOMImplementationRegistryCompat" \ |
42 |
--output-file-name= |
43 |
|
44 |
DAC2PM_OPTIONS = |
45 |
DAC2PM_PL = $(MANAKAI_BIN_DIR)dac2pm.pl |
46 |
DAC2PM = $(PERL2) \ |
47 |
-MMessage::Util::Error::DOMException \ |
48 |
$(DAC2PM_PL) \ |
49 |
--implementation-registry-package \ |
50 |
"Message::DOM::DOMMetaImpl::ManakaiDOMImplementationRegistryCompat" \ |
51 |
$(DAC2PM_OPTIONS) |
52 |
|
53 |
PHASE3_PERL_OPTIONS = |
54 |
PHASE3_DAC2PM_OPTIONS = --enable-assert |
55 |
## TODO: Official release should remove this option. |
56 |
|
57 |
DIS_FILES_FOR_DOMMETAIMPL = \ |
58 |
$(MANAKAI_LIB_DIR)Message/DOM/DOMBoot.dis \ |
59 |
$(MANAKAI_LIB_DIR)Message/DOM/DOMMetaImpl.dis \ |
60 |
$(MANAKAI_LIB_DIR)Message/Util/ManakaiNode.dis \ |
61 |
$(MANAKAI_LIB_DIR)manakai/DISCore.dis \ |
62 |
$(MANAKAI_LIB_DIR)manakai/DISRDF.dis \ |
63 |
$(MANAKAI_LIB_DIR)manakai/DISLang.dis \ |
64 |
$(MANAKAI_LIB_DIR)manakai/DISIDL.dis \ |
65 |
$(MANAKAI_LIB_DIR)manakai/DISPerl.dis \ |
66 |
$(MANAKAI_LIB_DIR)manakai/XML.dis |
67 |
## NOTE: DOMBoot.dis must be first |
68 |
|
69 |
DIS_FILES_FOR_DIS = \ |
70 |
$(MANAKAI_LIB_DIR)Message/Util/DIS.dis \ |
71 |
$(MANAKAI_LIB_DIR)Message/Markup/SuikaWikiConfig21.dis \ |
72 |
$(MANAKAI_LIB_DIR)Message/Util/Error/DOMException.dis \ |
73 |
$(MANAKAI_LIB_DIR)Message/Util/PerlCode.dis |
74 |
## NOTE: DIS.dis must be first |
75 |
|
76 |
PHASE1_PM_FILES = \ |
77 |
$(TEMP_LIB_DIR)Message/Util/ManakaiNode.pm \ |
78 |
$(TEMP_LIB_DIR)Message/DOM/DOMMetaImpl.pm \ |
79 |
$(TEMP_LIB_DIR)Message/Markup/SuikaWikiConfig21.pm \ |
80 |
$(TEMP_LIB_DIR)Message/Util/Error/DOMException.pm \ |
81 |
$(TEMP_LIB_DIR)Message/Util/PerlCode.pm \ |
82 |
$(TEMP_LIB_DIR)Message/Util/DIS.pm |
83 |
|
84 |
PHASE2_PM_FILES = \ |
85 |
$(TEMP_LIB2_DIR)Message/Util/ManakaiNode.pm \ |
86 |
$(TEMP_LIB2_DIR)Message/DOM/DOMMetaImpl.pm \ |
87 |
$(TEMP_LIB2_DIR)Message/Markup/SuikaWikiConfig21.pm \ |
88 |
$(TEMP_LIB2_DIR)Message/Util/Error/DOMException.pm \ |
89 |
$(TEMP_LIB2_DIR)Message/Util/PerlCode.pm \ |
90 |
$(TEMP_LIB2_DIR)Message/Util/DIS.pm |
91 |
|
92 |
GENERATED_FILES = $(TEMP_LIB_DIR) $(PHASE1_PM_FILES) \ |
93 |
\ |
94 |
$(TEMP_LIB2_DIR) $(PHASE2_PM_FILES) |
95 |
|
96 |
all: $(GENERATED_FILES) phase3 |
97 |
|
98 |
## Phase 1 - Making Perl modules by old disc and cdis2pm tools |
99 |
|
100 |
$(TEMP_LIB_DIR): |
101 |
$(MKDIR) -p $(TEMP_LIB_DIR)Message/Util/Error |
102 |
$(MKDIR) -p $(TEMP_LIB_DIR)Message/DOM |
103 |
$(MKDIR) -p $(TEMP_LIB_DIR)Message/Markup |
104 |
|
105 |
$(TEMP_LIB_DIR)dom.cdis: $(DIS_FILES_FOR_DOMMETAIMPL) $(DISC_PL) |
106 |
$(DISC) $< --output-file-name="$@" |
107 |
|
108 |
$(TEMP_LIB_DIR)dis.cdis: $(DIS_FILES_FOR_DIS) \ |
109 |
$(TEMP_LIB_DIR)dom.cdis $(DISC_PL) |
110 |
$(DISC) $< --input-cdis-file-name="$(TEMP_LIB_DIR)dom.cdis" \ |
111 |
--output-file-name="$@" |
112 |
|
113 |
$(TEMP_LIB_DIR)Message/DOM/DOMMetaImpl.pm: $(TEMP_LIB_DIR)dom.cdis $(CDIS2PM_PL) |
114 |
$(CDIS2PM) $< --module-name=DOMMetaImpl > $@ |
115 |
$(PERL1_CHK) $@ |
116 |
|
117 |
$(TEMP_LIB_DIR)Message/Util/ManakaiNode.pm: $(TEMP_LIB_DIR)dom.cdis $(CDIS2PM_PL) |
118 |
$(CDIS2PM) $< --module-name=ManakaiNode > $@ |
119 |
$(PERL1_CHK) $@ |
120 |
|
121 |
$(TEMP_LIB_DIR)Message/Util/DIS.pm: $(TEMP_LIB_DIR)dis.cdis $(CDIS2PM_PL) |
122 |
$(CDIS2PM) $< --module-name=DIS > $@ |
123 |
$(PERL1_CHK) $@ |
124 |
|
125 |
$(TEMP_LIB_DIR)Message/Util/PerlCode.pm: $(TEMP_LIB_DIR)dis.cdis $(CDIS2PM_PL) |
126 |
$(CDIS2PM) $< --module-name=PerlCode > $@ |
127 |
$(PERL1_CHK) $@ |
128 |
|
129 |
$(TEMP_LIB_DIR)Message/Util/Error/DOMException.pm: $(TEMP_LIB_DIR)dis.cdis \ |
130 |
$(CDIS2PM_PL) |
131 |
$(CDIS2PM) $< --module-name=DOMException > $@ |
132 |
$(PERL1_CHK) $@ |
133 |
|
134 |
$(TEMP_LIB_DIR)Message/Markup/SuikaWikiConfig21.pm: $(TEMP_LIB_DIR)dis.cdis \ |
135 |
$(CDIS2PM_PL) |
136 |
$(CDIS2PM) $< --module-name=SuikaWikiConfig21 > $@ |
137 |
$(PERL1_CHK) $@ |
138 |
|
139 |
## Phase 2 - Making Perl modules by dac tools generated |
140 |
## by old disc and cdis2pm tools |
141 |
|
142 |
$(TEMP_LIB2_DIR): |
143 |
$(MKDIR) -p $(TEMP_LIB2_DIR)Message/Util/Error |
144 |
$(MKDIR) -p $(TEMP_LIB2_DIR)Message/DOM |
145 |
$(MKDIR) -p $(TEMP_LIB2_DIR)Message/Markup |
146 |
|
147 |
$(TEMP_LIB2_DIR)dom.dac: $(DIS_FILES_FOR_DOMMETAIMPL) \ |
148 |
$(DAC_PL) $(PHASE1_PM_FILES) |
149 |
$(DAC)$@ $< |
150 |
|
151 |
$(TEMP_LIB2_DIR)dis.dac: $(DIS_FILES_FOR_DIS) $(TEMP_LIB2_DIR)dom.dac $(DAC_PL) |
152 |
$(DAC)$@ --input-db-file-name="$(TEMP_LIB2_DIR)dom.dac" $< |
153 |
|
154 |
$(TEMP_LIB2_DIR)Message/DOM/DOMMetaImpl.pm: \ |
155 |
$(TEMP_LIB2_DIR)dom.dac $(DAC2PM_PL) |
156 |
$(DAC2PM) $< --module-uri="$(NS_MDOM)DOMMetaImpl" > $@ |
157 |
$(PERL2_CHK) $@ |
158 |
|
159 |
$(TEMP_LIB2_DIR)Message/Markup/SuikaWikiConfig21.pm: \ |
160 |
$(TEMP_LIB2_DIR)dis.dac $(DAC2PM_PL) |
161 |
$(DAC2PM) $< --module-uri="$(NS_MARKUP)SuikaWikiConfig21" > $@ |
162 |
$(PERL2_CHK) $@ |
163 |
|
164 |
$(TEMP_LIB2_DIR)Message/Util/ManakaiNode.pm: \ |
165 |
$(TEMP_LIB2_DIR)dom.dac $(DAC2PM_PL) |
166 |
$(DAC2PM) $< --module-uri="$(NS_UTIL)ManakaiNode" > $@ |
167 |
$(PERL2_CHK) $@ |
168 |
|
169 |
$(TEMP_LIB2_DIR)Message/Util/DIS.pm: \ |
170 |
$(TEMP_LIB2_DIR)dis.dac $(DAC2PM_PL) |
171 |
$(DAC2PM) $< --module-uri="$(NS_UTIL)DIS" > $@ |
172 |
$(PERL2_CHK) $@ |
173 |
|
174 |
$(TEMP_LIB2_DIR)Message/Util/PerlCode.pm: \ |
175 |
$(TEMP_LIB2_DIR)dis.dac $(DAC2PM_PL) |
176 |
$(DAC2PM) $< --module-uri="$(NS_UTIL)PerlCode" > $@ |
177 |
$(PERL2_CHK) $@ |
178 |
|
179 |
$(TEMP_LIB2_DIR)Message/Util/Error/DOMException.pm: \ |
180 |
$(TEMP_LIB2_DIR)dis.dac $(DAC2PM_PL) |
181 |
$(DAC2PM) $< --module-uri="$(NS_UTIL_ERR)DOMException" > $@ |
182 |
$(PERL2_CHK) $@ |
183 |
|
184 |
## Phase 3 - Making Perl modules by dac tools generated by dac tools |
185 |
|
186 |
phase3: $(PHASE2_PM_FILES) |
187 |
$(CD) $(MANAKAI_LIB_DIR)Message/Util && \ |
188 |
$(MAKE) all \ |
189 |
PERL_OPTIONS2="-I../../lib/$(TEMP_LIB2_DIR) \ |
190 |
-I../../lib/$(MANAKAI_LIB_DIR) \ |
191 |
$(PHASE3_PERL_OPTIONS)" \ |
192 |
PERLC_OPTIONS2="-I../../lib/$(MANAKAI_LIB_DIR) \ |
193 |
$(PHASE3_PERL_OPTIONS)" \ |
194 |
DAC2PM_OPTIONS2="$(PHASE3_DAC2PM_OPTIONS)" \ |
195 |
PERL_OPTIONS3="-I../../../lib/$(TEMP_LIB2_DIR) \ |
196 |
-I../../../lib/$(MANAKAI_LIB_DIR) \ |
197 |
$(PHASE3_PERL_OPTIONS)" \ |
198 |
PERLC_OPTIONS3="-I../../../lib/$(MANAKAI_LIB_DIR) \ |
199 |
$(PHASE3_PERL_OPTIONS)" \ |
200 |
DAC2PM_OPTIONS3="$(PHASE3_DAC2PM_OPTIONS)" |
201 |
$(CD) $(MANAKAI_LIB_DIR)Message/Markup && \ |
202 |
$(MAKE) all \ |
203 |
PERL_OPTIONS2="-I../../lib/$(TEMP_LIB2_DIR) \ |
204 |
-I../../lib/$(MANAKAI_LIB_DIR) \ |
205 |
$(PHASE3_PERL_OPTIONS)" \ |
206 |
PERLC_OPTIONS2="-I../../lib/$(MANAKAI_LIB_DIR) \ |
207 |
$(PHASE3_PERL_OPTIONS)" \ |
208 |
DAC2PM_OPTIONS2="$(PHASE3_DAC2PM_OPTIONS)" \ |
209 |
PERL_OPTIONS3="-I../../../lib/$(TEMP_LIB2_DIR) \ |
210 |
-I../../../lib/$(MANAKAI_LIB_DIR) \ |
211 |
$(PHASE3_PERL_OPTIONS)" \ |
212 |
PERLC_OPTIONS3="-I../../../lib/$(MANAKAI_LIB_DIR) \ |
213 |
$(PHASE3_PERL_OPTIONS)" \ |
214 |
DAC2PM_OPTIONS3="$(PHASE3_DAC2PM_OPTIONS)" |
215 |
$(CD) $(MANAKAI_LIB_DIR)Message/DOM && \ |
216 |
$(MAKE) boot \ |
217 |
PERL_OPTIONS2="-I../../lib/$(TEMP_LIB2_DIR) \ |
218 |
-I../../lib/$(MANAKAI_LIB_DIR) \ |
219 |
$(PHASE3_PERL_OPTIONS)" \ |
220 |
PERLC_OPTIONS2="-I../../lib/$(MANAKAI_LIB_DIR) \ |
221 |
$(PHASE3_PERL_OPTIONS)" \ |
222 |
DAC2PM_OPTIONS2="$(PHASE3_DAC2PM_OPTIONS)" \ |
223 |
PERL_OPTIONS3="-I../../../lib/$(TEMP_LIB2_DIR) \ |
224 |
-I../../../lib/$(MANAKAI_LIB_DIR) \ |
225 |
$(PHASE3_PERL_OPTIONS)" \ |
226 |
PERLC_OPTIONS3="-I../../../lib/$(MANAKAI_LIB_DIR) \ |
227 |
$(PHASE3_PERL_OPTIONS)" \ |
228 |
DAC2PM_OPTIONS3="$(PHASE3_DAC2PM_OPTIONS)" |
229 |
|
230 |
## Misc. |
231 |
|
232 |
clean: |
233 |
$(RM) -frv $(TEMP_LIB_DIR) |
234 |
$(RM) -fv *~ .*~ *.BAK .*.BAK |
235 |
$(CD) $(MANAKAI_LIB_DIR)Message/Util && $(MAKE) clean |