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