183 &Output( |
171 &Output( |
184 "\@echo off\n", |
172 "\@echo off\n", |
185 "\@goto invoke\n", |
173 "\@goto invoke\n", |
186 "\n", |
174 "\n", |
187 "#!perl\n", |
175 "#!perl\n", |
188 "unless (\@ARGV==1 && \$ARGV[0]=~/^(deb|rel|clean)\$/io) {\n", |
176 "unless (\@ARGV==1 && \$ARGV[0]=~/^(deb|rel|clean|releasables)\$/io) {\n", |
189 " die\n", |
177 " die\n", |
190 " \"E32TOOLP's bld.bat - usage\\n\",\n", |
178 " \"E32TOOLP's bld.bat - usage\\n\",\n", |
191 " \"BLD [param]\\n\",\n", |
179 " \"BLD [param]\\n\",\n", |
192 " \"where\\n\",\n", |
180 " \"where\\n\",\n", |
193 " \"param = DEB or REL or CLEAN\\n\"\n", |
181 " \"param = DEB or REL or CLEAN\\n\"\n", |
194 " ;\n", |
182 " ;\n", |
195 "}\n", |
183 "}\n", |
196 "my \$Param=lc \$ARGV[0];\n", |
184 "my \$Param=lc \$ARGV[0];\n", |
197 "chdir \"$PrintGroupDir\";\n", |
185 "chdir \"$PrintGroupDir\";\n", |
|
186 "if (\$Param =~ /releasables/i)\n", |
|
187 "{\n", |
|
188 "open PIPE, \"..\\\\binutils\\\\make -s -f e32toolp.make \$Param |\" or die \"Can't invoke make: \$!\\n\";\n", |
|
189 "while (<PIPE>) { print \$_; }\n", |
|
190 "close PIPE;\n", |
|
191 "\n", |
|
192 "exit;\n", |
|
193 "}\n", |
198 "print \"..\\\\binutils\\\\make -s -f e32toolp.make \$Param\\n\";\n", |
194 "print \"..\\\\binutils\\\\make -s -f e32toolp.make \$Param\\n\";\n", |
199 "open PIPE, \"..\\\\binutils\\\\make -s -f e32toolp.make \$Param |\" or die \"Can't invoke make: \$!\\n\";\n", |
195 "open PIPE, \"..\\\\binutils\\\\make -s -f e32toolp.make \$Param |\" or die \"Can't invoke make: \$!\\n\";\n", |
200 "while (<PIPE>) {}\n", |
196 "while (<PIPE>) { }\n", |
201 "close PIPE;\n", |
197 "close PIPE;\n", |
202 "\n", |
198 "\n", |
203 "__END__\n", |
199 "__END__\n", |
204 "\n", |
200 "\n", |
205 ":invoke\n", |
201 ":invoke\n", |
222 "else\n", |
218 "else\n", |
223 "ERASE = \@erase\n", |
219 "ERASE = \@erase\n", |
224 "endif\n", |
220 "endif\n", |
225 "\n", |
221 "\n", |
226 "\n", |
222 "\n", |
227 "$GroupToToolsPath :\n", |
223 "$EPOCToolsPath :\n", |
228 "\t\@perl -w ..\\genutil\\emkdir.pl $GroupToToolsPath\n", |
224 "\t\@perl -w ..\\genutil\\emkdir.pl $EPOCToolsPath\n", |
229 "\n", |
225 "\n", |
230 "$GroupToTemplatePath :\n", |
226 "$TemplateFilePath :\n", |
231 "\t\@perl -w ..\\genutil\\emkdir.pl $GroupToTemplatePath\n", |
227 "\t\@perl -w ..\\genutil\\emkdir.pl $TemplateFilePath\n", |
232 "\n" |
228 "\n" |
233 ); |
229 ); |
234 |
230 |
235 foreach (sort keys %TemplateDirs) { |
231 foreach (sort keys %TemplateDirs) { |
236 &Output( |
232 &Output( |
237 "$GroupToTemplatePath\\$_ :\n", |
233 "$TemplateFilePath\\$_ :\n", |
238 "\t\@perl -w ..\\genutil\\emkdir.pl $GroupToTemplatePath\\$_\n", |
234 "\t\@perl -w ..\\genutil\\emkdir.pl $TemplateFilePath\\$_\n", |
239 "\n" |
235 "\n" |
240 ); |
236 ); |
241 } |
237 } |
242 |
238 |
243 foreach (sort keys %BinDirs) { |
239 foreach (sort keys %BinDirs) { |
244 &Output( |
240 &Output( |
245 "$GroupToBinPath\\$_ :\n", |
241 "$BinFilePath\\$_ :\n", |
246 "\t\@perl -w ..\\genutil\\emkdir.pl $GroupToBinPath\\$_\n", |
242 "\t\@perl -w ..\\genutil\\emkdir.pl $BinFilePath\\$_\n", |
247 "\n" |
243 "\n" |
248 ); |
244 ); |
249 } |
245 } |
250 |
246 |
251 &Output( |
247 if (scalar @Docs) { |
252 "$GroupToShellPath :\n", |
248 &Output( |
253 "\t\@perl -w ..\\genutil\\emkdir.pl $GroupToShellPath\n", |
249 "$DocsPath :\n", |
254 "\n", |
250 "\t\@perl -w ..\\genutil\\emkdir.pl $DocsPath\n", |
255 "$GroupToToolsConfigFilePath :\n", |
251 "\n" |
256 "\t\@perl -w ..\\genutil\\emkdir.pl $GroupToToolsConfigFilePath\n", |
252 ); |
257 "\n", |
253 } else { |
258 "$GroupToDocsPath :\n", |
254 $DocsPath = ""; # suppresses $DocsPath as a dependency in the main rules |
259 "\t\@perl -w ..\\genutil\\emkdir.pl $GroupToDocsPath\n", |
255 } |
260 "\n", |
256 |
261 "\n", |
257 &Output( |
262 "deb : $GroupToToolsPath $GroupToToolsConfigFilePath $GroupToDocsPath $GroupToTemplatePath $GroupToShellPath " |
258 "$ShellFilePath :\n", |
|
259 "\t\@perl -w ..\\genutil\\emkdir.pl $ShellFilePath\n", |
|
260 "\n", |
|
261 "$EPOCToolsConfigFilePath :\n", |
|
262 "\t\@perl -w ..\\genutil\\emkdir.pl $EPOCToolsConfigFilePath\n", |
|
263 "\n", |
|
264 "\n", |
|
265 "deb : $EPOCToolsPath $EPOCToolsConfigFilePath $DocsPath $TemplateFilePath $ShellFilePath " |
263 ); |
266 ); |
264 |
267 |
265 foreach (sort keys %TemplateDirs) { |
268 foreach (sort keys %TemplateDirs) { |
266 &Output( |
269 &Output( |
267 "$GroupToTemplatePath\\$_ " |
270 "$TemplateFilePath\\$_ " |
268 ); |
271 ); |
269 } |
272 } |
270 |
273 |
271 foreach (sort keys %BinDirs) { |
274 foreach (sort keys %BinDirs) { |
272 &Output( |
275 &Output( |
273 "$GroupToBinPath\\$_ " |
276 "$BinFilePath\\$_ " |
274 ); |
277 ); |
275 } |
278 } |
276 |
279 |
277 &Output("\n"); |
280 &Output("\n"); |
278 |
281 |
279 my $File; |
282 my $File; |
280 foreach $File (keys %Files) { |
283 foreach $File (keys %Files) { |
281 &Output( |
284 &Output( |
282 "\tcopy \"..\\$Files{$File}\" \"$GroupToToolsPath\\$File\" >nul\n" |
285 "\tcopy \"..\\$Files{$File}\" \"$EPOCToolsPath\\$File\" >nul\n" |
283 ); |
286 ); |
284 } |
287 } |
285 |
288 |
286 my $ConfigFile; |
289 my $ConfigFile; |
287 foreach $ConfigFile (@ConfigFiles) { |
290 foreach $ConfigFile (@ConfigFiles) { |
288 &Output( |
291 &Output( |
289 "\tcopy \"..\\platform\\$ConfigFile\" \"$GroupToToolsConfigFilePath\\$ConfigFile\" >nul\n" |
292 "\tcopy \"..\\platform\\$ConfigFile\" \"$EPOCToolsConfigFilePath\\$ConfigFile\" >nul\n" |
290 ); |
293 ); |
291 } |
294 } |
292 |
295 |
293 foreach $File (@Docs) { |
296 foreach $File (@Docs) { |
294 &Output( |
297 &Output( |
295 "\tcopy \"..\\Docs\\$File\" \"$GroupToDocsPath\\$File\" >nul\n" |
298 "\tcopy \"..\\Docs\\$File\" \"$DocsPath\\$File\" >nul\n" |
296 ); |
299 ); |
297 } |
300 } |
298 |
301 |
299 my $tfile; |
302 my $tfile; |
300 foreach $tfile (@TemplateFiles) { |
303 foreach $tfile (@TemplateFiles) { |
301 &Output( |
304 &Output( |
302 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\extension\\$tfile\" \"$GroupToTemplatePath\\$tfile\" >nul\n" |
305 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\extension\\$tfile\" \"$TemplateFilePath\\$tfile\" >nul\n" |
303 ); |
306 ); |
304 } |
307 } |
305 |
308 |
306 my $bfile; |
309 my $bfile; |
307 foreach $bfile (@BinFiles) { |
310 foreach $bfile (@BinFiles) { |
308 &Output( |
311 &Output( |
309 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\bin\\$bfile\" \"$GroupToBinPath\\$bfile\" >nul\n" |
312 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\bin\\$bfile\" \"$BinFilePath\\$bfile\" >nul\n" |
310 ); |
313 ); |
311 } |
314 } |
312 |
315 |
313 my $sfile; |
316 my $sfile; |
314 foreach $sfile (@ShellFiles) { |
317 foreach $sfile (@ShellFiles) { |
315 &Output( |
318 &Output( |
316 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\shell\\$sfile\" \"$GroupToShellPath\\$sfile\" >nul\n" |
319 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\shell\\$sfile\" \"$ShellFilePath\\$sfile\" >nul\n" |
317 ); |
320 ); |
318 } |
321 } |
319 |
322 |
320 &Output( |
323 &Output( |
321 "\n", |
324 "\n", |
322 "\n", |
325 "\n", |
323 "rel : $GroupToToolsPath $GroupToToolsConfigFilePath $GroupToDocsPath $GroupToTemplatePath $GroupToShellPath " |
326 "rel : $EPOCToolsPath $EPOCToolsConfigFilePath $DocsPath $TemplateFilePath $ShellFilePath " |
324 ); |
327 ); |
325 |
328 |
326 foreach (sort keys %TemplateDirs) { |
329 foreach (sort keys %TemplateDirs) { |
327 &Output( |
330 &Output( |
328 "$GroupToTemplatePath\\$_ " |
331 "$TemplateFilePath\\$_ " |
329 ); |
332 ); |
330 } |
333 } |
331 |
334 |
332 foreach (sort keys %BinDirs) { |
335 foreach (sort keys %BinDirs) { |
333 &Output( |
336 &Output( |
334 "$GroupToBinPath\\$_ " |
337 "$BinFilePath\\$_ " |
335 ); |
338 ); |
336 } |
339 } |
337 |
340 |
338 &Output("\n"); |
341 &Output("\n"); |
339 |
342 |
340 |
343 |
341 foreach $File (keys %Files) { |
344 foreach $File (keys %Files) { |
342 &Output( |
345 &Output( |
343 "\t.\\perlprep.bat \"..\\$Files{$File}\" \"$GroupToToolsPath\\$File\"\n" |
346 "\t.\\perlprep.bat \"..\\$Files{$File}\" \"$EPOCToolsPath\\$File\"\n" |
344 ); |
347 ); |
345 } |
348 } |
346 |
349 |
347 foreach $ConfigFile (@ConfigFiles) { |
350 foreach $ConfigFile (@ConfigFiles) { |
348 &Output( |
351 &Output( |
349 "\tcopy \"..\\platform\\$ConfigFile\" \"$GroupToToolsConfigFilePath\\$ConfigFile\" >nul\n" |
352 "\tcopy \"..\\platform\\$ConfigFile\" \"$EPOCToolsConfigFilePath\\$ConfigFile\" >nul\n" |
350 ); |
353 ); |
351 } |
354 } |
352 |
355 |
353 foreach $File (@Docs) { |
356 foreach $File (@Docs) { |
354 &Output( |
357 &Output( |
355 "\tcopy \"..\\Docs\\$File\" \"$GroupToDocsPath\\$File\" >nul\n" |
358 "\tcopy \"..\\Docs\\$File\" \"$DocsPath\\$File\" >nul\n" |
356 ); |
359 ); |
357 } |
360 } |
358 |
361 |
359 foreach $tfile (@TemplateFiles) { |
362 foreach $tfile (@TemplateFiles) { |
360 &Output( |
363 &Output( |
361 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\extension\\$tfile\" \"$GroupToTemplatePath\\$tfile\" >nul\n" |
364 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\extension\\$tfile\" \"$TemplateFilePath\\$tfile\" >nul\n" |
362 ); |
365 ); |
363 } |
366 } |
364 foreach $bfile (@BinFiles) { |
367 foreach $bfile (@BinFiles) { |
365 &Output( |
368 &Output( |
366 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\bin\\$bfile\" \"$GroupToBinPath\\$bfile\" >nul\n" |
369 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\bin\\$bfile\" \"$BinFilePath\\$bfile\" >nul\n" |
367 ); |
370 ); |
368 } |
371 } |
369 foreach $sfile (@ShellFiles) { |
372 foreach $sfile (@ShellFiles) { |
370 &Output( |
373 &Output( |
371 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\shell\\$sfile\" \"$GroupToShellPath\\$sfile\" >nul\n" |
374 "\tcopy \"..\\..\\..\\toolsandutils\\buildsystem\\shell\\$sfile\" \"$ShellFilePath\\$sfile\" >nul\n" |
372 ); |
375 ); |
373 } |
376 } |
374 &Output( |
377 &Output( |
375 "\n", |
378 "\n", |
376 "rel deb : $GroupToToolsPath\\make.exe\n", |
379 "rel deb : $EPOCToolsPath\\make.exe\n", |
377 "$GroupToToolsPath\\make.exe: ..\\binutils\\make.exe\n", |
380 "$EPOCToolsPath\\make.exe: ..\\binutils\\make.exe\n", |
378 "\tcopy \$\? \$\@\n" |
381 "\tcopy \$\? \$\@\n" |
379 ); |
382 ); |
380 |
383 |
381 &Output( |
384 &Output( |
382 "\n", |
385 "\n", |
383 "rel deb : $GroupToToolsPath\\scpp.exe\n", |
386 "rel deb : $EPOCToolsPath\\scpp.exe\n", |
384 "$GroupToToolsPath\\scpp.exe: ..\\binutils\\scpp.exe\n", |
387 "$EPOCToolsPath\\scpp.exe: ..\\binutils\\scpp.exe\n", |
385 "\tcopy \$\? \$\@\n" |
388 "\tcopy \$\? \$\@\n" |
386 ); |
389 ); |
387 |
390 |
388 |
391 |
389 &Output( |
392 &Output( |
390 "\n", |
393 "\n", |
391 "clean :\n" |
394 "clean :\n" |
392 ); |
395 ); |
393 foreach $File (keys %Files) { |
396 foreach $File (keys %Files) { |
394 &Output( |
397 &Output( |
395 "\t-\$(ERASE) \"$GroupToToolsPath\\$File\"\n" |
398 "\t-\$(ERASE) \"$EPOCToolsPath\\$File\"\n" |
396 ); |
399 ); |
397 } |
400 } |
398 foreach $ConfigFile (@ConfigFiles) { |
401 foreach $ConfigFile (@ConfigFiles) { |
399 &Output( |
402 &Output( |
400 "\t-\$(ERASE) \"$GroupToToolsConfigFilePath\\$ConfigFile\"\n" |
403 "\t-\$(ERASE) \"$EPOCToolsConfigFilePath\\$ConfigFile\"\n" |
401 ); |
404 ); |
402 } |
405 } |
403 foreach $File (@Docs) { |
406 foreach $File (@Docs) { |
404 &Output( |
407 &Output( |
405 "\t-\$(ERASE) \"$GroupToDocsPath\\$File\"\n" |
408 "\t-\$(ERASE) \"$DocsPath\\$File\"\n" |
406 ); |
409 ); |
407 } |
410 } |
408 foreach $tfile (@TemplateFiles) { |
411 foreach $tfile (@TemplateFiles) { |
409 &Output( |
412 &Output( |
410 "\t-\$(ERASE) \"$GroupToTemplatePath\\$tfile\"\n" |
413 "\t-\$(ERASE) \"$TemplateFilePath\\$tfile\"\n" |
411 ); |
414 ); |
412 } |
415 } |
413 foreach $bfile (@BinFiles) { |
416 foreach $bfile (@BinFiles) { |
414 &Output( |
417 &Output( |
415 "\t-\$(ERASE) \"$GroupToBinPath\\$bfile\"\n" |
418 "\t-\$(ERASE) \"$BinFilePath\\$bfile\"\n" |
416 ); |
419 ); |
417 } |
420 } |
418 foreach $sfile (@ShellFiles) { |
421 foreach $sfile (@ShellFiles) { |
419 &Output( |
422 &Output( |
420 "\t-\$(ERASE) \"$GroupToShellPath\\$sfile\"\n" |
423 "\t-\$(ERASE) \"$ShellFilePath\\$sfile\"\n" |
|
424 ); |
|
425 } |
|
426 |
|
427 &Output( |
|
428 "\n", |
|
429 "releasables :\n" |
|
430 ); |
|
431 foreach $File (keys %Files) { |
|
432 &Output( |
|
433 "\t\@echo $EPOCToolsPath\\$File\n" |
|
434 ); |
|
435 } |
|
436 foreach $ConfigFile (@ConfigFiles) { |
|
437 &Output( |
|
438 "\t\@echo $EPOCToolsConfigFilePath\\$ConfigFile\n" |
|
439 ); |
|
440 } |
|
441 foreach $File (@Docs) { |
|
442 &Output( |
|
443 "\t\@echo $DocsPath\\$File\n" |
|
444 ); |
|
445 } |
|
446 foreach $tfile (@TemplateFiles) { |
|
447 &Output( |
|
448 "\t\@echo $TemplateFilePath\\$tfile\n" |
|
449 ); |
|
450 } |
|
451 foreach $bfile (@BinFiles) { |
|
452 &Output( |
|
453 "\t\@echo $BinFilePath\\$bfile\n" |
|
454 ); |
|
455 } |
|
456 foreach $sfile (@ShellFiles) { |
|
457 &Output( |
|
458 "\t\@echo $ShellFilePath\\$sfile\n" |
421 ); |
459 ); |
422 } |
460 } |
423 |
461 |
424 my $MAKEFILE="e32toolp.make"; |
462 my $MAKEFILE="e32toolp.make"; |
425 print "Creating File \"$MAKEFILE\"\n"; |
463 print "Creating File \"$MAKEFILE\"\n"; |