*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Thu, 14 Sep 2006 19:07:34 +0200
changeset 9887 5c0c2a62ad2d
parent 9886 6574a17ca51e
child 9888 7230c9f25e5e
*** empty log message ***
ProjectDefinition.st
--- a/ProjectDefinition.st	Thu Sep 14 19:07:31 2006 +0200
+++ b/ProjectDefinition.st	Thu Sep 14 19:07:34 2006 +0200
@@ -1534,10 +1534,11 @@
 
     ^ 
 'make.exe -N -f nt.mak %%1 %%2
+%(SUBPROJECT_BMAKE_CALLS)
 '
 
     "Created: / 17-08-2006 / 20:04:14 / cg"
-    "Modified: / 22-08-2006 / 23:32:24 / cg"
+    "Modified: / 14-09-2006 / 18:38:57 / cg"
 !
 
 make_dot_spec
@@ -1731,7 +1732,7 @@
 
 bc_dot_def_mappings
     ^ (Dictionary new)
-        at:#'DESCRIPTION'
+        at:'DESCRIPTION'
             put:[
                     |d|
 
@@ -1741,27 +1742,30 @@
         yourself
 
     "Created: / 09-08-2006 / 11:17:59 / fm"
+    "Modified: / 14-09-2006 / 18:51:17 / cg"
 !
 
 bmake_dot_mak_mappings
     ^ (Dictionary new)
+        at:'SUBPROJECT_BMAKE_CALLS' put:(self subProjectBmakeCalls);
         yourself
 
     "Created: / 17-08-2006 / 21:41:56 / cg"
+    "Modified: / 14-09-2006 / 18:55:33 / cg"
 !
 
 make_dot_spec_mappings
     ^ Dictionary new
-        at: #'TAB' put: ( Character tab asString );
-        at: #'MODULE' put: ( self module );  
-        at: #'MODULE_DIRECTORY' put: ( self moduleDirectory );
-        at: #'STCWARNINGOPTIONS' put: (self stcWarningOptions);
-        at: #'STCOPTIMIZATIONOPTIONS' put: (self stcOptimizationOptions);
-        at: #'OBJECTS' put: [self generateObjects_make_dot_spec];
+        at: 'TAB' put: ( Character tab asString );
+        at: 'MODULE' put: ( self module );  
+        at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );
+        at: 'STCWARNINGOPTIONS' put: (self stcWarningOptions);
+        at: 'STCOPTIMIZATIONOPTIONS' put: (self stcOptimizationOptions);
+        at: 'OBJECTS' put: [self generateObjects_make_dot_spec];
         yourself
 
     "Created: / 18-08-2006 / 11:44:23 / cg"
-    "Modified: / 30-08-2006 / 19:10:10 / cg"
+    "Modified: / 14-09-2006 / 18:51:24 / cg"
 !
 
 nt_dot_mak_mappings
@@ -1769,28 +1773,25 @@
 
     d := Dictionary new.
     d 
-        at: #'TAB' put: ( Character tab asString );
-        at: #'TOP' put: ( self pathToTop_win32 );
-        at: #'MODULE' put: ( self module );  
-        at: #'MODULE_DIRECTORY' put: ( self moduleDirectory ). 
+        at: 'TAB' put: ( Character tab asString );
+        at: 'TOP' put: ( self pathToTop_win32 );
+        at: 'MODULE' put: ( self module );  
+        at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ). 
     ^ d
 
     "Created: / 18-08-2006 / 11:43:39 / cg"
+    "Modified: / 14-09-2006 / 18:51:29 / cg"
 !
 
 objectLine_make_dot_spec_mappings: aClassName
     ^ Dictionary new                                               
-        at: #'CLASSFILE' 
-        put: [
-                (Smalltalk classNamed:aClassName) 
-                    classFilename asFilename
-                        withoutSuffix baseName.
-            ];
+        at: 'CLASSFILE' 
+        put: ( (Smalltalk classNamed:aClassName) classFilename asFilename withoutSuffix baseName );
         yourself
 
     "Created: / 08-08-2006 / 20:17:28 / fm"
     "Modified: / 09-08-2006 / 18:26:52 / fm"
-    "Modified: / 30-08-2006 / 14:44:25 / cg"
+    "Modified: / 14-09-2006 / 18:51:49 / cg"
 !
 
 packageName_dot_rc_mappings
@@ -1798,21 +1799,21 @@
 
     d := Dictionary new.
     d
