cg@2741: " cg@2741: COPYRIGHT (c) 2009 by eXept Software AG cg@2741: All Rights Reserved cg@2741: cg@2741: This software is furnished under a license and may be used cg@2741: only in accordance with the terms of that license and with the cg@2741: inclusion of the above copyright notice. This software may not cg@2741: be provided or otherwise made available to, or used by, any cg@2741: other person. No title to or ownership of the software is cg@2741: hereby transferred. cg@2741: " cg@2596: "{ Package: 'stx:libtool2' }" cg@2596: cg@2635: "{ NameSpace: Tools }" cg@2635: cg@2596: Object subclass:#ProjectBuilder cg@2596: instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory cg@2673: myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream cg@2972: makeExeOnly makeQuick usedCompiler stdOut stdErr isQuickBuild cg@2972: isLocalBuild' cg@2596: classVariableNames:'PreviousBuildDirectory' cg@2596: poolDictionaries:'' cg@2596: category:'System-Support-Projects' cg@2596: ! cg@2596: cg@2741: !ProjectBuilder class methodsFor:'documentation'! cg@2741: cg@2741: copyright cg@2741: " cg@2741: COPYRIGHT (c) 2009 by eXept Software AG cg@2741: All Rights Reserved cg@2741: cg@2741: This software is furnished under a license and may be used cg@2741: only in accordance with the terms of that license and with the cg@2741: inclusion of the above copyright notice. This software may not cg@2741: be provided or otherwise made available to, or used by, any cg@2741: other person. No title to or ownership of the software is cg@2741: hereby transferred. cg@2741: " cg@2741: ! ! cg@2596: cg@2633: !ProjectBuilder class methodsFor:'accessing'! cg@2633: cg@2633: previousBuildDirectory cg@2633: ^ PreviousBuildDirectory cg@2633: ! cg@2633: cg@2633: previousBuildDirectory:something cg@2633: PreviousBuildDirectory := something. cg@2633: ! ! cg@2633: cg@2596: !ProjectBuilder class methodsFor:'examples'! cg@2596: cg@2644: example1 cg@2644: Smalltalk loadPackage:'stx:projects/helloWorldApp' asAutoloaded:true. cg@2644: cg@2644: self new cg@2644: package:'stx:projects/helloWorldApp'; cg@2644: build cg@2622: ! cg@2622: cg@2644: example2 cg@2644: |builder| cg@2644: cg@2644: Smalltalk loadPackage:'stx:clients/Demos/foxCalcApplication' asAutoloaded:true. cg@2644: cg@2644: builder := self new. cg@2909: builder cg@2909: package:'stx:clients/Demos/foxCalcApplication'; cg@2909: build. cg@2644: cg@2644: UserPreferences fileBrowserClass openOnDirectory:builder packageBuildDirectory. cg@2909: cg@2909: "Modified: / 03-09-2012 / 19:23:53 / cg" cg@2596: ! ! cg@2596: cg@2873: !ProjectBuilder class methodsFor:'queries'! cg@2873: cg@2873: defaultUsedCompiler cg@2873: |compiler| cg@2873: cg@2873: (compiler := UserPreferences current usedCompilerForBuild) notNil ifTrue:[ cg@2873: ^ compiler cg@2873: ]. cg@2873: cg@3006: ^ ParserFlags usedCompiler cg@2873: ! cg@2873: cg@2873: listOfPossibleCompilers cg@2873: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@2918: OperatingSystem getLoginName = 'cg' ifTrue:[ cg@2921: ^ #( cg@2921: 'bcc' "/ OK cg@2921: 'vc' "/ almost OK cg@2921: 'lcc' "/ experimental, but only free for non-commercial work cg@2921: 'tcc' "/ experimental; limited but free cg@2921: 'mingw' "/ experimental; free cg@2921: ) cg@2918: ]. cg@2972: ^ #('bcc' 'vc' 'mingw' ) cg@2873: ]. cg@2873: ^ #('gcc') cg@2873: cg@2873: "Created: / 21-01-2012 / 14:04:15 / cg" cg@2921: ! cg@2921: cg@2921: suiteNameOfCompiler:usedCompiler cg@2921: usedCompiler = 'bcc' ifTrue:[ cg@2921: ^ 'Borland C-Compiler'. cg@2921: ]. cg@2921: usedCompiler = 'vc' ifTrue:[ cg@2974: ^ 'Microsoft Visual C Compiler'. cg@2921: ]. cg@2921: usedCompiler = 'lcc' ifTrue:[ cg@2921: ^ 'LCC C-Compiler'. cg@2921: ]. cg@2921: usedCompiler = 'tcc' ifTrue:[ cg@2921: ^ 'Tiny C-Compiler'. cg@2921: ]. cg@2921: usedCompiler = 'gcc' ifTrue:[ cg@2921: ^ 'GNU C-Compiler'. cg@2921: ]. cg@2921: usedCompiler = 'mingw' ifTrue:[ cg@2921: ^ 'MINGW GNU C-Compiler'. cg@2921: ]. cg@2921: self halt:'unknown compiler'. cg@2921: cg@2921: ^ 'C-Compiler'. cg@2921: cg@2921: "Created: / 06-09-2012 / 15:58:33 / cg" cg@2873: ! ! cg@2873: cg@2596: !ProjectBuilder methodsFor:'accessing'! cg@2596: cg@2644: buildDirectory cg@2644: ^ buildDirectory cg@2622: ! cg@2622: cg@2634: buildDirectory:something cg@2634: buildDirectory := something. cg@2634: ! cg@2634: cg@2964: isLocalBuild cg@2964: ^ isLocalBuild ? false cg@2964: ! cg@2964: cg@2964: isLocalBuild:aBoolean cg@2964: "create a files without going through the source code manager" cg@2964: cg@2964: isLocalBuild := aBoolean. cg@2964: ! cg@2964: cg@2964: isQuickBuild cg@2964: ^ isQuickBuild ? false cg@2964: ! cg@2964: cg@2964: isQuickBuild:aBoolean cg@2964: "skips creation of header files, and copying of support files, if possible cg@2964: to speedup a build. Use with care." cg@2964: cg@2964: isQuickBuild := aBoolean. cg@2964: ! cg@2964: cg@2972: makeExeOnly cg@2972: ^ (makeExeOnly ? false) cg@2972: ! cg@2972: cg@2673: makeExeOnly:aBoolean cg@2673: makeExeOnly := aBoolean. cg@2673: ! cg@2673: cg@2972: makeQuick cg@2972: ^ (makeQuick ? false) cg@2972: ! cg@2972: cg@2972: makeQuick:aBoolean cg@2972: makeQuick := aBoolean. cg@2972: ! cg@2972: cg@2644: package:aPackageIDOrSymbol cg@2644: package := aPackageIDOrSymbol asPackageId. cg@2596: ! cg@2596: cg@2644: packageBuildDirectory cg@2644: "the directoray, where the deployable binary is created (xxxSetup.exe)" cg@2622: cg@2622: ^ buildDirectory / (package asPackageId module) / (package asPackageId directory) cg@2635: ! cg@2635: cg@2644: projectDefinitionClass:something cg@2644: projectDefinitionClass := something. cg@2680: ! cg@2680: sr@2683: suffixForHeaderFiles sr@2683: ^ OperatingSystem isUNIXlike ifTrue:['.H'] ifFalse:['.STH'] sr@2683: ! sr@2683: cg@2873: usedCompilerForBuild:something cg@2680: usedCompiler := something. cg@2873: cg@2873: "Created: / 22-01-2012 / 10:50:48 / cg" cg@2596: ! ! cg@2596: cg@2596: !ProjectBuilder methodsFor:'building'! cg@2596: cg@2644: build cg@2644: "/ intermediate - this will move into a commonly used utility class cg@2635: "/ (where all the project code support will be collected). cg@2635: cg@2647: |makeOutput| cg@2647: cg@2647: makeOutput := TextStream on:(Text new:10000). cg@2647: self buildWithColorizedOutputTo:makeOutput. cg@2647: cg@2647: TextView openWith:makeOutput contents. cg@2647: ! cg@2647: cg@2647: buildWithColorizedOutputTo:makeOutput cg@2647: "/ intermediate - this will move into a commonly used utility class cg@2647: "/ (where all the project code support will be collected). cg@2647: cg@2921: |lock| cg@2635: cg@2644: lock := Semaphore forMutualExclusion. cg@2647: cg@2644: stdErr := ActorStream new cg@2644: nextPutBlock:[:char | cg@2644: lock critical:[ cg@2921: makeOutput cg@2921: withEmphasis:{#backgroundColor->Color red. #color->Color white.} cg@2921: do:[makeOutput nextPut:char]. cg@2644: ] cg@2644: ]; sr@2683: nextPutAllBlock:[:string | cg@2873: lock critical:[ cg@2921: makeOutput cg@2921: withEmphasis:{#backgroundColor->Color red. #color->Color white.} cg@2921: do:[makeOutput nextPutAll:string]. cg@2644: ] cg@2644: ]. cg@2644: stdOut := ActorStream new cg@2644: nextPutBlock:[:char | cg@2644: lock critical:[ cg@2644: makeOutput nextPut:char. cg@2644: ] cg@2644: ]; sr@2683: nextPutAllBlock:[:string | cg@2873: lock critical:[ sr@2683: makeOutput nextPutAll:string. cg@2644: ] cg@2644: ]. cg@2635: cg@2644: self buildWithOutputTo:stdOut errorTo:stdErr. cg@2873: cg@2921: "Modified: / 06-09-2012 / 16:15:50 / cg" cg@2611: ! cg@2611: cg@2969: buildWithOutputTo:stdOutArg errorTo:stdErrArg cg@2611: "/ intermediate - this will move into a commonly used utility class cg@2611: "/ (where all the project code support will be collected). cg@2611: cg@2596: |module directory| cg@2596: cg@2596: projectDefinitionClass := ProjectDefinition definitionClassForPackage:package. cg@2596: projectDefinitionClass isNil ifTrue:[ cg@2596: self error:('Missing ProjectDefinition class for "',package asString,'"') cg@2596: ]. cg@2596: cg@2596: "/ ensure that everything is loaded... cg@2596: projectDefinitionClass loadAsAutoloaded:false. cg@2596: projectDefinitionClass loadExtensions. cg@2596: projectDefinitionClass loadAllClassesAsAutoloaded:false. cg@2596: cg@2596: module := package module. cg@2596: directory := package directory. cg@2596: cg@2596: buildDirectory isNil ifTrue:[ cg@2634: buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ]. cg@2634: buildDirectory isNil ifTrue:[ cg@2634: buildDirectory := Filename tempDirectory construct:'stx_build'. cg@2634: ]. cg@2596: ]. cg@2596: buildDirectory := buildDirectory asFilename. cg@2596: cg@2596: "/ self validateBuildDirectoryIsPresent. cg@2596: cg@2596: PreviousBuildDirectory := buildDirectory. cg@2596: cg@2596: "/ UserPreferences current localBuild:true cg@2964: (self isLocalBuild or:[UserPreferences current localBuild]) ifFalse:[ cg@2596: SourceCodeManager notNil ifTrue:[ sv@3043: sourceCodeManager := SourceCodeManagerUtilities sourceCodeManagerFor:projectDefinitionClass. cg@2596: ] cg@2596: ]. cg@2596: sourceCodeManager := nil. cg@2596: cg@2598: myTopDirectory := cg@2596: Smalltalk packagePath cg@2596: detect:[:aPath | cg@2596: (aPath asFilename / 'stx' / 'include') exists cg@2596: and: [ (aPath asFilename / 'stx' / 'rules') exists ]] cg@2596: ifNone:nil. cg@2598: myTopDirectory isNil ifTrue:[ cg@2598: self error:('Cannot figure out my top directory (where stx/include and stx/rules are)') cg@2596: ]. cg@2598: myTopDirectory := myTopDirectory asFilename. cg@2598: mySTXTopDirectory := myTopDirectory / 'stx'. cg@2613: cg@2972: self makeQuick ifFalse:[ cg@2972: self setupBuildDirectory. cg@2972: self activityNotification:'Generating stc directory...'. cg@2972: self copySTCDirectoryForBuild. cg@2972: ]. cg@2628: self activityNotification:'Generating source files...'. cg@2596: self generateSourceFiles. cg@2972: self makeQuick ifFalse:[ cg@2972: self activityNotification:'Copying dlls for linkage...'. cg@2972: self copyDLLsForLinkage. cg@2972: self activityNotification:'Copying support files for compilation and linkage...'. cg@2972: self copySupportFilesForCompilation. cg@2972: self copySupportFilesForLinkage. cg@2972: self copyStartupFilesFromSmalltalk. cg@2972: ]. cg@2628: self activityNotification:'Executing make...'. cg@2611: self makeWithOutputTo:stdOut errorTo:stdErr. cg@2912: cg@2912: "Modified: / 04-09-2012 / 00:49:52 / cg" cg@2898: ! ! cg@2898: cg@2898: !ProjectBuilder methodsFor:'building/private'! cg@2596: cg@2644: copyDLLsForLinkage cg@2911: |targetBuildDir preRequisites dllRelativeSourcePathes dllRelativeDestPathes| sv@2723: cg@2644: targetBuildDir := buildDirectory / package module / package directory. cg@2644: sv@2723: preRequisites := projectDefinitionClass allPreRequisites. sv@2723: OperatingSystem isUNIXlike ifTrue:[ sv@2723: "For now: unix Makefiles require some libs implicitely..." sv@2723: preRequisites := preRequisites union:#( sv@2979: #'stx:goodies/refactoryBrowser/parser' sv@2979: #'stx:libtool' sv@2723: ). sv@2723: ]. sv@2723: sv@2723: preRequisites do:[:eachPackageToFileout | cg@2644: |packageId packageDef packageModule packageDirectory packageTargetDir cg@2911: dllSource dllSourceDir libraryName dllRelativePathSource cg@2916: dllRelativePathDest objDirSource objDirDest alternativeObjDirSource| cg@2644: cg@2644: packageId := eachPackageToFileout asPackageId. cg@2644: packageModule := packageId module. cg@2644: packageDirectory := packageId directory. cg@2644: packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. cg@2644: cg@2644: packageDef := packageId projectDefinitionClass. cg@2644: libraryName := packageDef libraryName. cg@2644: cg@2644: "/ mhmh - take them from my tree or from the projects/smalltalk execution directory ?? cg@2644: dllSourceDir := myTopDirectory / packageModule / packageDirectory. cg@2909: cg@2644: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@2911: objDirDest := self objDirForUsedCompiler:usedCompiler. cg@2916: objDirSource := objDirDest. cg@2916: "/ "/ use visual-c files for tcc linkage cg@2916: "/ usedCompiler = 'tcc' ifTrue:[ cg@2916: "/ objDirSource := self objDirForUsedCompiler:'vc'. cg@2916: "/ ] ifFalse:[ cg@2916: "/ objDirSource := objDirDest cg@2916: "/ ]. cg@2916: (dllSourceDir / objDirSource / (libraryName, '.dll')) exists ifFalse:[ cg@2916: alternativeObjDirSource := self objDirForUsedCompiler:'vc'. cg@2916: (dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[ cg@2921: objDirSource := alternativeObjDirSource. cg@2921: stdErr nextPutLine:(('Warning: using alternative %1 from %2 (%3 version)...' cg@2921: bindWith:libraryName cg@2921: with:alternativeObjDirSource cg@2921: with:(self class suiteNameOfCompiler:'vc')) cg@2921: emphasizeAllWith:(#color -> Color red darkened)). cg@2921: ] ifFalse:[ cg@2921: alternativeObjDirSource := self objDirForUsedCompiler:'bcc'. cg@2921: (dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[ cg@2921: objDirSource := alternativeObjDirSource. cg@2921: stdErr nextPutLine:('Warning: using alternative %1 from %2 (%3 version)...' cg@2921: bindWith:libraryName cg@2921: with:alternativeObjDirSource cg@2921: with:(self class suiteNameOfCompiler:'bcc')). cg@2921: ] cg@2921: ]. cg@2911: ]. cg@2916: cg@2905: "/ dllRelativePath := objDir,'/',(libraryName,'.dll'). cg@2644: "/ (dllSourceDir / dllRelativePath) exists cg@2911: dllRelativeSourcePathes := Array with:(objDirSource,'\', libraryName, '.dll'). cg@2911: dllRelativeDestPathes := Array with:(objDirDest,'\', libraryName, '.dll'). cg@2644: ] ifFalse:[ cg@2911: dllRelativeSourcePathes := Array with:(libraryName,'.so'). cg@2958: dllRelativeDestPathes := Array with:(libraryName, '.so'). sv@2723: (packageModule = 'stx' and:[packageDirectory = 'libview']) ifTrue:[ cg@2958: dllRelativeSourcePathes := dllRelativeSourcePathes copyWith:('XWorkstation.so'). cg@2958: dllRelativeDestPathes := dllRelativeDestPathes copyWith:'XWorkstation.so'. cg@2958: dllRelativeSourcePathes := dllRelativeSourcePathes copyWith:('GLXWorkstation.so'). cg@2958: dllRelativeDestPathes := dllRelativeDestPathes copyWith:'GLXWorkstation.so'. sv@2723: ]. cg@2644: ]. cg@2911: dllRelativeSourcePathes with:dllRelativeDestPathes do:[:dllRelativeSourcePath :dllRelativeDestPath| cg@2896: |source dest| cg@2896: cg@2911: source := dllSourceDir / dllRelativeSourcePath. cg@2958: source exists ifFalse:[ cg@2958: self activityNotification:' skip missing file: ',source pathName. cg@2958: ] ifTrue:[ cg@2958: dest := packageTargetDir / dllRelativeDestPath. cg@2958: (dest exists not cg@2958: or:[source fileSize ~= dest fileSize cg@2958: or:[source modificationTime >= dest modificationTime cg@2958: "/ or:[ ((dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath)) not ] cg@2958: ]]) ifTrue:[ cg@2958: Transcript showCR:'updating ',dllRelativeDestPath. cg@2958: dest directory recursiveMakeDirectory. cg@2958: source copyTo:dest. cg@2986: self activityNotification:' ',dest pathName cg@3041: ] ifFalse:[ cg@3041: Transcript showCR:'already up-to-date: ',dllRelativeDestPath. cg@3041: ] cg@2958: ] sv@2723: ]. cg@2644: ]. cg@2896: cg@2921: "Modified: / 06-09-2012 / 16:19:29 / cg" cg@2644: ! cg@2644: cg@2644: copyDirectory:relativepath cg@2644: "/ need rules in stx cg@2644: ((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:relativepath) cg@2644: recursiveCopyTo:(buildDirectory construct:'stx'). cg@2644: ! cg@2644: cg@2644: copyDirectoryForBuild:subdir cg@2644: |targetDir targetFile| cg@2644: cg@2644: targetDir := buildDirectory / 'stx' / subdir. cg@2644: targetDir exists ifFalse:[ cg@2644: targetDir makeDirectory. cg@2964: ] ifTrue:[ cg@2964: self isQuickBuild ifTrue:[^ self] cg@2644: ]. cg@2644: (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile | cg@2644: eachFile isDirectory ifFalse:[ cg@2644: targetFile := targetDir / eachFile baseName. cg@2644: (targetFile exists not cg@2644: or:[ targetFile modificationTime < eachFile modificationTime ]) ifTrue:[ cg@2644: self activityNotification:'copying ',eachFile pathName,'...'. cg@2644: eachFile copyTo:(targetDir construct:eachFile baseName) cg@2644: ] cg@2644: ]. cg@2644: ]. cg@2644: self activityNotification:nil cg@2644: ! cg@2644: cg@2644: copyResourcesForPackage:aPackage cg@2981: |module directory myPackageDirectory rsrcDir stylesDir| cg@2644: cg@2644: module := aPackage asPackageId module. cg@2644: directory := aPackage asPackageId directory. cg@2644: cg@2981: myPackageDirectory := myTopDirectory / module / directory. cg@2981: cg@2981: (rsrcDir := myPackageDirectory / 'resources' ) exists ifTrue:[ cg@2981: rsrcDir recursiveCopyTo:(buildDirectory / module / directory) cg@2644: ]. cg@2981: (stylesDir := myPackageDirectory / 'styles' ) exists ifTrue:[ cg@2981: stylesDir recursiveCopyTo:(buildDirectory / module / directory) cg@2644: ]. cg@2644: ! cg@2644: cg@2644: copySTCDirectoryForBuild cg@2912: "copy stc files to the build directory" cg@2912: cg@2644: |targetDir stc files| cg@2644: cg@2644: targetDir := buildDirectory / 'stx' / 'stc'. cg@2644: targetDir exists ifFalse:[ targetDir makeDirectory ]. cg@2644: cg@2644: stc := OperatingSystem isMSWINDOWSlike cg@2644: ifTrue:[ 'stc.exe' ] cg@2644: ifFalse:[ 'stc' ]. cg@2644: cg@2644: files := #( ) copyWith:stc. cg@2644: cg@2644: files do:[:eachFile | cg@2644: |sourceFile targetFile| cg@2644: cg@2644: sourceFile := mySTXTopDirectory / 'stc' / eachFile. cg@2644: targetFile := targetDir / eachFile. cg@2644: (targetFile exists not cg@2644: or:[ targetFile modificationTime < sourceFile modificationTime ]) ifTrue:[ cg@2644: self activityNotification:'copying ',sourceFile pathName,'...'. cg@2644: sourceFile copyTo:targetFile cg@2644: ]. cg@2644: ]. sr@2683: sr@2683: OperatingSystem isUNIXlike ifTrue:[ sr@2683: (targetDir / 'stc') makeExecutableForAll sr@2683: ]. sr@2683: cg@2644: self activityNotification:nil cg@2912: cg@2912: "Modified (comment): / 04-09-2012 / 00:49:19 / cg" cg@2644: ! cg@2644: cg@2644: copyStartupFilesFromSmalltalk cg@2912: "copy additional smalltalk startup files to the build directory" cg@2912: cg@2644: (buildDirectory / 'stx' / 'projects/smalltalk' ) exists ifFalse:[ cg@2644: (buildDirectory / 'stx' / 'projects/smalltalk' ) recursiveMakeDirectory. cg@2644: ]. cg@2644: cg@2678: #( cg@2678: 'keyboard.rc' cg@2678: 'keyboardMacros.rc' cg@2678: 'display.rc' cg@2678: 'd_win32.rc' cg@2678: 'host.rc' cg@2678: 'h_win32.rc' cg@2678: 'smalltalk.rc' cg@2678: 'private.rc' cg@2644: ) do:[:fn | cg@2644: (myTopDirectory / 'stx' / 'projects/smalltalk' / fn) cg@2644: copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / fn) cg@2678: ]. cg@2678: cg@2678: (myTopDirectory / 'stx' / 'doc/online/english/LICENCE_STX.html') cg@2678: copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / 'LICENCE_STX.html'). cg@2912: cg@2912: "Modified (comment): / 04-09-2012 / 00:48:47 / cg" cg@2912: ! cg@2912: cg@2912: copySupportFilesForCompilation cg@2912: "copy the tcc compiler to the build directory" cg@2912: cg@2912: |files| cg@2912: cg@2912: files := #(). cg@2912: cg@2912: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@2984: files := files , #( cg@2984: 'librun/genDate.com' cg@2984: ). cg@2912: usedCompiler = 'tcc' ifTrue:[ cg@2912: files := files , #( cg@2912: 'support/tcc' cg@2912: ). cg@2912: ]. cg@2912: ] ifFalse:[ cg@2984: files := files , #( cg@2984: "/ 'librun/genDate' -- not needed on unix (done via script) cg@2984: 'configurations/myConf' cg@2984: 'configurations/vendorConf' cg@2984: 'configurations/conf.inc' cg@2984: 'configurations/COMMON' cg@2984: ). cg@2912: ]. cg@2912: cg@2912: files do:[:relativePath | cg@2912: (mySTXTopDirectory / relativePath) exists ifTrue:[ cg@2912: ((buildDirectory / 'stx' / relativePath) exists cg@2912: and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize cg@2912: and:[ (mySTXTopDirectory / relativePath) modificationTime < (buildDirectory / 'stx' / relativePath) modificationTime cg@2912: "/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ] cg@2912: ]]) ifFalse:[ cg@2984: (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory. cg@2984: (mySTXTopDirectory / relativePath) isDirectory ifTrue:[ cg@2984: (mySTXTopDirectory / relativePath) recursiveCopyTo:(buildDirectory / 'stx' / relativePath) directory. cg@2984: ] ifFalse:[ cg@2984: (mySTXTopDirectory / relativePath) copyTo:(buildDirectory / 'stx' / relativePath) directory. cg@2984: ] cg@2912: ] cg@2912: ] ifFalse:[ cg@2984: self error:'Missing file or directory: ',relativePath printString mayProceed:true. cg@2912: ]. cg@2912: ]. cg@2912: cg@2912: "Created: / 04-09-2012 / 00:47:49 / cg" cg@2644: ! cg@2644: cg@2644: copySupportFilesForLinkage cg@2912: "copy additional files which are req'd for linkage to the build directory" cg@2912: cg@2644: |files| cg@2644: cg@2644: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@2644: files := #( cg@2969: 'librun/genDate.com' cg@2644: 'librun/main.c' cg@2673: 'projects/smalltalk/stx_16x16.ico' cg@2673: 'projects/smalltalk/stx_32x32.ico' cg@2673: 'projects/smalltalk/stx_splash.bmp' cg@2644: ). cg@2905: cg@2905: usedCompiler = 'bcc' ifTrue:[ cg@2905: files := files , #( cg@2905: 'librun/objbc/librun.dll' cg@2905: 'support/win32/borland/cs3245.dll' cg@2905: 'support/win32/X11.dll' cg@2905: 'support/win32/Xext.dll' cg@2916: 'lib/bc/librun.lib' cg@2916: 'lib/bc/cs32i.lib' cg@2905: ). cg@2905: ]. cg@2905: usedCompiler = 'vc' ifTrue:[ cg@2905: files := files , #( cg@2905: 'librun/objvc/librun.dll' cg@2916: 'lib/vc/librun.lib' cg@2905: ). cg@2905: ]. cg@2911: usedCompiler = 'tcc' ifTrue:[ cg@2911: files := files , #( cg@2916: 'librun/objvc/librun.dll' "/ linkage is against vc version!! cg@2916: 'lib/vc/librun.lib' cg@2916: ). cg@2916: ]. cg@2916: usedCompiler = 'lcc' ifTrue:[ cg@2916: files := files , #( cg@2916: 'librun/objvc/librun.dll' "/ linkage is against vc version!! cg@2916: 'lib/vc/librun.lib' cg@2911: ). cg@2911: ]. cg@2918: usedCompiler = 'mingw' ifTrue:[ cg@2918: files := files , #( cg@2972: 'librun/objmingw/librun.dll' "/ linkage is against vc version!! cg@2972: 'lib/mingw/librun.lib' cg@2918: ). cg@2918: ]. cg@2644: ] ifFalse:[ cg@2644: files := #( cg@2644: 'librun/main.c' cg@2644: 'librun/librun.so' cg@2644: ) cg@2644: ]. cg@2677: files := files asOrderedCollection. cg@2677: cg@2677: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@2677: projectDefinitionClass applicationIconFileName notNil ifTrue:[ cg@2678: files add:('projects/smalltalk/',projectDefinitionClass applicationIconFileName,'.ico') cg@2678: ]. cg@2678: projectDefinitionClass splashFileName notNil ifTrue:[ cg@2678: files add:('projects/smalltalk/',projectDefinitionClass splashFileName,'.bmp') cg@2678: ]. cg@2677: ]. cg@2644: cg@2914: files do:[:relativePath | cg@2914: (mySTXTopDirectory / relativePath) exists ifTrue:[ cg@2914: ((buildDirectory / 'stx' / relativePath) exists cg@2914: and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize cg@2914: and:[ (mySTXTopDirectory / relativePath) modificationTime < (buildDirectory / 'stx' / relativePath) modificationTime sr@2684: "/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ] sr@2684: ]]) ifFalse:[ cg@2914: (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory. cg@2914: (mySTXTopDirectory / relativePath) copyTo:(buildDirectory / 'stx' / relativePath). sr@2684: ] sr@2684: ] ifFalse:[ cg@2971: "/ does not really help: objbc/librun.lib does not work with MSVC and vice versa... cg@2971: "/ ((relativePath = 'librun/objvc/librun.dll') cg@2971: "/ and:[ (mySTXTopDirectory / 'librun/objbc/librun.dll') exists ])ifTrue:[ cg@2971: "/ stdErr nextPutLine:('Warning: using alternative librun from objbc (Borland version)...'). cg@2971: "/ (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory. cg@2971: "/ (mySTXTopDirectory / 'librun/objbc/librun.dll') copyTo:(buildDirectory / 'stx' / relativePath). cg@2971: "/ ] ifFalse:[ cg@2971: "/ ((relativePath = 'librun/objbc/librun.dll') cg@2971: "/ and:[ (mySTXTopDirectory / 'librun/objvc/librun.dll') exists ])ifTrue:[ cg@2971: "/ stdErr nextPutLine:('Warning: using alternative librun from objvc (MSVC version)...'). cg@2971: "/ (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory. cg@2971: "/ (mySTXTopDirectory / 'librun/objvc/librun.dll') copyTo:(buildDirectory / 'stx' / relativePath). cg@2971: "/ ] ifFalse:[ cg@2971: self error:'Missing file: ',relativePath printString mayProceed:true. cg@2971: "/ ] cg@2971: "/ ] sr@2684: ]. cg@2614: ]. cg@2873: cg@2918: "Modified: / 05-09-2012 / 16:26:25 / cg" cg@2600: ! cg@2600: cg@2644: createHeaderFileFor:aClass in:packageTargetDir cg@2644: |instVarList classInstVarList classVarList bindings superclassFilename cg@2644: template file newContents oldContents| cg@2644: cg@2644: instVarList := StringCollection new. cg@2644: aClass instVarNames do:[:v | cg@2644: instVarList add:('OBJ %1;' bindWith:v) cg@2644: ]. cg@2644: classInstVarList := StringCollection new. cg@2644: aClass class instVarNames do:[:v | cg@2961: "/ (v includes:$_) ifTrue:[self halt]. cg@2644: classInstVarList add:('OBJ %1;' bindWith:v) cg@2644: ]. cg@2644: classVarList := StringCollection new. cg@2644: aClass classVarNames do:[:v | cg@2644: classVarList add:('extern OBJ %1_%2;' bindWith:aClass name with:v) cg@2644: ]. cg@2614: cg@2644: bindings := Dictionary new. cg@2644: bindings at:'ClassName' put:aClass name. cg@2644: aClass superclass isNil ifTrue:[ cg@2644: bindings at:'SuperclassName' put:'-'. cg@2852: bindings at:'SuperclassFileInclude' put:''. cg@2644: ] ifFalse:[ cg@2644: bindings at:'SuperclassName' put:aClass superclass name. cg@2644: bindings at:'SuperclassFileName' put:(superclassFilename := Smalltalk fileNameForClass:aClass superclass). cg@2644: bindings at:'SuperclassFileInclude' put:('#include "%1.STH"' bindWith:superclassFilename). cg@2644: ]. cg@2644: bindings at:'InstVarList' put:instVarList asString. cg@2644: bindings at:'ClassVarList' put:classVarList asString. cg@2644: bindings at:'ClassInstVarList' put:classInstVarList asString. cg@2644: cg@2644: template := cg@2644: '/* This file was generated by ProjectBuilder. */ cg@2644: /* !!!!!!!! Do not change by hand !!!!!!!! */ cg@2644: cg@2644: /* Class: %(ClassName) */ cg@2644: /* Superclass: %(SuperclassName) */ cg@2644: cg@2644: %(SuperclassFileInclude) cg@2644: cg@2644: /* INDIRECTGLOBALS */ cg@2644: #ifdef _HEADER_INST_ cg@2644: %(InstVarList) cg@2644: #endif /* _HEADER_INST_ */ cg@2644: cg@2644: #ifdef _HEADER_CLASS_ cg@2644: %(ClassVarList) cg@2644: #endif /* _HEADER_CLASS_ */ cg@2644: cg@2644: #ifdef _HEADER_CLASSINST_ cg@2644: %(ClassInstVarList) cg@2644: #endif /* _HEADER_CLASSINST_ */ cg@2644: '. cg@2644: newContents := template bindWithArguments:bindings. sr@2683: file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),(self suffixForHeaderFiles)). cg@2644: (file exists not cg@2644: or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[ cg@2644: file contents: newContents. cg@2644: ]. cg@2852: cg@2852: "Modified: / 15-08-2011 / 14:58:46 / cg" cg@2614: ! cg@2614: cg@3042: generateBuildSupportFilesByFilingOutIn:packageTargetDir forDefinitionClass:projectDefinitionClass cg@3042: |fullPathName| cg@3042: cg@3042: projectDefinitionClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents | cg@3042: fullPathName := packageTargetDir construct:fileName. cg@3042: fullPathName directory exists ifFalse:[ cg@3042: "take care for files like 'autopackage/default.apspec'" cg@3042: fullPathName directory makeDirectory. cg@3042: ]. cg@3042: (fullPathName exists cg@3042: and:[ fullPathName contents = fileContents ]) ifFalse:[ cg@3042: fullPathName contents:fileContents. cg@3042: ]. cg@3042: ]. cg@3042: ! cg@3042: cg@2644: generateSourceFiles cg@2964: (self isLocalBuild not and:[ sourceCodeManager notNil ]) ifTrue:[ cg@2644: "/ check out / generate files there cg@2644: self generateSourceFilesByCheckingOutUsing:sourceCodeManager cg@2644: ] ifFalse:[ cg@2644: "/ local build cg@2644: "/ fileout the project cg@2644: self generateSourceFilesByFilingOut cg@2644: ] cg@2599: ! cg@2599: cg@2644: generateSourceFilesByCheckingOutUsing:aSourceCodeManager cg@2644: "/ will no longer be needed/supported cg@2644: cg@2644: |repository stxRepository module directory| cg@2644: cg@2868: self breakPoint:#cg. cg@2868: cg@2644: "/ check out / generate files there cg@2644: repository := (aSourceCodeManager repositoryNameForModule:module) ifNil:[aSourceCodeManager repositoryName]. cg@2644: stxRepository := aSourceCodeManager repositoryName. cg@2600: cg@2644: (buildDirectory construct:'stx') exists ifFalse:[ cg@2644: (module ~= 'stx') ifTrue:[ cg@2644: OperatingSystem cg@2644: executeCommand:('cvs -d ',stxRepository,' co stx') cg@2644: inputFrom:nil cg@2644: outputTo:Transcript cg@2644: errorTo:Transcript cg@2644: inDirectory:buildDirectory cg@2644: onError:[:status| self error:'cvs update stx failed']. cg@2644: ]. cg@2644: ]. cg@2635: cg@2644: ((buildDirectory construct:module) construct:'CVS') exists ifFalse:[ cg@2644: OperatingSystem cg@2644: executeCommand:('cvs -d ',repository,' co -l ',directory) cg@2644: inputFrom:nil cg@2644: outputTo:Transcript cg@2644: errorTo:Transcript cg@2644: inDirectory:buildDirectory cg@2644: onError:[:status| self error:'cvs update failed']. cg@2644: ]. cg@2644: OperatingSystem cg@2644: executeCommand:'cvs upd -d' cg@2644: inputFrom:nil cg@2644: outputTo:Transcript cg@2644: errorTo:Transcript cg@2644: inDirectory:(buildDirectory construct:module) cg@2644: onError:[:status| self error:'cvs update failed']. cg@2644: self halt. cg@2868: cg@2868: "Modified: / 29-12-2011 / 14:02:56 / cg" cg@2600: ! cg@2600: cg@2644: generateSourceFilesByFilingOut cg@2644: "/ local build cg@2644: "/ fileout the project cg@2644: cg@2644: (package module ~= 'stx') ifTrue:[ cg@2644: (buildDirectory / package module) makeDirectory. cg@2644: ]. cg@2644: cg@2644: "/ file out the package(s) which are to be built cg@2644: ((Array with:package)) cg@2644: do:[:eachPackageToFileout | cg@2981: |packageId packageModule packageDirectory packageTargetDir packageDef extSource| cg@2644: cg@2644: packageId := eachPackageToFileout asPackageId. cg@2644: packageModule := packageId module. cg@2644: packageDirectory := packageId directory. cg@2644: packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. cg@2644: cg@2644: packageDef := packageId projectDefinitionClass. cg@2644: (packageDef compiled_classNames_common , cg@2644: packageDef compiled_classNamesForPlatform) do:[:eachClassName | cg@2644: |cls fileName newSource| cg@2644: cg@2644: cls := Smalltalk classNamed:eachClassName. cg@2644: self assert:cls isLoaded. cg@2644: fileName := (Smalltalk fileNameForClass:cls),'.st'. cg@2644: fileName := packageTargetDir asFilename construct:fileName. cg@2644: fileName exists ifTrue:[ cg@2644: newSource := String streamContents:[:s | cls fileOutOn:s withTimeStamp:false]. cg@2644: newSource = fileName contentsAsString ifFalse:[ cg@2644: fileName contents:newSource cg@2644: ]. cg@2644: ] ifFalse:[ cg@2644: cls fileOutIn:packageTargetDir withTimeStamp:false cg@2644: ]. cg@2644: ]. cg@2596: cg@2981: packageDef hasExtensionMethods ifTrue:[ cg@2981: extSource := cg@2981: String streamContents:[:s | cg@2985: s nextPutAll:('"{ Package: ''%1'' }" !!\\' bindWith:packageDef package) withCRs. cg@2985: cg@2981: packageDef extensionMethods do:[:eachMethod | cg@2981: eachMethod mclass fileOutMethod:eachMethod on:s cg@2981: ]. cg@2981: ]. cg@2987: extSource isWideString ifTrue:[ cg@2987: extSource := ( '"{ Encoding: utf8 }"' , Character cr asString, Character cr asString, extSource). cg@2987: extSource := extSource utf8Encoded. cg@2987: ]. cg@2985: (packageTargetDir asFilename construct:'extensions.st') contents:extSource cg@2981: ]. cg@2981: cg@2644: "/ (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls | cg@2644: "/ cls isPrivate ifFalse:[ cg@2644: "/ cls isLoaded ifFalse:[ cg@2644: "/ self halt. cg@2644: "/ cls autoload. cg@2644: "/ ]. cg@2644: "/ cls fileOutIn:packageTargetDir cg@2644: "/ ] cg@2644: "/ ]. cg@3042: self generateBuildSupportFilesByFilingOutIn:packageTargetDir forDefinitionClass:projectDefinitionClass. cg@2644: ]. cg@2972: self makeQuick ifFalse:[ cg@3042: "/ generate header files and build support files cg@3042: "/ in prerequisite packages... cg@2972: (projectDefinitionClass allPreRequisites) cg@2972: do:[:eachPackageToFileout | cg@2972: |packageId packageDef packageModule packageDirectory packageTargetDir| cg@2596: cg@2972: packageId := eachPackageToFileout asPackageId. cg@2972: packageModule := packageId module. cg@2972: packageDirectory := packageId directory. cg@2972: packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. cg@2644: cg@2972: packageDef := packageId projectDefinitionClass. cg@2972: (packageDef compiled_classNames_common , cg@2972: packageDef compiled_classNamesForPlatform) do:[:eachClassName | cg@2972: |cls| cg@2644: cg@2972: cls := Smalltalk classNamed:eachClassName. cg@2972: "/ self assert:cls isLoaded. cg@2972: cls isNil ifTrue:[ cg@2972: stdErr nextPutLine:('Missing class: ',eachClassName, ' (not present in system. Warning only:subclasses of it will not be compiled)'). cg@2972: ] ifFalse:[ cg@2972: cls isLoaded ifTrue:[ cg@2972: self createHeaderFileFor:cls in:packageTargetDir cg@2972: ] cg@2972: ]. cg@2644: ]. cg@2972: self copyResourcesForPackage:eachPackageToFileout. cg@3042: self generateBuildSupportFilesByFilingOutIn:packageTargetDir forDefinitionClass:packageDef. cg@3042: (packageTargetDir / '.NOSOURCE') contents:'existence of this file suppresses compilation of st files'. cg@2644: ]. cg@2644: ]. cg@2644: cg@2644: "/ stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic') cg@2596: ! cg@2596: cg@2909: makeCommandOfCompiler:usedCompiler cg@2909: usedCompiler = 'bcc' ifTrue:[ cg@2909: ^ 'bmake'. cg@2909: ]. cg@2909: usedCompiler = 'vc' ifTrue:[ cg@2909: ^ 'vcmake'. "/ compilerFlag := '-DUSEVC' cg@2909: ]. cg@2909: usedCompiler = 'lcc' ifTrue:[ cg@2909: ^ 'lccmake'. "/ compilerFlag := '-DUSELCC' cg@2909: ]. cg@2909: usedCompiler = 'tcc' ifTrue:[ cg@2909: ^ 'tccmake'. "/ compilerFlag := '-DUSELCC' cg@2909: ]. cg@2918: usedCompiler = 'mingw' ifTrue:[ cg@2921: ^ 'mingwmake'. "/ compilerFlag := '-DUSEMINGW' cg@2909: ]. cg@2989: true "usedCompiler = 'gcc'" ifTrue:[ cg@2989: ^ 'make'. "/ compilerFlag := '-DUSEGCC' cg@2989: ]. cg@2909: self error:'unknown compiler specified'. cg@2909: cg@2909: "Created: / 03-09-2012 / 19:46:07 / cg" cg@2909: ! cg@2909: cg@2644: makeWithOutputTo:stdOut errorTo:stdErr cg@2909: |module directory makeCommand| cg@2644: cg@2644: module := package module. cg@2644: directory := package directory. cg@2644: cg@2680: makeCommand := ParserFlags makeCommand. cg@2895: usedCompiler isNil ifTrue:[ cg@2895: usedCompiler := ParserFlags usedCompiler. cg@2895: ]. cg@2909: makeCommand := self makeCommandOfCompiler:usedCompiler. cg@2873: cg@2852: "/ makeCommand := makeCommand, ' TOP=', mySTXTopDirectory pathName. cg@2680: sr@2683: OperatingSystem isUNIXlike ifTrue:[ cg@2921: "/ generate the makefile first cg@2984: self activityNotification:('sh %1/rules/stmkmf (in %2)' cg@2984: bindWith:mySTXTopDirectory pathName cg@2984: with:(buildDirectory / module / directory)). sr@2683: OperatingSystem sv@2845: executeCommand:('sh %1/rules/stmkmf' bindWith:mySTXTopDirectory pathName) sr@2683: inputFrom:nil sr@2683: outputTo:stdOut sr@2683: errorTo:stdErr sr@2683: inDirectory:(buildDirectory / module / directory) cg@2921: onError:[:status | self error:'make failed']. sr@2683: ]. sr@2683: cg@2644: projectDefinitionClass isLibraryDefinition ifTrue:[ cg@2921: "/ generate the library cg@2969: self activityNotification:(makeCommand,' classLibRule'). cg@2644: OperatingSystem cg@2989: executeCommand:(makeCommand,' classLibRule FORCE=') cg@2644: inputFrom:nil cg@2644: outputTo:stdOut cg@2644: errorTo:stdErr cg@2644: inDirectory:(buildDirectory / module / directory) cg@2921: onError:[:status | self error:'make failed']. cg@2644: ] ifFalse:[ cg@2972: (self makeExeOnly) ifTrue:[ cg@2969: self activityNotification:(makeCommand,' exe'). cg@2969: OperatingSystem cg@2969: "/ generate the executable cg@2989: executeCommand:(makeCommand,' exe FORCE=') cg@2969: inputFrom:nil cg@2969: outputTo:stdOut cg@2969: errorTo:stdErr cg@2969: inDirectory:(buildDirectory / module / directory) cg@2969: onError:[:status | self error:'make failed']. cg@2644: cg@2969: ] ifFalse:[ cg@2921: "/ generate the self-installable package cg@2969: self activityNotification:(makeCommand,' ALL_NP'). cg@2673: OperatingSystem cg@2969: executeCommand:(makeCommand,' ALL_NP') cg@2673: inputFrom:nil cg@2673: outputTo:stdOut cg@2673: errorTo:stdErr cg@2673: inDirectory:(buildDirectory / module / directory) cg@2921: onError:[:status | self error:'make failed']. cg@2673: ] cg@2644: ] cg@2793: cg@2909: "Modified: / 03-09-2012 / 19:47:15 / cg" cg@2921: "Modified (comment): / 06-09-2012 / 16:22:38 / cg" cg@2596: ! cg@2596: cg@2905: objDirForUsedCompiler cg@2909: ^ self objDirForUsedCompiler:usedCompiler cg@2909: cg@2909: "Created: / 20-08-2012 / 17:01:13 / cg" cg@2909: ! cg@2909: cg@2909: objDirForUsedCompiler:usedCompiler cg@2918: usedCompiler = 'gcc' ifTrue:[^ 'obj']. "/ unix case cg@2918: cg@2905: usedCompiler = 'bcc' ifTrue:[^ 'objbc']. cg@2905: usedCompiler = 'vc' ifTrue:[^ 'objvc']. cg@2909: usedCompiler = 'tcc' ifTrue:[^ 'objtcc']. cg@2909: usedCompiler = 'lcc' ifTrue:[^ 'objlcc']. cg@2918: usedCompiler = 'mingw' ifTrue:[^ 'objmingw']. cg@2961: self halt:'please add compiler here'. cg@2905: ^ 'objbc' cg@2905: cg@2909: "Created: / 03-09-2012 / 19:55:34 / cg" cg@2905: ! cg@2905: sr@2683: recursiveCopyDirectoryForBuild:subdir sr@2683: |targetDir| sr@2683: sr@2683: targetDir := buildDirectory / 'stx' / subdir. sr@2683: targetDir exists ifFalse:[ sr@2683: targetDir makeDirectory. sr@2683: ]. sr@2683: (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile | sr@2683: eachFile recursiveCopyTo:(targetDir construct:eachFile baseName) sr@2683: ]. sr@2683: self activityNotification:nil sr@2683: ! sr@2683: cg@2644: setupBuildDirectory cg@2984: self activityNotification:('Building in %1' bindWith:buildDirectory pathName). cg@2984: cg@2644: buildDirectory exists ifFalse:[ cg@2644: buildDirectory recursiveMakeDirectory. cg@2644: ]. cg@2644: (buildDirectory / 'stx') exists ifFalse:[ cg@2644: (buildDirectory / 'stx') makeDirectory. cg@2644: ]. cg@2644: cg@2644: self copyDirectoryForBuild:'include'. cg@2644: self copyDirectoryForBuild:'rules'. cg@2984: sr@2683: OperatingSystem isUNIXlike ifTrue:[ sr@2683: self recursiveCopyDirectoryForBuild:'configurations'. sr@2683: ] cg@2611: ! cg@2611: cg@2644: validateBuildDirectoryIsPresent cg@2644: cg@2644: ^ self. cg@2596: cg@2644: "/ [ cg@2644: "/ |default directoryIsOKForMe stc | cg@2644: "/ cg@2644: "/ default := (buildDirectory ? cg@2644: "/ PreviousBuildDirectory) cg@2644: "/ ifNil:[ UserPreferences current buildDirectory]. cg@2644: "/ cg@2644: "/ buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:' cg@2644: "/ default:default. cg@2644: "/ cg@2644: "/ buildDirectory isEmptyOrNil ifTrue:[^ self]. cg@2644: "/ buildDirectory := buildDirectory asFilename. cg@2644: "/ directoryIsOKForMe := true. cg@2644: "/ cg@2644: "/ buildDirectory exists ifFalse:[ cg@2644: "/ Dialog warn:(self classResources string:'Work directory %1 does not exist.' with:buildDirectory). cg@2644: "/ directoryIsOKForMe := false. cg@2644: "/ ] ifTrue:[ cg@2644: "/ (buildDirectory construct:'stx') exists ifFalse:[ cg@2644: "/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.'). cg@2644: "/ directoryIsOKForMe := false. cg@2644: "/ ] ifTrue:[ cg@2644: "/ stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc']. cg@2644: "/ (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[ cg@2644: "/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stc compiler in the stx/stc subDirectory.'). cg@2644: "/ directoryIsOKForMe := false. cg@2644: "/ ]. cg@2644: "/ ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[ cg@2644: "/ Dialog warn:(self classResources stringWithCRs:'Work directory must have had a make run before (for include files to exists).'). cg@2644: "/ directoryIsOKForMe := false. cg@2644: "/ ]. cg@2644: "/ ] cg@2644: "/ ]. cg@2644: "/ directoryIsOKForMe cg@2644: "/ ] whileFalse cg@2596: ! ! cg@2596: cg@2596: !ProjectBuilder class methodsFor:'documentation'! cg@2596: cg@2896: version cg@2896: ^ '$Header$' cg@2896: ! cg@2896: cg@2596: version_CVS cg@2596: ^ '$Header$' cg@2596: ! ! cg@2958: