ProjectDefinition.st
changeset 9887 5c0c2a62ad2d
parent 9883 c641767d1483
child 9888 7230c9f25e5e
equal deleted inserted replaced
9886:6574a17ca51e 9887:5c0c2a62ad2d
  1532 bmake_dot_mak
  1532 bmake_dot_mak
  1533     "the template code for the bmake.bat file"
  1533     "the template code for the bmake.bat file"
  1534 
  1534 
  1535     ^ 
  1535     ^ 
  1536 'make.exe -N -f nt.mak %%1 %%2
  1536 'make.exe -N -f nt.mak %%1 %%2
       
  1537 %(SUBPROJECT_BMAKE_CALLS)
  1537 '
  1538 '
  1538 
  1539 
  1539     "Created: / 17-08-2006 / 20:04:14 / cg"
  1540     "Created: / 17-08-2006 / 20:04:14 / cg"
  1540     "Modified: / 22-08-2006 / 23:32:24 / cg"
  1541     "Modified: / 14-09-2006 / 18:38:57 / cg"
  1541 !
  1542 !
  1542 
  1543 
  1543 make_dot_spec
  1544 make_dot_spec
  1544 
  1545 
  1545 ^ 
  1546 ^ 
  1729 
  1730 
  1730 !ProjectDefinition class methodsFor:'mappings'!
  1731 !ProjectDefinition class methodsFor:'mappings'!
  1731 
  1732 
  1732 bc_dot_def_mappings
  1733 bc_dot_def_mappings
  1733     ^ (Dictionary new)
  1734     ^ (Dictionary new)
  1734         at:#'DESCRIPTION'
  1735         at:'DESCRIPTION'
  1735             put:[
  1736             put:[
  1736                     |d|
  1737                     |d|
  1737 
  1738 
  1738                     d := self description.
  1739                     d := self description.
  1739                     (d isEmptyOrNil ifTrue:[ self defaultDescription ] ifFalse:[ d ]) storeString.
  1740                     (d isEmptyOrNil ifTrue:[ self defaultDescription ] ifFalse:[ d ]) storeString.
  1740                 ];
  1741                 ];
  1741         yourself
  1742         yourself
  1742 
  1743 
  1743     "Created: / 09-08-2006 / 11:17:59 / fm"
  1744     "Created: / 09-08-2006 / 11:17:59 / fm"
       
  1745     "Modified: / 14-09-2006 / 18:51:17 / cg"
  1744 !
  1746 !
  1745 
  1747 
  1746 bmake_dot_mak_mappings
  1748 bmake_dot_mak_mappings
  1747     ^ (Dictionary new)
  1749     ^ (Dictionary new)
       
  1750         at:'SUBPROJECT_BMAKE_CALLS' put:(self subProjectBmakeCalls);
  1748         yourself
  1751         yourself
  1749 
  1752 
  1750     "Created: / 17-08-2006 / 21:41:56 / cg"
  1753     "Created: / 17-08-2006 / 21:41:56 / cg"
       
  1754     "Modified: / 14-09-2006 / 18:55:33 / cg"
  1751 !
  1755 !
  1752 
  1756 
  1753 make_dot_spec_mappings
  1757 make_dot_spec_mappings
  1754     ^ Dictionary new
  1758     ^ Dictionary new
  1755         at: #'TAB' put: ( Character tab asString );
  1759         at: 'TAB' put: ( Character tab asString );
  1756         at: #'MODULE' put: ( self module );  
  1760         at: 'MODULE' put: ( self module );  
  1757         at: #'MODULE_DIRECTORY' put: ( self moduleDirectory );
  1761         at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );
  1758         at: #'STCWARNINGOPTIONS' put: (self stcWarningOptions);
  1762         at: 'STCWARNINGOPTIONS' put: (self stcWarningOptions);
  1759         at: #'STCOPTIMIZATIONOPTIONS' put: (self stcOptimizationOptions);
  1763         at: 'STCOPTIMIZATIONOPTIONS' put: (self stcOptimizationOptions);
  1760         at: #'OBJECTS' put: [self generateObjects_make_dot_spec];
  1764         at: 'OBJECTS' put: [self generateObjects_make_dot_spec];
  1761         yourself
  1765         yourself
  1762 
  1766 
  1763     "Created: / 18-08-2006 / 11:44:23 / cg"
  1767     "Created: / 18-08-2006 / 11:44:23 / cg"
  1764     "Modified: / 30-08-2006 / 19:10:10 / cg"
  1768     "Modified: / 14-09-2006 / 18:51:24 / cg"
  1765 !
  1769 !
  1766 
  1770 
  1767 nt_dot_mak_mappings
  1771 nt_dot_mak_mappings
  1768     |d|
  1772     |d|
  1769 
  1773 
  1770     d := Dictionary new.
  1774     d := Dictionary new.
  1771     d 
  1775     d 
  1772         at: #'TAB' put: ( Character tab asString );
  1776         at: 'TAB' put: ( Character tab asString );
  1773         at: #'TOP' put: ( self pathToTop_win32 );
  1777         at: 'TOP' put: ( self pathToTop_win32 );
  1774         at: #'MODULE' put: ( self module );  
  1778         at: 'MODULE' put: ( self module );  
  1775         at: #'MODULE_DIRECTORY' put: ( self moduleDirectory ). 
  1779         at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ). 
  1776     ^ d
  1780     ^ d
  1777 
  1781 
  1778     "Created: / 18-08-2006 / 11:43:39 / cg"
  1782     "Created: / 18-08-2006 / 11:43:39 / cg"
       
  1783     "Modified: / 14-09-2006 / 18:51:29 / cg"
  1779 !
  1784 !
  1780 
  1785 
  1781 objectLine_make_dot_spec_mappings: aClassName
  1786 objectLine_make_dot_spec_mappings: aClassName
  1782     ^ Dictionary new                                               
  1787     ^ Dictionary new                                               
  1783         at: #'CLASSFILE' 
  1788         at: 'CLASSFILE' 
  1784         put: [
  1789         put: ( (Smalltalk classNamed:aClassName) classFilename asFilename withoutSuffix baseName );
  1785                 (Smalltalk classNamed:aClassName) 
       
  1786                     classFilename asFilename
       
  1787                         withoutSuffix baseName.
       
  1788             ];
       
  1789         yourself
  1790         yourself
  1790 
  1791 
  1791     "Created: / 08-08-2006 / 20:17:28 / fm"
  1792     "Created: / 08-08-2006 / 20:17:28 / fm"
  1792     "Modified: / 09-08-2006 / 18:26:52 / fm"
  1793     "Modified: / 09-08-2006 / 18:26:52 / fm"
  1793     "Modified: / 30-08-2006 / 14:44:25 / cg"
  1794     "Modified: / 14-09-2006 / 18:51:49 / cg"
  1794 !
  1795 !
  1795 
  1796 
  1796 packageName_dot_rc_mappings
  1797 packageName_dot_rc_mappings
  1797     |d s|
  1798     |d s|
  1798 
  1799 
  1799     d := Dictionary new.
  1800     d := Dictionary new.
  1800     d
  1801     d
  1801         at: #'PRODUCT_NAME' put: [self productName];
  1802         at: 'PRODUCT_NAME' put: (self productName);
  1802         at: #'PRODUCT_VERSION' put: [self productVersion];
  1803         at: 'PRODUCT_VERSION' put: (self productVersion);
  1803         at: #'PRODUCT_DATE' put: [self productDate];
  1804         at: 'PRODUCT_DATE' put: (self productDate);
  1804         at: #'FILETYPE' put: [ 'VFT_DLL' ];
  1805         at: 'FILETYPE' put: ( 'VFT_DLL' );
  1805         at: #'FILE_VERSION_COMMASEPARATED' put: [self fileVersionCommaSeparated];
  1806         at: 'FILE_VERSION_COMMASEPARATED' put: (self fileVersionCommaSeparated);
  1806         at: #'PRODUCT_VERSION_COMMASEPARATED' put: [self productVersionCommaSeparated];
  1807         at: 'PRODUCT_VERSION_COMMASEPARATED' put: (self productVersionCommaSeparated);
  1807 
  1808 
  1808         at: #'COMPANY_NAME' put: [self companyName];
  1809         at: 'COMPANY_NAME' put: (self companyName);
  1809         at: #'FILE_DESCRIPTION' put: [self fileDescription];
  1810         at: 'FILE_DESCRIPTION' put: (self fileDescription);
  1810         at: #'FILE_VERSION' put: [self fileVersion];
  1811         at: 'FILE_VERSION' put: (self fileVersion);
  1811         at: #'INTERNAL_NAME' put: [self internalName].
  1812         at: 'INTERNAL_NAME' put: (self internalName).
  1812     s := self legalCopyright.
  1813     s := self legalCopyright.
  1813     s notNil ifTrue:[
  1814     s notNil ifTrue:[
  1814         d
  1815         d
  1815             at: #'LEGAL_COPYRIGHT_LINE' put: '      VALUE "LegalCopyright", "',s,'\0"'
  1816             at: 'LEGAL_COPYRIGHT_LINE' put: '      VALUE "LegalCopyright", "',s,'\0"'
  1816     ].
  1817     ].
  1817     s := self iconFileName.
  1818     s := self iconFileName.
  1818     s notNil ifTrue:[
  1819     s notNil ifTrue:[
  1819         d
  1820         d
  1820             at: #'ICONDEFINITION_LINE' put: 'IDR_MAINFRAME           ICON    DISCARDABLE     "',s,'"'
  1821             at: #'ICONDEFINITION_LINE' put: 'IDR_MAINFRAME           ICON    DISCARDABLE     "',s,'"'
  1821     ].
  1822     ].
  1822 
  1823 
  1823     ^ d
  1824     ^ d
  1824 
  1825 
  1825     "Created: / 09-08-2006 / 11:21:21 / fm"
  1826     "Created: / 09-08-2006 / 11:21:21 / fm"
  1826     "Modified: / 30-08-2006 / 18:43:49 / cg"
  1827     "Modified: / 14-09-2006 / 18:52:37 / cg"
  1827 !
  1828 !
  1828 
  1829 
  1829 replaceMappings: mappings in: fileTemplate
  1830 replaceMappings: mappings in: fileTemplate
  1830     "Replaces the defined variable mappings found in a file template with the corresponding information"
  1831     "Replaces the defined variable mappings found in a file template with the corresponding information"
  1831 
  1832 
  1838     "Created: / 08-08-2006 / 11:44:27 / fm"
  1839     "Created: / 08-08-2006 / 11:44:27 / fm"
  1839     "Modified: / 08-08-2006 / 12:46:13 / fm"
  1840     "Modified: / 08-08-2006 / 12:46:13 / fm"
  1840 ! !
  1841 ! !
  1841 
  1842 
  1842 !ProjectDefinition class methodsFor:'mappings support'!
  1843 !ProjectDefinition class methodsFor:'mappings support'!
       
  1844 
       
  1845 generateDependencies:whichArchitecture
       
  1846     ^ String streamContents:[:s |
       
  1847         |classNames classesLoaded classesSorted classNamesSorted putDependencyForClass
       
  1848          archClassNames archClassesLoaded putSingleClassDependencyEntry putDependencyForExtensions|
       
  1849 
       
  1850         putSingleClassDependencyEntry :=
       
  1851             [:cls | |sclsBaseName|
       
  1852                 s nextPutAll:' $(INCLUDE_TOP)'.                 
       
  1853                 s nextPutAll:(self pathSeparator:whichArchitecture) asString.
       
  1854                 sclsBaseName := cls classFilename asFilename withoutSuffix baseName.
       
  1855                 s nextPutAll:(self topRelativePathTo:sclsBaseName inPackage:cls package architecture:whichArchitecture).
       
  1856                 s nextPutAll:'.$(H)'.
       
  1857             ].
       
  1858 
       
  1859         putDependencyForClass :=
       
  1860             [:cls |
       
  1861                 |clsBaseName already|
       
  1862 
       
  1863                 clsBaseName := cls classFilename asFilename withoutSuffix baseName.
       
  1864                 s nextPutAll:'$(OUTDIR)'.
       
  1865                 s nextPutAll:clsBaseName.
       
  1866                 s nextPutAll:'.$(O)'.
       
  1867 
       
  1868                 s nextPutAll:' '.
       
  1869                 s nextPutAll:clsBaseName.
       
  1870                 s nextPutAll:'.$(H)'.
       
  1871 
       
  1872                 s nextPutAll:': '.
       
  1873                 s nextPutAll:clsBaseName.
       
  1874                 s nextPutAll:'.st'.
       
  1875                 already := Set new.
       
  1876                 cls allSuperclassesDo:[:scls |
       
  1877                     putSingleClassDependencyEntry value:scls.
       
  1878                     already add:scls.
       
  1879                 ].
       
  1880                 cls privateClassesDo:[:eachPrivateClass |
       
  1881                     eachPrivateClass allSuperclassesDo:[:scls | |sclsBaseName|
       
  1882                         scls ~~ cls ifTrue:[
       
  1883                             scls isPrivate ifFalse:[
       
  1884                                 (already includes:scls) ifFalse:[
       
  1885                                     putSingleClassDependencyEntry value:scls.
       
  1886                                     already add:scls.
       
  1887                                 ].
       
  1888                             ].
       
  1889                         ].
       
  1890                     ]
       
  1891                 ].
       
  1892 
       
  1893                 s nextPutAll:' $(STCHDR)'.                 
       
  1894                 s cr.
       
  1895             ].
       
  1896 
       
  1897         putDependencyForExtensions :=
       
  1898             [
       
  1899                 |already|
       
  1900 
       
  1901                 s nextPutAll:'$(OUTDIR)extensions.$(O): extensions.st'.
       
  1902 
       
  1903                 already := Set new.
       
  1904                 self extensionMethodNames pairWiseDo:[:className :selector |
       
  1905                     |mthdCls cls|
       
  1906 
       
  1907                     ((mthdCls := Smalltalk classNamed:className) notNil and:[mthdCls isLoaded]) ifTrue:[
       
  1908                         cls := mthdCls theNonMetaclass.
       
  1909                         (already includes:cls) ifFalse:[
       
  1910                             cls allSuperclassesDo:[:scls |
       
  1911                                 (already includes:scls) ifFalse:[
       
  1912                                     putSingleClassDependencyEntry value:scls.
       
  1913                                     already add:scls.
       
  1914                                 ].
       
  1915                             ].
       
  1916                         ].
       
  1917                     ].
       
  1918                 ].
       
  1919 
       
  1920                 s nextPutAll:' $(STCHDR)'.                 
       
  1921                 s cr.
       
  1922             ].
       
  1923 
       
  1924         classNames := self common_compiled_classNames.
       
  1925         classesLoaded := classNames 
       
  1926                     collect:[:className | |cls| cls := Smalltalk classNamed:className]
       
  1927                     thenSelect:[:cls |  cls notNil and:[cls isLoaded] ].
       
  1928 
       
  1929         classesSorted := Class classesSortedByLoadOrder:classesLoaded.
       
  1930         classesSorted do:putDependencyForClass.
       
  1931 
       
  1932         self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do:[:className :attr |
       
  1933             |cls|
       
  1934 
       
  1935             (attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[
       
  1936                 ((cls := Smalltalk classNamed:className) notNil and:[cls isLoaded]) ifTrue:[
       
  1937                     putDependencyForClass value:cls.
       
  1938                 ]
       
  1939             ].
       
  1940         ].
       
  1941 
       
  1942         archClassNames := self compiled_classNamesForArchitecture:whichArchitecture.    
       
  1943         archClassesLoaded := archClassNames 
       
  1944                     collect:[:className | |cls| cls := Smalltalk classNamed:className]
       
  1945                     thenSelect:[:cls |  cls notNil and:[cls isLoaded] ].
       
  1946 
       
  1947         archClassesLoaded notEmpty ifTrue:[
       
  1948             (Class classesSortedByLoadOrder:archClassesLoaded) do:putDependencyForClass.
       
  1949         ].
       
  1950 
       
  1951         self hasExtensions ifTrue:putDependencyForExtensions.
       
  1952     ]
       
  1953 
       
  1954     "
       
  1955      stx_libbasic3 generateDependencies:#unix
       
  1956      stx_libbasic3 generateDependencies:#win32
       
  1957     "
       
  1958 
       
  1959     "Modified: / 16-08-2006 / 18:52:10 / User"
       
  1960     "Created: / 14-09-2006 / 12:38:57 / cg"
       
  1961     "Modified: / 14-09-2006 / 17:04:21 / cg"
       
  1962 !
       
  1963 
       
  1964 generateDependencies_unix
       
  1965     ^ self generateDependencies:#unix
       
  1966 
       
  1967     "
       
  1968      stx_libbasic3 generateDependencies:#unix
       
  1969      stx_libbasic3 generateDependencies:#win32
       
  1970     "
       
  1971 
       
  1972     "Modified: / 14-09-2006 / 13:32:34 / cg"
       
  1973 !
       
  1974 
       
  1975 generateDependencies_win32
       
  1976     ^ self generateDependencies:#win32
       
  1977 
       
  1978     "Created: / 14-09-2006 / 12:39:18 / cg"
       
  1979 !
       
  1980 
       
  1981 generateLocalIncludes_win32
       
  1982     ^ String streamContents:[:s |
       
  1983         s nextPutAll:(self localIncludes_win32).
       
  1984         self searchForProjectsWhichProvideHeaderFiles
       
  1985             do:[:includeProject |
       
  1986                 s nextPutAll:' -I$(INCLUDE_TOP)\',(self topRelativePathToPackage_win32: includeProject) 
       
  1987             ]
       
  1988     ]
       
  1989 
       
  1990     "
       
  1991      bosch_dapasx_application generateLocalIncludes_win32
       
  1992      bosch_dapasx_datenbasis generateLocalIncludes_win32  
       
  1993      stx_libbasic generateLocalIncludes_win32              
       
  1994      stx_libview generateLocalIncludes_win32               
       
  1995      stx_libtool2 generateLocalIncludes_win32             
       
  1996     "
       
  1997 
       
  1998     "Created: / 09-08-2006 / 16:46:49 / fm"
       
  1999     "Modified: / 14-09-2006 / 15:37:35 / cg"
       
  2000 !
  1843 
  2001 
  1844 generateObjects_make_dot_spec 
  2002 generateObjects_make_dot_spec 
  1845     |pivateClassesOf sorter classes|
  2003     |pivateClassesOf sorter classes|
  1846 
  2004 
  1847     classes := self compiled_classes_common.
  2005     classes := self compiled_classes_common.
  1920      stx_libbasic3 generateObjects_make_dot_spec
  2078      stx_libbasic3 generateObjects_make_dot_spec
  1921     "
  2079     "
  1922 
  2080 
  1923     "Created: / 09-08-2006 / 11:24:39 / fm"
  2081     "Created: / 09-08-2006 / 11:24:39 / fm"
  1924     "Modified: / 14-09-2006 / 16:21:46 / cg"
  2082     "Modified: / 14-09-2006 / 16:21:46 / cg"
       
  2083 !
       
  2084 
       
  2085 subProjectBmakeCalls
       
  2086     ^ String streamContents:[:s |
       
  2087         self subProjects do:[:packageID |
       
  2088             s cr. 
       
  2089             s nextPutLine:'cd ', (self msdosPathToPackage:packageID from:(self package)). 
       
  2090             s nextPutLine:'call bmake %1 %2'. 
       
  2091             s nextPutLine:'cd ', (self msdosPathToPackage:(self package) from:packageID). 
       
  2092         ]
       
  2093     ]
       
  2094 
       
  2095     "Created: / 14-09-2006 / 18:40:09 / cg"
  1925 ! !
  2096 ! !
  1926 
  2097 
  1927 !ProjectDefinition class methodsFor:'private'!
  2098 !ProjectDefinition class methodsFor:'private'!
  1928 
  2099 
  1929 classNamesAndAttributesDo: aBlock
  2100 classNamesAndAttributesDo: aBlock
  2544 ! !
  2715 ! !
  2545 
  2716 
  2546 !ProjectDefinition class methodsFor:'documentation'!
  2717 !ProjectDefinition class methodsFor:'documentation'!
  2547 
  2718 
  2548 version
  2719 version
  2549     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.58 2006-09-14 15:06:41 cg Exp $'
  2720     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.59 2006-09-14 17:07:34 cg Exp $'
  2550 ! !
  2721 ! !
  2551 
  2722 
  2552 ProjectDefinition initialize!
  2723 ProjectDefinition initialize!