author | Claus Gittinger <cg@exept.de> |
Tue, 07 May 2013 19:54:33 +0200 | |
changeset 3008 | 68256b19f036 |
parent 3006 | 741e3e2f0270 |
child 3041 | 380d18b00312 |
permissions | -rw-r--r-- |
2741 | 1 |
" |
2 |
COPYRIGHT (c) 2009 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2596 | 12 |
"{ Package: 'stx:libtool2' }" |
13 |
||
2635 | 14 |
"{ NameSpace: Tools }" |
15 |
||
2596 | 16 |
Object subclass:#ProjectBuilder |
17 |
instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory |
|
2673 | 18 |
myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream |
2972 | 19 |
makeExeOnly makeQuick usedCompiler stdOut stdErr isQuickBuild |
20 |
isLocalBuild' |
|
2596 | 21 |
classVariableNames:'PreviousBuildDirectory' |
22 |
poolDictionaries:'' |
|
23 |
category:'System-Support-Projects' |
|
24 |
! |
|
25 |
||
2741 | 26 |
!ProjectBuilder class methodsFor:'documentation'! |
27 |
||
28 |
copyright |
|
29 |
" |
|
30 |
COPYRIGHT (c) 2009 by eXept Software AG |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! ! |
|
2596 | 41 |
|
2633 | 42 |
!ProjectBuilder class methodsFor:'accessing'! |
43 |
||
44 |
previousBuildDirectory |
|
45 |
^ PreviousBuildDirectory |
|
46 |
! |
|
47 |
||
48 |
previousBuildDirectory:something |
|
49 |
PreviousBuildDirectory := something. |
|
50 |
! ! |
|
51 |
||
2596 | 52 |
!ProjectBuilder class methodsFor:'examples'! |
53 |
||
2644 | 54 |
example1 |
55 |
Smalltalk loadPackage:'stx:projects/helloWorldApp' asAutoloaded:true. |
|
56 |
||
57 |
self new |
|
58 |
package:'stx:projects/helloWorldApp'; |
|
59 |
build |
|
2622 | 60 |
! |
61 |
||
2644 | 62 |
example2 |
63 |
|builder| |
|
64 |
||
65 |
Smalltalk loadPackage:'stx:clients/Demos/foxCalcApplication' asAutoloaded:true. |
|
66 |
||
67 |
builder := self new. |
|
2909 | 68 |
builder |
69 |
package:'stx:clients/Demos/foxCalcApplication'; |
|
70 |
build. |
|
2644 | 71 |
|
72 |
UserPreferences fileBrowserClass openOnDirectory:builder packageBuildDirectory. |
|
2909 | 73 |
|
74 |
"Modified: / 03-09-2012 / 19:23:53 / cg" |
|
2596 | 75 |
! ! |
76 |
||
2873 | 77 |
!ProjectBuilder class methodsFor:'queries'! |
78 |
||
79 |
defaultUsedCompiler |
|
80 |
|compiler| |
|
81 |
||
82 |
(compiler := UserPreferences current usedCompilerForBuild) notNil ifTrue:[ |
|
83 |
^ compiler |
|
84 |
]. |
|
85 |
||
3006
741e3e2f0270
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
3001
diff
changeset
|
86 |
^ ParserFlags usedCompiler |
2873 | 87 |
! |
88 |
||
89 |
listOfPossibleCompilers |
|
90 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
2918 | 91 |
OperatingSystem getLoginName = 'cg' ifTrue:[ |
2921 | 92 |
^ #( |
93 |
'bcc' "/ OK |
|
94 |
'vc' "/ almost OK |
|
95 |
'lcc' "/ experimental, but only free for non-commercial work |
|
96 |
'tcc' "/ experimental; limited but free |
|
97 |
'mingw' "/ experimental; free |
|
98 |
) |
|
2918 | 99 |
]. |
2972 | 100 |
^ #('bcc' 'vc' 'mingw' ) |
2873 | 101 |
]. |
102 |
^ #('gcc') |
|
103 |
||
104 |
"Created: / 21-01-2012 / 14:04:15 / cg" |
|
2921 | 105 |
! |
106 |
||
107 |
suiteNameOfCompiler:usedCompiler |
|
108 |
usedCompiler = 'bcc' ifTrue:[ |
|
109 |
^ 'Borland C-Compiler'. |
|
110 |
]. |
|
111 |
usedCompiler = 'vc' ifTrue:[ |
|
2974
8cf2b51872fd
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2972
diff
changeset
|
112 |
^ 'Microsoft Visual C Compiler'. |
2921 | 113 |
]. |
114 |
usedCompiler = 'lcc' ifTrue:[ |
|
115 |
^ 'LCC C-Compiler'. |
|
116 |
]. |
|
117 |
usedCompiler = 'tcc' ifTrue:[ |
|
118 |
^ 'Tiny C-Compiler'. |
|
119 |
]. |
|
120 |
usedCompiler = 'gcc' ifTrue:[ |
|
121 |
^ 'GNU C-Compiler'. |
|
122 |
]. |
|
123 |
usedCompiler = 'mingw' ifTrue:[ |
|
124 |
^ 'MINGW GNU C-Compiler'. |
|
125 |
]. |
|
126 |
self halt:'unknown compiler'. |
|
127 |
||
128 |
^ 'C-Compiler'. |
|
129 |
||
130 |
"Created: / 06-09-2012 / 15:58:33 / cg" |
|
2873 | 131 |
! ! |
132 |
||
2596 | 133 |
!ProjectBuilder methodsFor:'accessing'! |
134 |
||
2644 | 135 |
buildDirectory |
136 |
^ buildDirectory |
|
2622 | 137 |
! |
138 |
||
2634 | 139 |
buildDirectory:something |
140 |
buildDirectory := something. |
|
141 |
! |
|
142 |
||
2964
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
143 |
isLocalBuild |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
144 |
^ isLocalBuild ? false |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
145 |
! |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
146 |
|
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
147 |
isLocalBuild:aBoolean |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
148 |
"create a files without going through the source code manager" |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
149 |
|
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
150 |
isLocalBuild := aBoolean. |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
151 |
! |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
152 |
|
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
153 |
isQuickBuild |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
154 |
^ isQuickBuild ? false |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
155 |
! |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
156 |
|
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
157 |
isQuickBuild:aBoolean |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
158 |
"skips creation of header files, and copying of support files, if possible |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
159 |
to speedup a build. Use with care." |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
160 |
|
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
161 |
isQuickBuild := aBoolean. |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
162 |
! |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
163 |
|
2972 | 164 |
makeExeOnly |
165 |
^ (makeExeOnly ? false) |
|
166 |
! |
|
167 |
||
2673 | 168 |
makeExeOnly:aBoolean |
169 |
makeExeOnly := aBoolean. |
|
170 |
! |
|
171 |
||
2972 | 172 |
makeQuick |
173 |
^ (makeQuick ? false) |
|
174 |
! |
|
175 |
||
176 |
makeQuick:aBoolean |
|
177 |
makeQuick := aBoolean. |
|
178 |
! |
|
179 |
||
2644 | 180 |
package:aPackageIDOrSymbol |
181 |
package := aPackageIDOrSymbol asPackageId. |
|
2596 | 182 |
! |
183 |
||
2644 | 184 |
packageBuildDirectory |
185 |
"the directoray, where the deployable binary is created (xxxSetup.exe)" |
|
2622 | 186 |
|
187 |
^ buildDirectory / (package asPackageId module) / (package asPackageId directory) |
|
2635 | 188 |
! |
189 |
||
2644 | 190 |
projectDefinitionClass:something |
191 |
projectDefinitionClass := something. |
|
2680 | 192 |
! |
193 |
||
2683 | 194 |
suffixForHeaderFiles |
195 |
^ OperatingSystem isUNIXlike ifTrue:['.H'] ifFalse:['.STH'] |
|
196 |
! |
|
197 |
||
2873 | 198 |
usedCompilerForBuild:something |
2680 | 199 |
usedCompiler := something. |
2873 | 200 |
|
201 |
"Created: / 22-01-2012 / 10:50:48 / cg" |
|
2596 | 202 |
! ! |
203 |
||
204 |
!ProjectBuilder methodsFor:'building'! |
|
205 |
||
2644 | 206 |
build |
207 |
"/ intermediate - this will move into a commonly used utility class |
|
2635 | 208 |
"/ (where all the project code support will be collected). |
209 |
||
2647 | 210 |
|makeOutput| |
211 |
||
212 |
makeOutput := TextStream on:(Text new:10000). |
|
213 |
self buildWithColorizedOutputTo:makeOutput. |
|
214 |
||
215 |
TextView openWith:makeOutput contents. |
|
216 |
! |
|
217 |
||
218 |
buildWithColorizedOutputTo:makeOutput |
|
219 |
"/ intermediate - this will move into a commonly used utility class |
|
220 |
"/ (where all the project code support will be collected). |
|
221 |
||
2921 | 222 |
|lock| |
2635 | 223 |
|
2644 | 224 |
lock := Semaphore forMutualExclusion. |
2647 | 225 |
|
2644 | 226 |
stdErr := ActorStream new |
227 |
nextPutBlock:[:char | |
|
228 |
lock critical:[ |
|
2921 | 229 |
makeOutput |
230 |
withEmphasis:{#backgroundColor->Color red. #color->Color white.} |
|
231 |
do:[makeOutput nextPut:char]. |
|
2644 | 232 |
] |
233 |
]; |
|
2683 | 234 |
nextPutAllBlock:[:string | |
2873 | 235 |
lock critical:[ |
2921 | 236 |
makeOutput |
237 |
withEmphasis:{#backgroundColor->Color red. #color->Color white.} |
|
238 |
do:[makeOutput nextPutAll:string]. |
|
2644 | 239 |
] |
240 |
]. |
|
241 |
stdOut := ActorStream new |
|
242 |
nextPutBlock:[:char | |
|
243 |
lock critical:[ |
|
244 |
makeOutput nextPut:char. |
|
245 |
] |
|
246 |
]; |
|
2683 | 247 |
nextPutAllBlock:[:string | |
2873 | 248 |
lock critical:[ |
2683 | 249 |
makeOutput nextPutAll:string. |
2644 | 250 |
] |
251 |
]. |
|
2635 | 252 |
|
2644 | 253 |
self buildWithOutputTo:stdOut errorTo:stdErr. |
2873 | 254 |
|
2921 | 255 |
"Modified: / 06-09-2012 / 16:15:50 / cg" |
2611 | 256 |
! |
257 |
||
2969 | 258 |
buildWithOutputTo:stdOutArg errorTo:stdErrArg |
2611 | 259 |
"/ intermediate - this will move into a commonly used utility class |
260 |
"/ (where all the project code support will be collected). |
|
261 |
||
2596 | 262 |
|module directory| |
263 |
||
264 |
projectDefinitionClass := ProjectDefinition definitionClassForPackage:package. |
|
265 |
projectDefinitionClass isNil ifTrue:[ |
|
266 |
self error:('Missing ProjectDefinition class for "',package asString,'"') |
|
267 |
]. |
|
268 |
||
269 |
"/ ensure that everything is loaded... |
|
270 |
projectDefinitionClass loadAsAutoloaded:false. |
|
271 |
projectDefinitionClass loadExtensions. |
|
272 |
projectDefinitionClass loadAllClassesAsAutoloaded:false. |
|
273 |
||
274 |
module := package module. |
|
275 |
directory := package directory. |
|
276 |
||
277 |
buildDirectory isNil ifTrue:[ |
|
2634 | 278 |
buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ]. |
279 |
buildDirectory isNil ifTrue:[ |
|
280 |
buildDirectory := Filename tempDirectory construct:'stx_build'. |
|
281 |
]. |
|
2596 | 282 |
]. |
283 |
buildDirectory := buildDirectory asFilename. |
|
284 |
||
285 |
"/ self validateBuildDirectoryIsPresent. |
|
286 |
||
287 |
PreviousBuildDirectory := buildDirectory. |
|
288 |
||
289 |
"/ UserPreferences current localBuild:true |
|
2964
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
290 |
(self isLocalBuild or:[UserPreferences current localBuild]) ifFalse:[ |
2596 | 291 |
SourceCodeManager notNil ifTrue:[ |
2861
b8c6e02e60a1
Do not call obsolete methods in SourceCodeManager class
Stefan Vogel <sv@exept.de>
parents:
2852
diff
changeset
|
292 |
sourceCodeManager := SourceCodeManagerUtilities default sourceCodeManagerFor:projectDefinitionClass. |
2596 | 293 |
] |
294 |
]. |
|
295 |
sourceCodeManager := nil. |
|
296 |
||
2598 | 297 |
myTopDirectory := |
2596 | 298 |
Smalltalk packagePath |
299 |
detect:[:aPath | |
|
300 |
(aPath asFilename / 'stx' / 'include') exists |
|
301 |
and: [ (aPath asFilename / 'stx' / 'rules') exists ]] |
|
302 |
ifNone:nil. |
|
2598 | 303 |
myTopDirectory isNil ifTrue:[ |
304 |
self error:('Cannot figure out my top directory (where stx/include and stx/rules are)') |
|
2596 | 305 |
]. |
2598 | 306 |
myTopDirectory := myTopDirectory asFilename. |
307 |
mySTXTopDirectory := myTopDirectory / 'stx'. |
|
2613
b8d38caaa884
changed: #buildWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2612
diff
changeset
|
308 |
|
2972 | 309 |
self makeQuick ifFalse:[ |
310 |
self setupBuildDirectory. |
|
311 |
self activityNotification:'Generating stc directory...'. |
|
312 |
self copySTCDirectoryForBuild. |
|
313 |
]. |
|
2628 | 314 |
self activityNotification:'Generating source files...'. |
2596 | 315 |
self generateSourceFiles. |
2972 | 316 |
self makeQuick ifFalse:[ |
317 |
self activityNotification:'Copying dlls for linkage...'. |
|
318 |
self copyDLLsForLinkage. |
|
319 |
self activityNotification:'Copying support files for compilation and linkage...'. |
|
320 |
self copySupportFilesForCompilation. |
|
321 |
self copySupportFilesForLinkage. |
|
322 |
self copyStartupFilesFromSmalltalk. |
|
323 |
]. |
|
2628 | 324 |
self activityNotification:'Executing make...'. |
2611 | 325 |
self makeWithOutputTo:stdOut errorTo:stdErr. |
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
326 |
|
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
327 |
"Modified: / 04-09-2012 / 00:49:52 / cg" |
2898 | 328 |
! ! |
329 |
||
330 |
!ProjectBuilder methodsFor:'building/private'! |
|
2596 | 331 |
|
2644 | 332 |
copyDLLsForLinkage |
2911 | 333 |
|targetBuildDir preRequisites dllRelativeSourcePathes dllRelativeDestPathes| |
2723 | 334 |
|
2644 | 335 |
targetBuildDir := buildDirectory / package module / package directory. |
336 |
||
2723 | 337 |
preRequisites := projectDefinitionClass allPreRequisites. |
338 |
OperatingSystem isUNIXlike ifTrue:[ |
|
339 |
"For now: unix Makefiles require some libs implicitely..." |
|
340 |
preRequisites := preRequisites union:#( |
|
2979 | 341 |
#'stx:goodies/refactoryBrowser/parser' |
342 |
#'stx:libtool' |
|
2723 | 343 |
). |
344 |
]. |
|
345 |
||
346 |
preRequisites do:[:eachPackageToFileout | |
|
2644 | 347 |
|packageId packageDef packageModule packageDirectory packageTargetDir |
2911 | 348 |
dllSource dllSourceDir libraryName dllRelativePathSource |
2916 | 349 |
dllRelativePathDest objDirSource objDirDest alternativeObjDirSource| |
2644 | 350 |
|
351 |
packageId := eachPackageToFileout asPackageId. |
|
352 |
packageModule := packageId module. |
|
353 |
packageDirectory := packageId directory. |
|
354 |
packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. |
|
355 |
||
356 |
packageDef := packageId projectDefinitionClass. |
|
357 |
libraryName := packageDef libraryName. |
|
358 |
||
359 |
"/ mhmh - take them from my tree or from the projects/smalltalk execution directory ?? |
|
360 |
dllSourceDir := myTopDirectory / packageModule / packageDirectory. |
|
2909 | 361 |
|
2644 | 362 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
2911 | 363 |
objDirDest := self objDirForUsedCompiler:usedCompiler. |
2916 | 364 |
objDirSource := objDirDest. |
365 |
"/ "/ use visual-c files for tcc linkage |
|
366 |
"/ usedCompiler = 'tcc' ifTrue:[ |
|
367 |
"/ objDirSource := self objDirForUsedCompiler:'vc'. |
|
368 |
"/ ] ifFalse:[ |
|
369 |
"/ objDirSource := objDirDest |
|
370 |
"/ ]. |
|
371 |
(dllSourceDir / objDirSource / (libraryName, '.dll')) exists ifFalse:[ |
|
372 |
alternativeObjDirSource := self objDirForUsedCompiler:'vc'. |
|
373 |
(dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[ |
|
2921 | 374 |
objDirSource := alternativeObjDirSource. |
375 |
stdErr nextPutLine:(('Warning: using alternative %1 from %2 (%3 version)...' |
|
376 |
bindWith:libraryName |
|
377 |
with:alternativeObjDirSource |
|
378 |
with:(self class suiteNameOfCompiler:'vc')) |
|
379 |
emphasizeAllWith:(#color -> Color red darkened)). |
|
380 |
] ifFalse:[ |
|
381 |
alternativeObjDirSource := self objDirForUsedCompiler:'bcc'. |
|
382 |
(dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[ |
|
383 |
objDirSource := alternativeObjDirSource. |
|
384 |
stdErr nextPutLine:('Warning: using alternative %1 from %2 (%3 version)...' |
|
385 |
bindWith:libraryName |
|
386 |
with:alternativeObjDirSource |
|
387 |
with:(self class suiteNameOfCompiler:'bcc')). |
|
388 |
] |
|
389 |
]. |
|
2911 | 390 |
]. |
2916 | 391 |
|
2905 | 392 |
"/ dllRelativePath := objDir,'/',(libraryName,'.dll'). |
2644 | 393 |
"/ (dllSourceDir / dllRelativePath) exists |
2911 | 394 |
dllRelativeSourcePathes := Array with:(objDirSource,'\', libraryName, '.dll'). |
395 |
dllRelativeDestPathes := Array with:(objDirDest,'\', libraryName, '.dll'). |
|
2644 | 396 |
] ifFalse:[ |
2911 | 397 |
dllRelativeSourcePathes := Array with:(libraryName,'.so'). |
2958
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
398 |
dllRelativeDestPathes := Array with:(libraryName, '.so'). |
2723 | 399 |
(packageModule = 'stx' and:[packageDirectory = 'libview']) ifTrue:[ |
2958
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
400 |
dllRelativeSourcePathes := dllRelativeSourcePathes copyWith:('XWorkstation.so'). |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
401 |
dllRelativeDestPathes := dllRelativeDestPathes copyWith:'XWorkstation.so'. |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
402 |
dllRelativeSourcePathes := dllRelativeSourcePathes copyWith:('GLXWorkstation.so'). |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
403 |
dllRelativeDestPathes := dllRelativeDestPathes copyWith:'GLXWorkstation.so'. |
2723 | 404 |
]. |
2644 | 405 |
]. |
2911 | 406 |
dllRelativeSourcePathes with:dllRelativeDestPathes do:[:dllRelativeSourcePath :dllRelativeDestPath| |
2896
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
407 |
|source dest| |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
408 |
|
2911 | 409 |
source := dllSourceDir / dllRelativeSourcePath. |
2958
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
410 |
source exists ifFalse:[ |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
411 |
self activityNotification:' skip missing file: ',source pathName. |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
412 |
] ifTrue:[ |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
413 |
dest := packageTargetDir / dllRelativeDestPath. |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
414 |
(dest exists not |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
415 |
or:[source fileSize ~= dest fileSize |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
416 |
or:[source modificationTime >= dest modificationTime |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
417 |
"/ or:[ ((dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath)) not ] |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
418 |
]]) ifTrue:[ |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
419 |
Transcript showCR:'updating ',dllRelativeDestPath. |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
420 |
dest directory recursiveMakeDirectory. |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
421 |
source copyTo:dest. |
2986
1175ca171983
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2985
diff
changeset
|
422 |
self activityNotification:' ',dest pathName |
2958
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
423 |
]. |
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
424 |
] |
2723 | 425 |
]. |
2644 | 426 |
]. |
2896
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
427 |
|
2921 | 428 |
"Modified: / 06-09-2012 / 16:19:29 / cg" |
2644 | 429 |
! |
430 |
||
431 |
copyDirectory:relativepath |
|
432 |
"/ need rules in stx |
|
433 |
((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:relativepath) |
|
434 |
recursiveCopyTo:(buildDirectory construct:'stx'). |
|
435 |
! |
|
436 |
||
437 |
copyDirectoryForBuild:subdir |
|
438 |
|targetDir targetFile| |
|
439 |
||
440 |
targetDir := buildDirectory / 'stx' / subdir. |
|
441 |
targetDir exists ifFalse:[ |
|
442 |
targetDir makeDirectory. |
|
2964
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
443 |
] ifTrue:[ |
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
444 |
self isQuickBuild ifTrue:[^ self] |
2644 | 445 |
]. |
446 |
(mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile | |
|
447 |
eachFile isDirectory ifFalse:[ |
|
448 |
targetFile := targetDir / eachFile baseName. |
|
449 |
(targetFile exists not |
|
450 |
or:[ targetFile modificationTime < eachFile modificationTime ]) ifTrue:[ |
|
451 |
self activityNotification:'copying ',eachFile pathName,'...'. |
|
452 |
eachFile copyTo:(targetDir construct:eachFile baseName) |
|
453 |
] |
|
454 |
]. |
|
455 |
]. |
|
456 |
self activityNotification:nil |
|
457 |
! |
|
458 |
||
459 |
copyResourcesForPackage:aPackage |
|
2981
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
460 |
|module directory myPackageDirectory rsrcDir stylesDir| |
2644 | 461 |
|
462 |
module := aPackage asPackageId module. |
|
463 |
directory := aPackage asPackageId directory. |
|
464 |
||
2981
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
465 |
myPackageDirectory := myTopDirectory / module / directory. |
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
466 |
|
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
467 |
(rsrcDir := myPackageDirectory / 'resources' ) exists ifTrue:[ |
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
468 |
rsrcDir recursiveCopyTo:(buildDirectory / module / directory) |
2644 | 469 |
]. |
2981
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
470 |
(stylesDir := myPackageDirectory / 'styles' ) exists ifTrue:[ |
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
471 |
stylesDir recursiveCopyTo:(buildDirectory / module / directory) |
2644 | 472 |
]. |
473 |
! |
|
474 |
||
475 |
copySTCDirectoryForBuild |
|
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
476 |
"copy stc files to the build directory" |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
477 |
|
2644 | 478 |
|targetDir stc files| |
479 |
||
480 |
targetDir := buildDirectory / 'stx' / 'stc'. |
|
481 |
targetDir exists ifFalse:[ targetDir makeDirectory ]. |
|
482 |
||
483 |
stc := OperatingSystem isMSWINDOWSlike |
|
484 |
ifTrue:[ 'stc.exe' ] |
|
485 |
ifFalse:[ 'stc' ]. |
|
486 |
||
487 |
files := #( ) copyWith:stc. |
|
488 |
||
489 |
files do:[:eachFile | |
|
490 |
|sourceFile targetFile| |
|
491 |
||
492 |
sourceFile := mySTXTopDirectory / 'stc' / eachFile. |
|
493 |
targetFile := targetDir / eachFile. |
|
494 |
(targetFile exists not |
|
495 |
or:[ targetFile modificationTime < sourceFile modificationTime ]) ifTrue:[ |
|
496 |
self activityNotification:'copying ',sourceFile pathName,'...'. |
|
497 |
sourceFile copyTo:targetFile |
|
498 |
]. |
|
499 |
]. |
|
2683 | 500 |
|
501 |
OperatingSystem isUNIXlike ifTrue:[ |
|
502 |
(targetDir / 'stc') makeExecutableForAll |
|
503 |
]. |
|
504 |
||
2644 | 505 |
self activityNotification:nil |
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
506 |
|
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
507 |
"Modified (comment): / 04-09-2012 / 00:49:19 / cg" |
2644 | 508 |
! |
509 |
||
510 |
copyStartupFilesFromSmalltalk |
|
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
511 |
"copy additional smalltalk startup files to the build directory" |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
512 |
|
2644 | 513 |
(buildDirectory / 'stx' / 'projects/smalltalk' ) exists ifFalse:[ |
514 |
(buildDirectory / 'stx' / 'projects/smalltalk' ) recursiveMakeDirectory. |
|
515 |
]. |
|
516 |
||
2678
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
517 |
#( |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
518 |
'keyboard.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
519 |
'keyboardMacros.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
520 |
'display.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
521 |
'd_win32.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
522 |
'host.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
523 |
'h_win32.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
524 |
'smalltalk.rc' |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
525 |
'private.rc' |
2644 | 526 |
) do:[:fn | |
527 |
(myTopDirectory / 'stx' / 'projects/smalltalk' / fn) |
|
528 |
copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / fn) |
|
2678
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
529 |
]. |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
530 |
|
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
531 |
(myTopDirectory / 'stx' / 'doc/online/english/LICENCE_STX.html') |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
532 |
copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / 'LICENCE_STX.html'). |
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
533 |
|
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
534 |
"Modified (comment): / 04-09-2012 / 00:48:47 / cg" |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
535 |
! |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
536 |
|
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
537 |
copySupportFilesForCompilation |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
538 |
"copy the tcc compiler to the build directory" |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
539 |
|
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
540 |
|files| |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
541 |
|
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
542 |
files := #(). |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
543 |
|
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
544 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
2984
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
545 |
files := files , #( |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
546 |
'librun/genDate.com' |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
547 |
). |
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
548 |
usedCompiler = 'tcc' ifTrue:[ |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
549 |
files := files , #( |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
550 |
'support/tcc' |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
551 |
). |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
552 |
]. |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
553 |
] ifFalse:[ |
2984
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
554 |
files := files , #( |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
555 |
"/ 'librun/genDate' -- not needed on unix (done via script) |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
556 |
'configurations/myConf' |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
557 |
'configurations/vendorConf' |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
558 |
'configurations/conf.inc' |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
559 |
'configurations/COMMON' |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
560 |
). |
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
561 |
]. |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
562 |
|
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
563 |
files do:[:relativePath | |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
564 |
(mySTXTopDirectory / relativePath) exists ifTrue:[ |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
565 |
((buildDirectory / 'stx' / relativePath) exists |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
566 |
and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
567 |
and:[ (mySTXTopDirectory / relativePath) modificationTime < (buildDirectory / 'stx' / relativePath) modificationTime |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
568 |
"/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ] |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
569 |
]]) ifFalse:[ |
2984
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
570 |
(buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory. |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
571 |
(mySTXTopDirectory / relativePath) isDirectory ifTrue:[ |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
572 |
(mySTXTopDirectory / relativePath) recursiveCopyTo:(buildDirectory / 'stx' / relativePath) directory. |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
573 |
] ifFalse:[ |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
574 |
(mySTXTopDirectory / relativePath) copyTo:(buildDirectory / 'stx' / relativePath) directory. |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
575 |
] |
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
576 |
] |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
577 |
] ifFalse:[ |
2984
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
578 |
self error:'Missing file or directory: ',relativePath printString mayProceed:true. |
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
579 |
]. |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
580 |
]. |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
581 |
|
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
582 |
"Created: / 04-09-2012 / 00:47:49 / cg" |
2644 | 583 |
! |
584 |
||
585 |
copySupportFilesForLinkage |
|
2912
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
586 |
"copy additional files which are req'd for linkage to the build directory" |
6e62954c5f35
added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents:
2911
diff
changeset
|
587 |
|
2644 | 588 |
|files| |
589 |
||
590 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
591 |
files := #( |
|
2969 | 592 |
'librun/genDate.com' |
2644 | 593 |
'librun/main.c' |
2673 | 594 |
'projects/smalltalk/stx_16x16.ico' |
595 |
'projects/smalltalk/stx_32x32.ico' |
|
596 |
'projects/smalltalk/stx_splash.bmp' |
|
2644 | 597 |
). |
2905 | 598 |
|
599 |
usedCompiler = 'bcc' ifTrue:[ |
|
600 |
files := files , #( |
|
601 |
'librun/objbc/librun.dll' |
|
602 |
'support/win32/borland/cs3245.dll' |
|
603 |
'support/win32/X11.dll' |
|
604 |
'support/win32/Xext.dll' |
|
2916 | 605 |
'lib/bc/librun.lib' |
606 |
'lib/bc/cs32i.lib' |
|
2905 | 607 |
). |
608 |
]. |
|
609 |
usedCompiler = 'vc' ifTrue:[ |
|
610 |
files := files , #( |
|
611 |
'librun/objvc/librun.dll' |
|
2916 | 612 |
'lib/vc/librun.lib' |
2905 | 613 |
). |
614 |
]. |
|
2911 | 615 |
usedCompiler = 'tcc' ifTrue:[ |
616 |
files := files , #( |
|
2916 | 617 |
'librun/objvc/librun.dll' "/ linkage is against vc version!! |
618 |
'lib/vc/librun.lib' |
|
619 |
). |
|
620 |
]. |
|
621 |
usedCompiler = 'lcc' ifTrue:[ |
|
622 |
files := files , #( |
|
623 |
'librun/objvc/librun.dll' "/ linkage is against vc version!! |
|
624 |
'lib/vc/librun.lib' |
|
2911 | 625 |
). |
626 |
]. |
|
2918 | 627 |
usedCompiler = 'mingw' ifTrue:[ |
628 |
files := files , #( |
|
2972 | 629 |
'librun/objmingw/librun.dll' "/ linkage is against vc version!! |
630 |
'lib/mingw/librun.lib' |
|
2918 | 631 |
). |
632 |
]. |
|
2644 | 633 |
] ifFalse:[ |
634 |
files := #( |
|
635 |
'librun/main.c' |
|
636 |
'librun/librun.so' |
|
637 |
) |
|
638 |
]. |
|
2677
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
639 |
files := files asOrderedCollection. |
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
640 |
|
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
641 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
642 |
projectDefinitionClass applicationIconFileName notNil ifTrue:[ |
2678
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
643 |
files add:('projects/smalltalk/',projectDefinitionClass applicationIconFileName,'.ico') |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
644 |
]. |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
645 |
projectDefinitionClass splashFileName notNil ifTrue:[ |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
646 |
files add:('projects/smalltalk/',projectDefinitionClass splashFileName,'.bmp') |
cca2788228ad
added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents:
2677
diff
changeset
|
647 |
]. |
2677
e2c24a1be97f
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2673
diff
changeset
|
648 |
]. |
2644 | 649 |
|
2914
745b9c77b599
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2912
diff
changeset
|
650 |
files do:[:relativePath | |
745b9c77b599
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2912
diff
changeset
|
651 |
(mySTXTopDirectory / relativePath) exists ifTrue:[ |
745b9c77b599
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2912
diff
changeset
|
652 |
((buildDirectory / 'stx' / relativePath) exists |
745b9c77b599
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2912
diff
changeset
|
653 |
and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize |
745b9c77b599
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2912
diff
changeset
|
654 |
and:[ (mySTXTopDirectory / relativePath) modificationTime < (buildDirectory / 'stx' / relativePath) modificationTime |
2684 | 655 |
"/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ] |
656 |
]]) ifFalse:[ |
|
2914
745b9c77b599
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2912
diff
changeset
|
657 |
(buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory. |
745b9c77b599
changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents:
2912
diff
changeset
|
658 |
(mySTXTopDirectory / relativePath) copyTo:(buildDirectory / 'stx' / relativePath). |
2684 | 659 |
] |
660 |
] ifFalse:[ |
|
2971
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
661 |
"/ does not really help: objbc/librun.lib does not work with MSVC and vice versa... |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
662 |
"/ ((relativePath = 'librun/objvc/librun.dll') |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
663 |
"/ and:[ (mySTXTopDirectory / 'librun/objbc/librun.dll') exists ])ifTrue:[ |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
664 |
"/ stdErr nextPutLine:('Warning: using alternative librun from objbc (Borland version)...'). |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
665 |
"/ (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory. |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
666 |
"/ (mySTXTopDirectory / 'librun/objbc/librun.dll') copyTo:(buildDirectory / 'stx' / relativePath). |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
667 |
"/ ] ifFalse:[ |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
668 |
"/ ((relativePath = 'librun/objbc/librun.dll') |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
669 |
"/ and:[ (mySTXTopDirectory / 'librun/objvc/librun.dll') exists ])ifTrue:[ |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
670 |
"/ stdErr nextPutLine:('Warning: using alternative librun from objvc (MSVC version)...'). |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
671 |
"/ (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory. |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
672 |
"/ (mySTXTopDirectory / 'librun/objvc/librun.dll') copyTo:(buildDirectory / 'stx' / relativePath). |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
673 |
"/ ] ifFalse:[ |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
674 |
self error:'Missing file: ',relativePath printString mayProceed:true. |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
675 |
"/ ] |
e10937c35748
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2969
diff
changeset
|
676 |
"/ ] |
2684 | 677 |
]. |
2614 | 678 |
]. |
2873 | 679 |
|
2918 | 680 |
"Modified: / 05-09-2012 / 16:26:25 / cg" |
2600 | 681 |
! |
682 |
||
2644 | 683 |
createHeaderFileFor:aClass in:packageTargetDir |
684 |
|instVarList classInstVarList classVarList bindings superclassFilename |
|
685 |
template file newContents oldContents| |
|
686 |
||
687 |
instVarList := StringCollection new. |
|
688 |
aClass instVarNames do:[:v | |
|
689 |
instVarList add:('OBJ %1;' bindWith:v) |
|
690 |
]. |
|
691 |
classInstVarList := StringCollection new. |
|
692 |
aClass class instVarNames do:[:v | |
|
2961 | 693 |
"/ (v includes:$_) ifTrue:[self halt]. |
2644 | 694 |
classInstVarList add:('OBJ %1;' bindWith:v) |
695 |
]. |
|
696 |
classVarList := StringCollection new. |
|
697 |
aClass classVarNames do:[:v | |
|
698 |
classVarList add:('extern OBJ %1_%2;' bindWith:aClass name with:v) |
|
699 |
]. |
|
2614 | 700 |
|
2644 | 701 |
bindings := Dictionary new. |
702 |
bindings at:'ClassName' put:aClass name. |
|
703 |
aClass superclass isNil ifTrue:[ |
|
704 |
bindings at:'SuperclassName' put:'-'. |
|
2852 | 705 |
bindings at:'SuperclassFileInclude' put:''. |
2644 | 706 |
] ifFalse:[ |
707 |
bindings at:'SuperclassName' put:aClass superclass name. |
|
708 |
bindings at:'SuperclassFileName' put:(superclassFilename := Smalltalk fileNameForClass:aClass superclass). |
|
709 |
bindings at:'SuperclassFileInclude' put:('#include "%1.STH"' bindWith:superclassFilename). |
|
710 |
]. |
|
711 |
bindings at:'InstVarList' put:instVarList asString. |
|
712 |
bindings at:'ClassVarList' put:classVarList asString. |
|
713 |
bindings at:'ClassInstVarList' put:classInstVarList asString. |
|
714 |
||
715 |
template := |
|
716 |
'/* This file was generated by ProjectBuilder. */ |
|
717 |
/* !!!!!!!! Do not change by hand !!!!!!!! */ |
|
718 |
||
719 |
/* Class: %(ClassName) */ |
|
720 |
/* Superclass: %(SuperclassName) */ |
|
721 |
||
722 |
%(SuperclassFileInclude) |
|
723 |
||
724 |
/* INDIRECTGLOBALS */ |
|
725 |
#ifdef _HEADER_INST_ |
|
726 |
%(InstVarList) |
|
727 |
#endif /* _HEADER_INST_ */ |
|
728 |
||
729 |
#ifdef _HEADER_CLASS_ |
|
730 |
%(ClassVarList) |
|
731 |
#endif /* _HEADER_CLASS_ */ |
|
732 |
||
733 |
#ifdef _HEADER_CLASSINST_ |
|
734 |
%(ClassInstVarList) |
|
735 |
#endif /* _HEADER_CLASSINST_ */ |
|
736 |
'. |
|
737 |
newContents := template bindWithArguments:bindings. |
|
2683 | 738 |
file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),(self suffixForHeaderFiles)). |
2644 | 739 |
(file exists not |
740 |
or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[ |
|
741 |
file contents: newContents. |
|
742 |
]. |
|
2852 | 743 |
|
744 |
"Modified: / 15-08-2011 / 14:58:46 / cg" |
|
2614 | 745 |
! |
746 |
||
2644 | 747 |
generateSourceFiles |
2964
44fd164ad253
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2961
diff
changeset
|
748 |
(self isLocalBuild not and:[ sourceCodeManager notNil ]) ifTrue:[ |
2644 | 749 |
"/ check out / generate files there |
750 |
self generateSourceFilesByCheckingOutUsing:sourceCodeManager |
|
751 |
] ifFalse:[ |
|
752 |
"/ local build |
|
753 |
"/ fileout the project |
|
754 |
self generateSourceFilesByFilingOut |
|
755 |
] |
|
2599 | 756 |
! |
757 |
||
2644 | 758 |
generateSourceFilesByCheckingOutUsing:aSourceCodeManager |
759 |
"/ will no longer be needed/supported |
|
760 |
||
761 |
|repository stxRepository module directory| |
|
762 |
||
2868
8a4d46fd157c
changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents:
2861
diff
changeset
|
763 |
self breakPoint:#cg. |
8a4d46fd157c
changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents:
2861
diff
changeset
|
764 |
|
2644 | 765 |
"/ check out / generate files there |
766 |
repository := (aSourceCodeManager repositoryNameForModule:module) ifNil:[aSourceCodeManager repositoryName]. |
|
767 |
stxRepository := aSourceCodeManager repositoryName. |
|
2600 | 768 |
|
2644 | 769 |
(buildDirectory construct:'stx') exists ifFalse:[ |
770 |
(module ~= 'stx') ifTrue:[ |
|
771 |
OperatingSystem |
|
772 |
executeCommand:('cvs -d ',stxRepository,' co stx') |
|
773 |
inputFrom:nil |
|
774 |
outputTo:Transcript |
|
775 |
errorTo:Transcript |
|
776 |
inDirectory:buildDirectory |
|
777 |
onError:[:status| self error:'cvs update stx failed']. |
|
778 |
]. |
|
779 |
]. |
|
2635 | 780 |
|
2644 | 781 |
((buildDirectory construct:module) construct:'CVS') exists ifFalse:[ |
782 |
OperatingSystem |
|
783 |
executeCommand:('cvs -d ',repository,' co -l ',directory) |
|
784 |
inputFrom:nil |
|
785 |
outputTo:Transcript |
|
786 |
errorTo:Transcript |
|
787 |
inDirectory:buildDirectory |
|
788 |
onError:[:status| self error:'cvs update failed']. |
|
789 |
]. |
|
790 |
OperatingSystem |
|
791 |
executeCommand:'cvs upd -d' |
|
792 |
inputFrom:nil |
|
793 |
outputTo:Transcript |
|
794 |
errorTo:Transcript |
|
795 |
inDirectory:(buildDirectory construct:module) |
|
796 |
onError:[:status| self error:'cvs update failed']. |
|
797 |
self halt. |
|
2868
8a4d46fd157c
changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents:
2861
diff
changeset
|
798 |
|
8a4d46fd157c
changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents:
2861
diff
changeset
|
799 |
"Modified: / 29-12-2011 / 14:02:56 / cg" |
2600 | 800 |
! |
801 |
||
2644 | 802 |
generateSourceFilesByFilingOut |
803 |
"/ local build |
|
804 |
"/ fileout the project |
|
805 |
||
2844
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
806 |
|fullPathName| |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
807 |
|
2644 | 808 |
(package module ~= 'stx') ifTrue:[ |
809 |
(buildDirectory / package module) makeDirectory. |
|
810 |
]. |
|
811 |
||
812 |
"/ file out the package(s) which are to be built |
|
813 |
((Array with:package)) |
|
814 |
do:[:eachPackageToFileout | |
|
2981
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
815 |
|packageId packageModule packageDirectory packageTargetDir packageDef extSource| |
2644 | 816 |
|
817 |
packageId := eachPackageToFileout asPackageId. |
|
818 |
packageModule := packageId module. |
|
819 |
packageDirectory := packageId directory. |
|
820 |
packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. |
|
821 |
||
822 |
packageDef := packageId projectDefinitionClass. |
|
823 |
(packageDef compiled_classNames_common , |
|
824 |
packageDef compiled_classNamesForPlatform) do:[:eachClassName | |
|
825 |
|cls fileName newSource| |
|
826 |
||
827 |
cls := Smalltalk classNamed:eachClassName. |
|
828 |
self assert:cls isLoaded. |
|
829 |
fileName := (Smalltalk fileNameForClass:cls),'.st'. |
|
830 |
fileName := packageTargetDir asFilename construct:fileName. |
|
831 |
fileName exists ifTrue:[ |
|
832 |
newSource := String streamContents:[:s | cls fileOutOn:s withTimeStamp:false]. |
|
833 |
newSource = fileName contentsAsString ifFalse:[ |
|
834 |
fileName contents:newSource |
|
835 |
]. |
|
836 |
] ifFalse:[ |
|
837 |
cls fileOutIn:packageTargetDir withTimeStamp:false |
|
838 |
]. |
|
839 |
]. |
|
2596 | 840 |
|
2981
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
841 |
packageDef hasExtensionMethods ifTrue:[ |
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
842 |
extSource := |
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
843 |
String streamContents:[:s | |
2985
57ed21d4e926
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2984
diff
changeset
|
844 |
s nextPutAll:('"{ Package: ''%1'' }" !!\\' bindWith:packageDef package) withCRs. |
57ed21d4e926
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2984
diff
changeset
|
845 |
|
2981
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
846 |
packageDef extensionMethods do:[:eachMethod | |
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
847 |
eachMethod mclass fileOutMethod:eachMethod on:s |
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
848 |
]. |
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
849 |
]. |
2987
f3895651ef5f
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2986
diff
changeset
|
850 |
extSource isWideString ifTrue:[ |
f3895651ef5f
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2986
diff
changeset
|
851 |
extSource := ( '"{ Encoding: utf8 }"' , Character cr asString, Character cr asString, extSource). |
f3895651ef5f
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2986
diff
changeset
|
852 |
extSource := extSource utf8Encoded. |
f3895651ef5f
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2986
diff
changeset
|
853 |
]. |
2985
57ed21d4e926
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2984
diff
changeset
|
854 |
(packageTargetDir asFilename construct:'extensions.st') contents:extSource |
2981
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
855 |
]. |
e61e4a6fb317
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2979
diff
changeset
|
856 |
|
2644 | 857 |
"/ (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls | |
858 |
"/ cls isPrivate ifFalse:[ |
|
859 |
"/ cls isLoaded ifFalse:[ |
|
860 |
"/ self halt. |
|
861 |
"/ cls autoload. |
|
862 |
"/ ]. |
|
863 |
"/ cls fileOutIn:packageTargetDir |
|
864 |
"/ ] |
|
865 |
"/ ]. |
|
866 |
||
867 |
projectDefinitionClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents | |
|
2844
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
868 |
fullPathName := packageTargetDir construct:fileName. |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
869 |
fullPathName directory exists ifFalse:[ |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
870 |
"take care for files like 'autopackage/default.apspec'" |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
871 |
fullPathName directory makeDirectory. |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
872 |
]. |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
873 |
(fullPathName exists |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
874 |
and:[ fullPathName contents = fileContents ]) ifFalse:[ |
5e4e46856d8d
changed: #generateSourceFilesByFilingOut
Stefan Vogel <sv@exept.de>
parents:
2793
diff
changeset
|
875 |
fullPathName contents:fileContents. |
2644 | 876 |
]. |
877 |
]. |
|
878 |
]. |
|
2972 | 879 |
self makeQuick ifFalse:[ |
880 |
"/ generate header files in prerequisite packages... |
|
881 |
(projectDefinitionClass allPreRequisites) |
|
882 |
do:[:eachPackageToFileout | |
|
883 |
|packageId packageDef packageModule packageDirectory packageTargetDir| |
|
2596 | 884 |
|
2972 | 885 |
packageId := eachPackageToFileout asPackageId. |
886 |
packageModule := packageId module. |
|
887 |
packageDirectory := packageId directory. |
|
888 |
packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. |
|
2644 | 889 |
|
2972 | 890 |
packageDef := packageId projectDefinitionClass. |
891 |
(packageDef compiled_classNames_common , |
|
892 |
packageDef compiled_classNamesForPlatform) do:[:eachClassName | |
|
893 |
|cls| |
|
2644 | 894 |
|
2972 | 895 |
cls := Smalltalk classNamed:eachClassName. |
896 |
"/ self assert:cls isLoaded. |
|
897 |
cls isNil ifTrue:[ |
|
898 |
stdErr nextPutLine:('Missing class: ',eachClassName, ' (not present in system. Warning only:subclasses of it will not be compiled)'). |
|
899 |
] ifFalse:[ |
|
900 |
cls isLoaded ifTrue:[ |
|
901 |
self createHeaderFileFor:cls in:packageTargetDir |
|
902 |
] |
|
903 |
]. |
|
2644 | 904 |
]. |
2972 | 905 |
self copyResourcesForPackage:eachPackageToFileout. |
2644 | 906 |
]. |
907 |
]. |
|
908 |
||
909 |
"/ stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic') |
|
2596 | 910 |
! |
911 |
||
2909 | 912 |
makeCommandOfCompiler:usedCompiler |
913 |
usedCompiler = 'bcc' ifTrue:[ |
|
914 |
^ 'bmake'. |
|
915 |
]. |
|
916 |
usedCompiler = 'vc' ifTrue:[ |
|
917 |
^ 'vcmake'. "/ compilerFlag := '-DUSEVC' |
|
918 |
]. |
|
919 |
usedCompiler = 'lcc' ifTrue:[ |
|
920 |
^ 'lccmake'. "/ compilerFlag := '-DUSELCC' |
|
921 |
]. |
|
922 |
usedCompiler = 'tcc' ifTrue:[ |
|
923 |
^ 'tccmake'. "/ compilerFlag := '-DUSELCC' |
|
924 |
]. |
|
2918 | 925 |
usedCompiler = 'mingw' ifTrue:[ |
2921 | 926 |
^ 'mingwmake'. "/ compilerFlag := '-DUSEMINGW' |
2909 | 927 |
]. |
2989
fce70ea7d5d7
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2987
diff
changeset
|
928 |
true "usedCompiler = 'gcc'" ifTrue:[ |
fce70ea7d5d7
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2987
diff
changeset
|
929 |
^ 'make'. "/ compilerFlag := '-DUSEGCC' |
fce70ea7d5d7
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2987
diff
changeset
|
930 |
]. |
2909 | 931 |
self error:'unknown compiler specified'. |
932 |
||
933 |
"Created: / 03-09-2012 / 19:46:07 / cg" |
|
934 |
! |
|
935 |
||
2644 | 936 |
makeWithOutputTo:stdOut errorTo:stdErr |
2909 | 937 |
|module directory makeCommand| |
2644 | 938 |
|
939 |
module := package module. |
|
940 |
directory := package directory. |
|
941 |
||
2680 | 942 |
makeCommand := ParserFlags makeCommand. |
2895
2b939399b83b
changed: #makeWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2873
diff
changeset
|
943 |
usedCompiler isNil ifTrue:[ |
2b939399b83b
changed: #makeWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2873
diff
changeset
|
944 |
usedCompiler := ParserFlags usedCompiler. |
2b939399b83b
changed: #makeWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents:
2873
diff
changeset
|
945 |
]. |
2909 | 946 |
makeCommand := self makeCommandOfCompiler:usedCompiler. |
2873 | 947 |
|
2852 | 948 |
"/ makeCommand := makeCommand, ' TOP=', mySTXTopDirectory pathName. |
2680 | 949 |
|
2683 | 950 |
OperatingSystem isUNIXlike ifTrue:[ |
2921 | 951 |
"/ generate the makefile first |
2984
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
952 |
self activityNotification:('sh %1/rules/stmkmf (in %2)' |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
953 |
bindWith:mySTXTopDirectory pathName |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
954 |
with:(buildDirectory / module / directory)). |
2683 | 955 |
OperatingSystem |
2845
0d52c66fbc8e
changed: #makeWithOutputTo:errorTo:
Stefan Vogel <sv@exept.de>
parents:
2844
diff
changeset
|
956 |
executeCommand:('sh %1/rules/stmkmf' bindWith:mySTXTopDirectory pathName) |
2683 | 957 |
inputFrom:nil |
958 |
outputTo:stdOut |
|
959 |
errorTo:stdErr |
|
960 |
inDirectory:(buildDirectory / module / directory) |
|
2921 | 961 |
onError:[:status | self error:'make failed']. |
2683 | 962 |
]. |
963 |
||
2644 | 964 |
projectDefinitionClass isLibraryDefinition ifTrue:[ |
2921 | 965 |
"/ generate the library |
2969 | 966 |
self activityNotification:(makeCommand,' classLibRule'). |
2644 | 967 |
OperatingSystem |
2989
fce70ea7d5d7
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2987
diff
changeset
|
968 |
executeCommand:(makeCommand,' classLibRule FORCE=') |
2644 | 969 |
inputFrom:nil |
970 |
outputTo:stdOut |
|
971 |
errorTo:stdErr |
|
972 |
inDirectory:(buildDirectory / module / directory) |
|
2921 | 973 |
onError:[:status | self error:'make failed']. |
2644 | 974 |
] ifFalse:[ |
2972 | 975 |
(self makeExeOnly) ifTrue:[ |
2969 | 976 |
self activityNotification:(makeCommand,' exe'). |
977 |
OperatingSystem |
|
978 |
"/ generate the executable |
|
2989
fce70ea7d5d7
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2987
diff
changeset
|
979 |
executeCommand:(makeCommand,' exe FORCE=') |
2969 | 980 |
inputFrom:nil |
981 |
outputTo:stdOut |
|
982 |
errorTo:stdErr |
|
983 |
inDirectory:(buildDirectory / module / directory) |
|
984 |
onError:[:status | self error:'make failed']. |
|
2644 | 985 |
|
2969 | 986 |
] ifFalse:[ |
2921 | 987 |
"/ generate the self-installable package |
2969 | 988 |
self activityNotification:(makeCommand,' ALL_NP'). |
2673 | 989 |
OperatingSystem |
2969 | 990 |
executeCommand:(makeCommand,' ALL_NP') |
2673 | 991 |
inputFrom:nil |
992 |
outputTo:stdOut |
|
993 |
errorTo:stdErr |
|
994 |
inDirectory:(buildDirectory / module / directory) |
|
2921 | 995 |
onError:[:status | self error:'make failed']. |
2673 | 996 |
] |
2644 | 997 |
] |
2793 | 998 |
|
2909 | 999 |
"Modified: / 03-09-2012 / 19:47:15 / cg" |
2921 | 1000 |
"Modified (comment): / 06-09-2012 / 16:22:38 / cg" |
2596 | 1001 |
! |
1002 |
||
2905 | 1003 |
objDirForUsedCompiler |
2909 | 1004 |
^ self objDirForUsedCompiler:usedCompiler |
1005 |
||
1006 |
"Created: / 20-08-2012 / 17:01:13 / cg" |
|
1007 |
! |
|
1008 |
||
1009 |
objDirForUsedCompiler:usedCompiler |
|
2918 | 1010 |
usedCompiler = 'gcc' ifTrue:[^ 'obj']. "/ unix case |
1011 |
||
2905 | 1012 |
usedCompiler = 'bcc' ifTrue:[^ 'objbc']. |
1013 |
usedCompiler = 'vc' ifTrue:[^ 'objvc']. |
|
2909 | 1014 |
usedCompiler = 'tcc' ifTrue:[^ 'objtcc']. |
1015 |
usedCompiler = 'lcc' ifTrue:[^ 'objlcc']. |
|
2918 | 1016 |
usedCompiler = 'mingw' ifTrue:[^ 'objmingw']. |
2961 | 1017 |
self halt:'please add compiler here'. |
2905 | 1018 |
^ 'objbc' |
1019 |
||
2909 | 1020 |
"Created: / 03-09-2012 / 19:55:34 / cg" |
2905 | 1021 |
! |
1022 |
||
2683 | 1023 |
recursiveCopyDirectoryForBuild:subdir |
1024 |
|targetDir| |
|
1025 |
||
1026 |
targetDir := buildDirectory / 'stx' / subdir. |
|
1027 |
targetDir exists ifFalse:[ |
|
1028 |
targetDir makeDirectory. |
|
1029 |
]. |
|
1030 |
(mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile | |
|
1031 |
eachFile recursiveCopyTo:(targetDir construct:eachFile baseName) |
|
1032 |
]. |
|
1033 |
self activityNotification:nil |
|
1034 |
! |
|
1035 |
||
2644 | 1036 |
setupBuildDirectory |
2984
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
1037 |
self activityNotification:('Building in %1' bindWith:buildDirectory pathName). |
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
1038 |
|
2644 | 1039 |
buildDirectory exists ifFalse:[ |
1040 |
buildDirectory recursiveMakeDirectory. |
|
1041 |
]. |
|
1042 |
(buildDirectory / 'stx') exists ifFalse:[ |
|
1043 |
(buildDirectory / 'stx') makeDirectory. |
|
1044 |
]. |
|
1045 |
||
1046 |
self copyDirectoryForBuild:'include'. |
|
1047 |
self copyDirectoryForBuild:'rules'. |
|
2984
bfb6db857ea8
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
1048 |
|
2683 | 1049 |
OperatingSystem isUNIXlike ifTrue:[ |
1050 |
self recursiveCopyDirectoryForBuild:'configurations'. |
|
1051 |
] |
|
2611 | 1052 |
! |
1053 |
||
2644 | 1054 |
validateBuildDirectoryIsPresent |
1055 |
||
1056 |
^ self. |
|
2596 | 1057 |
|
2644 | 1058 |
"/ [ |
1059 |
"/ |default directoryIsOKForMe stc | |
|
1060 |
"/ |
|
1061 |
"/ default := (buildDirectory ? |
|
1062 |
"/ PreviousBuildDirectory) |
|
1063 |
"/ ifNil:[ UserPreferences current buildDirectory]. |
|
1064 |
"/ |
|
1065 |
"/ buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:' |
|
1066 |
"/ default:default. |
|
1067 |
"/ |
|
1068 |
"/ buildDirectory isEmptyOrNil ifTrue:[^ self]. |
|
1069 |
"/ buildDirectory := buildDirectory asFilename. |
|
1070 |
"/ directoryIsOKForMe := true. |
|
1071 |
"/ |
|
1072 |
"/ buildDirectory exists ifFalse:[ |
|
1073 |
"/ Dialog warn:(self classResources string:'Work directory %1 does not exist.' with:buildDirectory). |
|
1074 |
"/ directoryIsOKForMe := false. |
|
1075 |
"/ ] ifTrue:[ |
|
1076 |
"/ (buildDirectory construct:'stx') exists ifFalse:[ |
|
1077 |
"/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.'). |
|
1078 |
"/ directoryIsOKForMe := false. |
|
1079 |
"/ ] ifTrue:[ |
|
1080 |
"/ stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc']. |
|
1081 |
"/ (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[ |
|
1082 |
"/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stc compiler in the stx/stc subDirectory.'). |
|
1083 |
"/ directoryIsOKForMe := false. |
|
1084 |
"/ ]. |
|
1085 |
"/ ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[ |
|
1086 |
"/ Dialog warn:(self classResources stringWithCRs:'Work directory must have had a make run before (for include files to exists).'). |
|
1087 |
"/ directoryIsOKForMe := false. |
|
1088 |
"/ ]. |
|
1089 |
"/ ] |
|
1090 |
"/ ]. |
|
1091 |
"/ directoryIsOKForMe |
|
1092 |
"/ ] whileFalse |
|
2596 | 1093 |
! ! |
1094 |
||
1095 |
!ProjectBuilder class methodsFor:'documentation'! |
|
1096 |
||
2896
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
1097 |
version |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
1098 |
^ '$Header$' |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
1099 |
! |
6ed90332dbda
changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents:
2895
diff
changeset
|
1100 |
|
2596 | 1101 |
version_CVS |
1102 |
^ '$Header$' |
|
1103 |
! ! |
|
2958
d842f4a91d44
class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents:
2921
diff
changeset
|
1104 |