Project.st
changeset 5177 3b6861109161
parent 5173 935228a12bfc
child 5178 5cc5f9ed5313
--- a/Project.st	Thu Jan 13 17:01:54 2000 +0100
+++ b/Project.st	Thu Jan 13 19:27:09 2000 +0100
@@ -559,6 +559,17 @@
 
 !Project methodsFor:'accessing'!
 
+addPrerequisitePackage:aPackageId
+    "add onother prerequisitePackage to the project"
+
+    |list|
+
+    list := self prerequisites.
+    (list includes:aPackageId) ifFalse:[
+        list addLast:aPackageId
+    ].
+!
+
 addSubProject:aProject
     "add a subproject - obsolete; we use prerequisites now"
 
@@ -1668,11 +1679,14 @@
      in the projects source directory."
 
     |d f out in topName classes classInfo myPackage   
-     methodsFile prerequisitePackages transcript|
+     methodsFile prerequisitePackages transcript notEmpty|
 
     classes := self classesInOrderFor:'generate ''loadAll''-file.'.
     classes isNil ifTrue:[^ self].
 
+    methodsFile := self propertyAt:#methodsFile.
+    notEmpty := (classes size > 0 or:[methodsFile size > 0]).
+
     transcript := Transcript current.
     transcript showCR:'creating loadAll file'.
 
@@ -1732,8 +1746,7 @@
     ].
 
     methodsFile := self propertyAt:#methodsFile.
-    (classes size > 0 
-    or:[methodsFile size > 0]) ifTrue:[
+    notEmpty ifTrue:[
 
         out nextPutAll:'!!
 
@@ -2263,13 +2276,19 @@
     "creates a Make.proto file"
 
     |d f s type appName libName startUpClass startUpSelector
-     topName classes methodsFile|
+     topName classes methodsFile notEmpty repositoryModule repositoryDirectory pkg|
 
     classes := self classesInOrderFor:'generate ''Make.proto''-file.'.
     classes isNil ifTrue:[^ self].
 
+    methodsFile := self propertyAt:#methodsFile.
+    notEmpty := (classes size > 0 or:[methodsFile size > 0]).
+
     topName := self findTopFrom:directoryName.
 
+    repositoryModule :=  self repositoryModule ? 'unknown'.
+    repositoryDirectory := self repositoryDirectory ? 'unknown'.
+    pkg := repositoryModule , ':' , repositoryDirectory.
 
     Transcript current showCR:'creating Make.proto'.
 
@@ -2299,9 +2318,10 @@
 # these should correspond to the directory hierarchy
 # location (otherwise, ST/X will have a hard time to
 # find out the packages location from its packageID)
-MODULE=' , self repositoryModule ? 'unknown' , '
-MODULE_DIR=' , self repositoryDirectory ? 'unknown' , '
-
+MODULE=' , repositoryModule , '
+MODULE_DIR=' , repositoryDirectory , '
+'.
+    s nextPutAll:'
 # default installation directory:
 # (overwrite with ''make INSTALLTOP_DIR=... install'')
 # the INSTALLBASE is imported from configurations... and usually
@@ -2310,29 +2330,46 @@
 INSTALLTOP_DIR=$(INSTALLBASE)/packages/$(MODULE)/$(MODULE_DIR)
 INSTALLLIB_DIR=$(INSTALLTOP_DIR)
 INSTALLBIN_DIR=$(INSTALLTOP_DIR)
-
+'.
+    s nextPutAll:'
 #
 # position (of this package) in directory hierarchy:
 # (must point to ST/X top directory, for tools and includes)
 TOP=' , topName ,'
 
 # subdirectories where targets are to be made:
-SUBDIRS=
+SUBDIRS='.
+    self prerequisitePackages do:[:aPackageId |
+        "/ add sub-packages
+        (aPackageId startsWith:pkg) ifTrue:[
+            s nextPutAll:(aPackageId copyFrom:pkg size + 2).
+            s space.
+        ]
+    ].
+
+    s nextPutAll:'
 
 # subdirectories where Makefiles are to be made:
 # (only define if different from SUBDIRS)
 # ALLSUBDIRS=
-
-
+'.
+    notEmpty ifTrue:[
+        s nextPutAll:'
 # the name of your classLibrary:
 # ********** REQUIRED: CHECK the next line ***
 LIBNAME=' , self libraryName , '
 
-
+'.
+    ].
+
+    false ifTrue:[
+        s nextPutAll:'
 # the next define suppresses installation of 
 # the classes as autoloaded (i.e. not added to abbrev.stc). 
 SUPPRESS_LOCAL_ABBREVS=1
-
+'.
+].
+    s nextPutAll:'
 # the package is stored as an ID in classes and methods
 # to identify code belonging to this project.
 # It also specifies the position in the source repository
@@ -2400,7 +2437,14 @@
 # additional C targets or libraries should be added below
 LOCAL_EXTRA_TARGETS=' , ((self propertyAt:#'make.LOCAL_EXTRA_TARGETS') ? '') , '
 
-all:: preMake classLibRule postMake
+'.
+
+    s nextPutAll:'
+all:: preMake '.
+    notEmpty ifTrue:[
+        s nextPutAll:'classLibRule '
+    ].
+    s nextPutAll:'postMake
 
 
 '.
@@ -2498,22 +2542,10 @@
 ' , Character tab , '-rm -f *.so *.dll
 
 $(INSTALLBASE)::
-' , Character tab , '@test -d $@ || mkdir $@
-
-$(INSTALLBASE)/packages:: $(INSTALLBASE)
-' , Character tab , '@test -d $@ || mkdir $@
-
-$(INSTALLBASE)/packages/$(MODULE):: $(INSTALLBASE)/packages
-' , Character tab , '@test -d $@ || mkdir $@
-
-$(INSTALLBASE)/packages/$(MODULE)/osi:: $(INSTALLBASE)/packages/$(MODULE)
-' , Character tab , '@test -d $@ || mkdir $@
-
-$(INSTALLBASE)/packages/$(MODULE)/osi/asn1:: $(INSTALLBASE)/packages/$(MODULE)/osi
-' , Character tab , '@test -d $@ || mkdir $@
+' , Character tab , '@test -d $@ || mkdir -p $@
 
 $(INSTALLBASE)/packages/$(MODULE)/$(MODULE_DIR):: $(INSTALLBASE)/packages/$(MODULE)
-' , Character tab , '@test -d $@ || mkdir $@
+' , Character tab , '@test -d $@ || mkdir -p $@
 
 # BEGINMAKEDEPEND --- do not remove this line; make depend needs it
 '.
@@ -3494,6 +3526,6 @@
 !Project class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.139 2000-01-13 13:23:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.140 2000-01-13 18:27:09 cg Exp $'
 ! !
 Project initialize!