-        at: #'PRODUCT_NAME' put: [self productName];
-        at: #'PRODUCT_VERSION' put: [self productVersion];
-        at: #'PRODUCT_DATE' put: [self productDate];
-        at: #'FILETYPE' put: [ 'VFT_DLL' ];
-        at: #'FILE_VERSION_COMMASEPARATED' put: [self fileVersionCommaSeparated];
-        at: #'PRODUCT_VERSION_COMMASEPARATED' put: [self productVersionCommaSeparated];
-
-        at: #'COMPANY_NAME' put: [self companyName];
-        at: #'FILE_DESCRIPTION' put: [self fileDescription];
-        at: #'FILE_VERSION' put: [self fileVersion];
-        at: #'INTERNAL_NAME' put: [self internalName].
+        at: 'PRODUCT_NAME' put: (self productName);
+        at: 'PRODUCT_VERSION' put: (self productVersion);
+        at: 'PRODUCT_DATE' put: (self productDate);
+        at: 'FILETYPE' put: ( 'VFT_DLL' );
+        at: 'FILE_VERSION_COMMASEPARATED' put: (self fileVersionCommaSeparated);
+        at: 'PRODUCT_VERSION_COMMASEPARATED' put: (self productVersionCommaSeparated);
+
+        at: 'COMPANY_NAME' put: (self companyName);
+        at: 'FILE_DESCRIPTION' put: (self fileDescription);
+        at: 'FILE_VERSION' put: (self fileVersion);
+        at: 'INTERNAL_NAME' put: (self internalName).
     s := self legalCopyright.
     s notNil ifTrue:[
         d
-            at: #'LEGAL_COPYRIGHT_LINE' put: '      VALUE "LegalCopyright", "',s,'\0"'
+            at: 'LEGAL_COPYRIGHT_LINE' put: '      VALUE "LegalCopyright", "',s,'\0"'
     ].
     s := self iconFileName.
     s notNil ifTrue:[
@@ -1823,7 +1824,7 @@
     ^ d
 
     "Created: / 09-08-2006 / 11:21:21 / fm"
-    "Modified: / 30-08-2006 / 18:43:49 / cg"
+    "Modified: / 14-09-2006 / 18:52:37 / cg"
 !
 
 replaceMappings: mappings in: fileTemplate
@@ -1841,6 +1842,163 @@
 
 !ProjectDefinition class methodsFor:'mappings support'!
 
+generateDependencies:whichArchitecture
+    ^ String streamContents:[:s |
+        |classNames classesLoaded classesSorted classNamesSorted putDependencyForClass
+         archClassNames archClassesLoaded putSingleClassDependencyEntry putDependencyForExtensions|
+
+        putSingleClassDependencyEntry :=
+            [:cls | |sclsBaseName|
+                s nextPutAll:' $(INCLUDE_TOP)'.                 
+                s nextPutAll:(self pathSeparator:whichArchitecture) asString.
+                sclsBaseName := cls classFilename asFilename withoutSuffix baseName.
+                s nextPutAll:(self topRelativePathTo:sclsBaseName inPackage:cls package architecture:whichArchitecture).
+                s nextPutAll:'.$(H)'.
+            ].
+
+        putDependencyForClass :=
+            [:cls |
+                |clsBaseName already|
+
+                clsBaseName := cls classFilename asFilename withoutSuffix baseName.
+                s nextPutAll:'$(OUTDIR)'.
+                s nextPutAll:clsBaseName.
+                s nextPutAll:'.$(O)'.
+
+                s nextPutAll:' '.
+                s nextPutAll:clsBaseName.
+                s nextPutAll:'.$(H)'.
+
+                s nextPutAll:': '.
+                s nextPutAll:clsBaseName.
+                s nextPutAll:'.st'.
+                already := Set new.
+                cls allSuperclassesDo:[:scls |
+                    putSingleClassDependencyEntry value:scls.
+                    already add:scls.
+                ].
+                cls privateClassesDo:[:eachPrivateClass |
+                    eachPrivateClass allSuperclassesDo:[:scls | |sclsBaseName|
+                        scls ~~ cls ifTrue:[
+                            scls isPrivate ifFalse:[
+                                (already includes:scls) ifFalse:[
+                                    putSingleClassDependencyEntry value:scls.
+                                    already add:scls.
+                                ].
+                            ].
+                        ].
+                    ]
+                ].
+
+                s nextPutAll:' $(STCHDR)'.                 
+                s cr.
+            ].
+
+        putDependencyForExtensions :=
+            [
+                |already|
+
+                s nextPutAll:'$(OUTDIR)extensions.$(O): extensions.st'.
+
+                already := Set new.
+                self extensionMethodNames pairWiseDo:[:className :selector |
+                    |mthdCls cls|
+
+                    ((mthdCls := Smalltalk classNamed:className) notNil and:[mthdCls isLoaded]) ifTrue:[
+                        cls := mthdCls theNonMetaclass.
+                        (already includes:cls) ifFalse:[
+                            cls allSuperclassesDo:[:scls |
+                                (already includes:scls) ifFalse:[
+                                    putSingleClassDependencyEntry value:scls.
+                                    already add:scls.
+                                ].
+                            ].
+                        ].
+                    ].
+                ].
+
+                s nextPutAll:' $(STCHDR)'.                 
+                s cr.
+            ].
+
+        classNames := self common_compiled_classNames.
+        classesLoaded := classNames 
+                    collect:[:className | |cls| cls := Smalltalk classNamed:className]
+                    thenSelect:[:cls |  cls notNil and:[cls isLoaded] ].
+
+        classesSorted := Class classesSortedByLoadOrder:classesLoaded.
+        classesSorted do:putDependencyForClass.
+
+        self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:className :attr |
+            |cls|
+
+            (attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[
+                ((cls := Smalltalk classNamed:className) notNil and:[cls isLoaded]) ifTrue:[
+                    putDependencyForClass value:cls.
+                ]
+            ].
+        ].
+
+        archClassNames := self compiled_classNamesForArchitecture:whichArchitecture.    
+        archClassesLoaded := archClassNames 
+                    collect:[:className | |cls| cls := Smalltalk classNamed:className]
+                    thenSelect:[:cls |  cls notNil and:[cls isLoaded] ].
+
+        archClassesLoaded notEmpty ifTrue:[
+            (Class classesSortedByLoadOrder:archClassesLoaded) do:putDependencyForClass.
+        ].
+
+        self hasExtensions ifTrue:putDependencyForExtensions.
+    ]
+
+    "
+     stx_libbasic3 generateDependencies:#unix
+     stx_libbasic3 generateDependencies:#win32
+    "
+
+    "Modified: / 16-08-2006 / 18:52:10 / User"
+    "Created: / 14-09-2006 / 12:38:57 / cg"
+    "Modified: / 14-09-2006 / 17:04:21 / cg"
+!
+
+generateDependencies_unix
+    ^ self generateDependencies:#unix
+
+    "
+     stx_libbasic3 generateDependencies:#unix
+     stx_libbasic3 generateDependencies:#win32
+    "
+
+    "Modified: / 14-09-2006 / 13:32:34 / cg"
+!
+
+generateDependencies_win32
+    ^ self generateDependencies:#win32
+
+    "Created: / 14-09-2006 / 12:39:18 / cg"
+!
+
+generateLocalIncludes_win32
+    ^ String streamContents:[:s |
+        s nextPutAll:(self localIncludes_win32).
+        self searchForProjectsWhichProvideHeaderFiles
+            do:[:includeProject |
+                s nextPutAll:' -I$(INCLUDE_TOP)\',(self topRelativePathToPackage_win32: includeProject) 
+            ]
+    ]
+
+    "
+     bosch_dapasx_application generateLocalIncludes_win32
+     bosch_dapasx_datenbasis generateLocalIncludes_win32  
+     stx_libbasic generateLocalIncludes_win32              
+     stx_libview generateLocalIncludes_win32               
+     stx_libtool2 generateLocalIncludes_win32             
+    "
+
+    "Created: / 09-08-2006 / 16:46:49 / fm"
+    "Modified: / 14-09-2006 / 15:37:35 / cg"
+!
+
 generateObjects_make_dot_spec 
     |pivateClassesOf sorter classes|
 
@@ -1922,6 +2080,19 @@
 
     "Created: / 09-08-2006 / 11:24:39 / fm"
     "Modified: / 14-09-2006 / 16:21:46 / cg"
+!
+
+subProjectBmakeCalls
+    ^ String streamContents:[:s |
+        self subProjects do:[:packageID |
+            s cr. 
+            s nextPutLine:'cd ', (self msdosPathToPackage:packageID from:(self package)). 
+            s nextPutLine:'call bmake %1 %2'. 
+            s nextPutLine:'cd ', (self msdosPathToPackage:(self package) from:packageID). 
+        ]
+    ]
+
+    "Created: / 14-09-2006 / 18:40:09 / cg"
 ! !
 
 !ProjectDefinition class methodsFor:'private'!
@@ -2546,7 +2717,7 @@
 !ProjectDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.58 2006-09-14 15:06:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.59 2006-09-14 17:07:34 cg Exp $'
 ! !
 
 ProjectDefinition initialize!