some tries for UNIX - unfinished
authorsr
Fri, 23 Oct 2009 15:38:38 +0200
changeset 2683ff39502be3a2
parent 2682 54418b0e52fb
child 2684 80fe0f753fd8
some tries for UNIX - unfinished
ProjectBuilder.st
     1.1 --- a/ProjectBuilder.st	Fri Oct 23 15:38:34 2009 +0200
     1.2 +++ b/ProjectBuilder.st	Fri Oct 23 15:38:38 2009 +0200
     1.3 @@ -72,6 +72,10 @@
     1.4      projectDefinitionClass := something.
     1.5  !
     1.6  
     1.7 +suffixForHeaderFiles
     1.8 +    ^ OperatingSystem isUNIXlike ifTrue:['.H'] ifFalse:['.STH']
     1.9 +!
    1.10 +
    1.11  usedCompiler:something
    1.12      usedCompiler := something.
    1.13  ! !
    1.14 @@ -106,10 +110,10 @@
    1.15                              makeOutput emphasis:nil.
    1.16                          ]
    1.17                      ];
    1.18 -                    nextPutAllBlock:[:char |
    1.19 -                        lock critical:[
    1.20 +                    nextPutAllBlock:[:string |
    1.21 +                        lock critical:[          (string includesString:'das Ziel' )ifTrue:[self halt].
    1.22                              makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}.
    1.23 -                            makeOutput nextPutAll:char.
    1.24 +                            makeOutput nextPutAll:string.
    1.25                              makeOutput emphasis:nil.
    1.26                          ]
    1.27                      ].
    1.28 @@ -119,9 +123,9 @@
    1.29                              makeOutput nextPut:char.
    1.30                          ]
    1.31                      ];
    1.32 -                    nextPutAllBlock:[:char |
    1.33 -                        lock critical:[
    1.34 -                            makeOutput nextPutAll:char.
    1.35 +                    nextPutAllBlock:[:string |
    1.36 +                        lock critical:[         (string includesString:'das Ziel' )ifTrue:[self halt].
    1.37 +                            makeOutput nextPutAll:string.
    1.38                          ]
    1.39                      ].
    1.40  
    1.41 @@ -299,6 +303,11 @@
    1.42              sourceFile copyTo:targetFile
    1.43          ].
    1.44      ].
    1.45 +
    1.46 +    OperatingSystem isUNIXlike ifTrue:[
    1.47 +        (targetDir / 'stc') makeExecutableForAll    
    1.48 +    ].
    1.49 +
    1.50      self activityNotification:nil
    1.51  !
    1.52  
    1.53 @@ -344,7 +353,6 @@
    1.54                   ).
    1.55      ] ifFalse:[
    1.56          files := #(
    1.57 -                    'librun/genDate'
    1.58                      'librun/main.c'
    1.59                      'librun/librun.so'
    1.60                  )
    1.61 @@ -427,7 +435,7 @@
    1.62  #endif /* _HEADER_CLASSINST_ */
    1.63  '.
    1.64      newContents := template bindWithArguments:bindings.
    1.65 -    file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),'.STH').
    1.66 +    file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),(self suffixForHeaderFiles)).
    1.67      (file exists not
    1.68      or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[
    1.69          file contents: newContents.
    1.70 @@ -579,6 +587,16 @@
    1.71      usedCompiler = 'lcc' ifTrue:[ makeCommand := 'lcmake'. compilerFlag := 'USELCC=1' ].
    1.72      usedCompiler = 'gcc' ifTrue:[ makeCommand := 'make'. ].
    1.73  
    1.74 +    OperatingSystem isUNIXlike ifTrue:[
    1.75 +        OperatingSystem
    1.76 +            executeCommand:'sh ../../stx/rules/stmkmf'
    1.77 +            inputFrom:nil
    1.78 +            outputTo:stdOut
    1.79 +            errorTo:stdErr
    1.80 +            inDirectory:(buildDirectory / module / directory)
    1.81 +            onError:[:status| self error:'make failed'].
    1.82 +    ].
    1.83 +
    1.84      projectDefinitionClass isLibraryDefinition ifTrue:[
    1.85          OperatingSystem
    1.86              executeCommand:(makeCommand,' classLibRule')
    1.87 @@ -608,6 +626,19 @@
    1.88      ]
    1.89  !
    1.90  
    1.91 +recursiveCopyDirectoryForBuild:subdir
    1.92 +    |targetDir|
    1.93 +
    1.94 +    targetDir := buildDirectory / 'stx' / subdir.
    1.95 +    targetDir exists ifFalse:[
    1.96 +        targetDir makeDirectory.
    1.97 +    ].
    1.98 +    (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
    1.99 +        eachFile recursiveCopyTo:(targetDir construct:eachFile baseName)
   1.100 +    ].
   1.101 +    self activityNotification:nil
   1.102 +!
   1.103 +
   1.104  setupBuildDirectory
   1.105      buildDirectory exists ifFalse:[
   1.106          buildDirectory recursiveMakeDirectory.
   1.107 @@ -618,6 +649,9 @@
   1.108  
   1.109      self copyDirectoryForBuild:'include'.
   1.110      self copyDirectoryForBuild:'rules'.
   1.111 +    OperatingSystem isUNIXlike ifTrue:[
   1.112 +        self recursiveCopyDirectoryForBuild:'configurations'.
   1.113 +    ]
   1.114  !
   1.115  
   1.116  validateBuildDirectoryIsPresent