3 "{ NameSpace: Tools }" |
3 "{ NameSpace: Tools }" |
4 |
4 |
5 Object subclass:#ProjectBuilder |
5 Object subclass:#ProjectBuilder |
6 instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory |
6 instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory |
7 myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream |
7 myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream |
8 makeExeOnly' |
8 makeExeOnly usedCompiler' |
9 classVariableNames:'PreviousBuildDirectory' |
9 classVariableNames:'PreviousBuildDirectory' |
10 poolDictionaries:'' |
10 poolDictionaries:'' |
11 category:'System-Support-Projects' |
11 category:'System-Support-Projects' |
12 ! |
12 ! |
13 |
13 |
68 ^ buildDirectory / (package asPackageId module) / (package asPackageId directory) |
68 ^ buildDirectory / (package asPackageId module) / (package asPackageId directory) |
69 ! |
69 ! |
70 |
70 |
71 projectDefinitionClass:something |
71 projectDefinitionClass:something |
72 projectDefinitionClass := something. |
72 projectDefinitionClass := something. |
|
73 ! |
|
74 |
|
75 usedCompiler:something |
|
76 usedCompiler := something. |
73 ! ! |
77 ! ! |
74 |
78 |
75 !ProjectBuilder methodsFor:'building'! |
79 !ProjectBuilder methodsFor:'building'! |
76 |
80 |
77 build |
81 build |
563 |
567 |
564 "/ stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic') |
568 "/ stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic') |
565 ! |
569 ! |
566 |
570 |
567 makeWithOutputTo:stdOut errorTo:stdErr |
571 makeWithOutputTo:stdOut errorTo:stdErr |
568 |module directory| |
572 |module directory compilerFlag makeCommand| |
569 |
573 |
570 module := package module. |
574 module := package module. |
571 directory := package directory. |
575 directory := package directory. |
572 |
576 |
|
577 makeCommand := ParserFlags makeCommand. |
|
578 usedCompiler = 'vc' ifTrue:[ makeCommand := 'vcmake'. compilerFlag := 'USEVC=1' ]. |
|
579 usedCompiler = 'lcc' ifTrue:[ makeCommand := 'lcmake'. compilerFlag := 'USELCC=1' ]. |
|
580 usedCompiler = 'gcc' ifTrue:[ makeCommand := 'make'. ]. |
|
581 |
573 projectDefinitionClass isLibraryDefinition ifTrue:[ |
582 projectDefinitionClass isLibraryDefinition ifTrue:[ |
574 OperatingSystem |
583 OperatingSystem |
575 executeCommand:(ParserFlags makeCommand,' classLibRule') |
584 executeCommand:(makeCommand,' classLibRule') |
576 inputFrom:nil |
585 inputFrom:nil |
577 outputTo:stdOut |
586 outputTo:stdOut |
578 errorTo:stdErr |
587 errorTo:stdErr |
579 inDirectory:(buildDirectory / module / directory) |
588 inDirectory:(buildDirectory / module / directory) |
580 onError:[:status| self error:'make failed']. |
589 onError:[:status| self error:'make failed']. |
581 ] ifFalse:[ |
590 ] ifFalse:[ |
582 OperatingSystem |
591 OperatingSystem |
583 executeCommand:(ParserFlags makeCommand,' exe') |
592 executeCommand:(makeCommand,' exe') |
584 inputFrom:nil |
593 inputFrom:nil |
585 outputTo:stdOut |
594 outputTo:stdOut |
586 errorTo:stdErr |
595 errorTo:stdErr |
587 inDirectory:(buildDirectory / module / directory) |
596 inDirectory:(buildDirectory / module / directory) |
588 onError:[:status| self error:'make failed']. |
597 onError:[:status| self error:'make failed']. |
589 |
598 |
590 (makeExeOnly ? false) ifFalse:[ |
599 (makeExeOnly ? false) ifFalse:[ |
591 OperatingSystem |
600 OperatingSystem |
592 executeCommand:(ParserFlags makeCommand,' setup') |
601 executeCommand:(makeCommand,' setup') |
593 inputFrom:nil |
602 inputFrom:nil |
594 outputTo:stdOut |
603 outputTo:stdOut |
595 errorTo:stdErr |
604 errorTo:stdErr |
596 inDirectory:(buildDirectory / module / directory) |
605 inDirectory:(buildDirectory / module / directory) |
597 onError:[:status| self error:'make failed']. |
606 onError:[:status| self error:'make failed']. |