ApplicationDefinition.st
changeset 10990 b64d3c609143
parent 10978 6028cdeaad20
child 10996 c2d79a0a0893
--- a/ApplicationDefinition.st	Tue Apr 29 20:58:51 2008 +0200
+++ b/ApplicationDefinition.st	Fri May 02 16:28:00 2008 +0200
@@ -12,10 +12,10 @@
 "{ Package: 'stx:libbasic' }"
 
 ProjectDefinition subclass:#ApplicationDefinition
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	category:'System-Support-Projects'
+        instanceVariableNames:''
+        classVariableNames:''
+        poolDictionaries:''
+        category:'System-Support-Projects'
 !
 
 !ApplicationDefinition class methodsFor:'documentation'!
@@ -1206,6 +1206,12 @@
 prereq: $(REQUIRED_SUPPORT_DIRS)
 %(MAKE_PREREQUISITES)
 
+SOURCEFILES: %(APPLICATION)_SOURCES \
+        stx_SOURCES
+
+%(SOURCE_RULES)
+%(STX_SOURCE_RULES)
+
 RESOURCEFILES: %(APPLICATION)_RESOURCES %(APPLICATION)_BITMAPS \
         stx_RESOURCES stx_STYLES stx_BITMAPS
 
@@ -1224,6 +1230,36 @@
     "Created: / 29-09-2006 / 23:47:07 / cg"
 !
 
+make_dot_proto_app_source_rules
+
+    ^ String streamContents:[:s |
+        s
+          cr;
+          nextPutAll: '%(APPLICATION)_SOURCES: '.
+        self appSourcesProjects do:[:projectID |
+            s nextPutAll: ' \
+        ', (self make_dot_proto_source_title_for: projectID).
+        ].
+        s cr; cr.
+        self appSourcesProjects do:[:projectID |
+            s nextPutAll:(self make_dot_proto_app_source_rules_for: projectID) .
+            s cr; cr.
+        ].
+    ].
+!
+
+make_dot_proto_app_source_rules_for: projectID
+
+    | module moduleDirectory|
+
+    module := self moduleFor: projectID.
+    moduleDirectory := self moduleDirectoryFor:projectID.
+    ^ String cr,
+    (self make_dot_proto_source_title_for: projectID), ':
+        mkdir -p sources/', module,'/', moduleDirectory, '
+        cp $(TOP)/../', module, '/', moduleDirectory,'/*.st sources/', module,'/', moduleDirectory.
+!
+
 make_dot_proto_resource_rules
     ^ String streamContents:[:s |
         s nextPutAll:'
@@ -1238,6 +1274,14 @@
     ].
 !
 
+make_dot_proto_source_title_for: projectID
+
+    |packageName |
+
+    packageName := self packageNameFor: projectID.
+    ^ packageName, '_SOURCES'
+!
+
 make_dot_proto_stx_resource_rules
     ^ '
 
@@ -1291,6 +1335,35 @@
 '.
 !
 
+make_dot_proto_stx_source_rules
+
+    ^ String streamContents:[:s |
+        s
+          cr;
+          nextPutAll: 'stx_SOURCES: '.
+        self stxSourcesProjects do:[:projectID |
+            s nextPutAll: '\
+        ', (self make_dot_proto_source_title_for: projectID).
+        ].
+        s cr; cr.
+        self stxSourcesProjects do:[:projectID |
+            s nextPutAll:(self make_dot_proto_stx_source_rules_for: projectID) .
+            s cr; cr.
+        ].
+    ].
+!
+
+make_dot_proto_stx_source_rules_for: projectID
+
+    | moduleDirectory|
+
+    moduleDirectory := self moduleDirectoryFor:projectID.
+    ^ String cr,
+    (self make_dot_proto_source_title_for: projectID), ':
+        mkdir -p sources/stx/', moduleDirectory, '
+        cp $(TOP)/', moduleDirectory,'/*.st sources/stx/', moduleDirectory.
+!
+
 modules_dot_c
 
 ^ 
@@ -1830,6 +1903,18 @@
         at: 'REQUIRED_LINK_LIBOBJS' put: (self generateRequiredLinkLibobjs_make_dot_proto);
         at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_make_dot_proto).
 
+    self offerSmalltalkSourceCode ifTrue:[ 
+        mappings
+            at: 'STX_SOURCE_RULES' put: ( self replaceMappings: mappings 
+                                            in: self make_dot_proto_stx_source_rules).
+    ].
+
+    self offerApplicationSourceCode ifTrue:[  
+        mappings
+            at: 'SOURCE_RULES' put:( self replaceMappings: mappings 
+                                            in: self make_dot_proto_app_source_rules ).
+    ].
+
     self needResources ifTrue:[
         mappings
             at: 'REQUIRED_SUPPORT_DIRS' put: 'RESOURCEFILES';
@@ -2314,5 +2399,5 @@
 !ApplicationDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.105 2008-04-25 13:39:18 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.106 2008-05-02 14:28:00 fm Exp $'
 ! !