Change appendCFiles to appendOtherSources

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@16580 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2003-04-29 04:33:39 +00:00
parent d9bef5e8f0
commit 88f0f2e8b9
10 changed files with 118 additions and 91 deletions

View file

@ -1,3 +1,19 @@
2003-04-28 Adam Fedor <fedor@gnu.org>
* PCLib/PCMakefileFactory.m (-appendOtherSources): Changed from
appendCFiles.
(-appendHeaders:forTarget:, -appendClasses:forTarget:,
-appendOtherSources:forTarget): New.
(-appendHeaders:, -appendClasses:, -appendOtherSources:,
-appendLibraryHeaders:, appendLibraryClasses:,
appendLibraryOtherSources:): Use them.
* PCLib/PCProject.m (-fileExtensionsForCategory): Add .m to
PCOtherSources.
* PCAppProj/PCAppProject.m (-writeMakefile): Use appendOtherSources:
* PCBundleProj/PCBundleProject.m, PCGormProj/PCGormProject.m,
PCLibProj/PCLibProject.m, PCRenaissanceProj/PCRenaissanceProject.m,
PCToolProj/PCToolProject.m: Idem.
2003-04-27 Adam Fedor <fedor@gnu.org>
* PCAppProj/PCAppProj.pcproj, PCBaseFileTypes/PCBaseFileTypes.pcproj,

View file

@ -190,12 +190,12 @@
[mf appendHeaders:[dict objectForKey:PCHeaders]];
[mf appendClasses:[dict objectForKey:PCClasses]];
[mf appendCFiles:[dict objectForKey:PCOtherSources]];
[mf appendOtherSources:[dict objectForKey:PCOtherSources]];
[mf appendTailForApp];
// Write the new file to disc!
if (mfd = [mf encodedMakefile])
if ((mfd = [mf encodedMakefile]))
{
if ([mfd writeToFile:mfl atomically:YES])
{
@ -223,6 +223,7 @@
- (NSArray *)buildTargets
{
return nil;
}
- (NSString *)projectDescription

View file

@ -47,7 +47,6 @@
{
NSTextField *textField;
NSRect frame = {{84,120}, {80, 80}};
NSBox *box;
[super _initUI];
@ -168,12 +167,12 @@
[mf appendHeaders:[dict objectForKey:PCHeaders]];
[mf appendClasses:[dict objectForKey:PCClasses]];
[mf appendCFiles:[dict objectForKey:PCOtherSources]];
[mf appendOtherSources:[dict objectForKey:PCOtherSources]];
[mf appendTailForBundle];
// Write the new file to disc!
if (mfd = [mf encodedMakefile])
if ((mfd = [mf encodedMakefile]))
{
if ([mfd writeToFile:mfl atomically:YES])
{
@ -201,6 +200,7 @@
- (NSArray *)buildTargets
{
return nil;
}
- (NSString *)projectDescription

View file

@ -191,12 +191,12 @@
[mf appendHeaders:[dict objectForKey:PCHeaders]];
[mf appendClasses:[dict objectForKey:PCClasses]];
[mf appendCFiles:[dict objectForKey:PCOtherSources]];
[mf appendOtherSources:[dict objectForKey:PCOtherSources]];
[mf appendTailForApp];
// Write the new file to disc!
if (mfd = [mf encodedMakefile])
if ((mfd = [mf encodedMakefile]))
{
if ([mfd writeToFile:mfl atomically:YES])
{
@ -224,6 +224,7 @@
- (NSArray *)buildTargets
{
return nil;
}
- (NSString *)projectDescription

View file

@ -27,7 +27,7 @@
- (void)appendHeaders:(NSArray *)array;
- (void)appendClasses:(NSArray *)array;
- (void)appendCFiles:(NSArray *)array;
- (void)appendOtherSources:(NSArray *)array;
- (void)appendInstallDir:(NSString*)dir;
@ -70,7 +70,7 @@
- (void)appendLibraryLibraries:(NSArray*)array;
- (void)appendLibraryHeaders:(NSArray*)array;
- (void)appendLibraryClasses:(NSArray *)array;
- (void)appendLibraryCFiles:(NSArray *)array;
- (void)appendLibraryOtherSources:(NSArray *)array;
@end

View file

@ -22,6 +22,12 @@
#define COMMENT_LIBRARY @"\n\n#\n# Library\n#\n\n"
#define COMMENT_TOOL @"\n\n#\n# Tool\n#\n\n"
@interface PCMakefileFactory (Private)
- (void)appendHeaders:(NSArray *)array forTarget: (NSString *)target;
- (void)appendClasses:(NSArray *)array forTarget: (NSString *)target;
- (void)appendOtherSources:(NSArray *)array forTarget: (NSString *)target;
@end
@implementation PCMakefileFactory
static PCMakefileFactory *_factory = nil;
@ -69,17 +75,40 @@ static PCMakefileFactory *_factory = nil;
[mfile appendString:aString];
}
- (void)appendHeaders:(NSArray *)array
- (void)appendHeaders:(NSArray *)array forTarget: (NSString *)target
{
[self appendString:COMMENT_HEADERS];
[self appendString:[NSString stringWithFormat:@"%@_HEADERS= ",pnme]];
[self appendString:[NSString stringWithFormat:@"%@_HEADER_FILES= ",
target]];
if( array && [array count] )
{
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject])
while ( (tmp = [enumerator nextObject]) )
{
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}
}
- (void)appendHeaders:(NSArray *)array
{
[self appendHeaders: array forTarget: pnme];
}
- (void)appendClasses:(NSArray *)array forTarget: (NSString *)target
{
[self appendString:COMMENT_CLASSES];
[self appendString:[NSString stringWithFormat:@"%@_OBJC_FILES= ", target]];
if( array && [array count] )
{
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while ( (tmp = [enumerator nextObject] ))
{
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
@ -88,36 +117,53 @@ static PCMakefileFactory *_factory = nil;
- (void)appendClasses:(NSArray *)array
{
[self appendString:COMMENT_CLASSES];
[self appendString:[NSString stringWithFormat:@"%@_OBJC_FILES= ",pnme]];
[self appendClasses: array forTarget: pnme];
}
if( array && [array count] )
- (void)appendOtherSources:(NSArray *)array forTarget: (NSString *)target
{
NSMutableArray *marray = nil;
NSEnumerator *oenum;
NSString *file;
[self appendString:COMMENT_CFILES];
[self appendString:[NSString stringWithFormat:@"%@_C_FILES= ", target]];
if ( array == nil || [array count] == 0)
return;
/* Other Sources can have both m files and c files (possibly others?). */
oenum = [array objectEnumerator];
while ((file = [oenum nextObject]))
{
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
if ([file hasSuffix: @".m"])
{
if (marray == nil)
marray = [NSMutableArray arrayWithCapacity: 2];
[marray addObject: file];
}
else /* if ([f hasSuffix: @".c"]) */
{
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",file]];
}
}
while (tmp = [enumerator nextObject])
{
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
[self appendString: @"\n"];
[self appendString:[NSString stringWithFormat:@"%@_OBJC_FILES += ",pnme]];
if ( marray )
{
NSString *file;
NSEnumerator *enumerator = [marray objectEnumerator];
while ( (file = [enumerator nextObject]) )
{
[self appendString:[NSString stringWithFormat:@"\\\n%@ ", file]];
}
}
}
- (void)appendCFiles:(NSArray *)array
- (void)appendOtherSources:(NSArray *)array
{
[self appendString:COMMENT_CFILES];
[self appendString:[NSString stringWithFormat:@"%@_C_FILES= ",pnme]];
if( array && [array count] )
{
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject])
{
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}
[self appendOtherSources: array forTarget: pnme];
}
- (void)appendInstallDir:(NSString*)dir
@ -137,7 +183,7 @@ static PCMakefileFactory *_factory = nil;
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject]) {
while ((tmp = [enumerator nextObject])) {
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}
@ -151,7 +197,7 @@ static PCMakefileFactory *_factory = nil;
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject]) {
while ((tmp = [enumerator nextObject])) {
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}
@ -246,7 +292,7 @@ static PCMakefileFactory *_factory = nil;
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject])
while ((tmp = [enumerator nextObject]))
{
if (![tmp isEqualToString:@"gnustep-base"] &&
![tmp isEqualToString:@"gnustep-gui"])
@ -296,7 +342,7 @@ static PCMakefileFactory *_factory = nil;
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject])
while ((tmp = [enumerator nextObject]))
{
if (![tmp isEqualToString:@"gnustep-base"] &&
![tmp isEqualToString:@"gnustep-gui"])
@ -350,7 +396,7 @@ static PCMakefileFactory *_factory = nil;
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject])
while ((tmp = [enumerator nextObject]))
{
if (![tmp isEqualToString:@"gnustep-base"])
{
@ -363,58 +409,19 @@ static PCMakefileFactory *_factory = nil;
- (void)appendLibraryHeaders:(NSArray*)array
{
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
[self appendString:COMMENT_HEADERS];
[self appendString:[NSString stringWithFormat:@"%@_HEADER_FILES= ",libnme]];
if( array && [array count] )
{
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject])
{
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}
[self appendHeaders: array forTarget: libnme];
}
- (void)appendLibraryClasses:(NSArray *)array
{
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
[self appendString:COMMENT_CLASSES];
[self appendString:[NSString stringWithFormat:@"%@_OBJC_FILES= ",libnme]];
if( array && [array count] )
{
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject])
{
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}
[self appendClasses: array forTarget: libnme];
}
- (void)appendLibraryCFiles:(NSArray *)array
- (void)appendLibraryOtherSources:(NSArray *)array
{
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
[self appendString:COMMENT_CFILES];
[self appendString:[NSString stringWithFormat:@"%@_C_FILES= ",libnme]];
if( array && [array count] )
{
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject])
{
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
[self appendOtherSources: array forTarget: libnme];
}
@end
@ -447,7 +454,7 @@ static PCMakefileFactory *_factory = nil;
NSString *tmp;
NSEnumerator *enumerator = [array objectEnumerator];
while (tmp = [enumerator nextObject])
while ((tmp = [enumerator nextObject]) )
{
if (![tmp isEqualToString:@"gnustep-base"])
{

View file

@ -148,7 +148,7 @@
return [NSArray arrayWithObjects:@"h",nil];
}
else if ([key isEqualToString:PCOtherSources]) {
return [NSArray arrayWithObjects:@"c",@"C",@"M",nil];
return [NSArray arrayWithObjects:@"c",@"C",@"m",@"M",nil];
}
else if ([key isEqualToString:PCLibraries]) {
return [NSArray arrayWithObjects:@"so",@"a",@"lib",nil];
@ -724,7 +724,7 @@
keys = [origin allKeys];
enumerator = [keys objectEnumerator];
while( key = [enumerator nextObject] )
while( (key = [enumerator nextObject]) )
{
if( [projectDict objectForKey:key] == nil )
{

View file

@ -106,12 +106,12 @@
[mf appendLibraryHeaders:[dict objectForKey:PCHeaders]];
[mf appendLibraryClasses:[dict objectForKey:PCClasses]];
[mf appendLibraryCFiles:[dict objectForKey:PCOtherSources]];
[mf appendLibraryOtherSources:[dict objectForKey:PCOtherSources]];
[mf appendTailForLibrary];
// Write the new file to disc!
if (mfd = [mf encodedMakefile])
if ((mfd = [mf encodedMakefile]))
{
if ([mfd writeToFile:mfl atomically:YES])
{
@ -139,6 +139,7 @@
- (NSArray *)buildTargets
{
return nil;
}
- (NSString *)projectDescription

View file

@ -190,7 +190,7 @@
[mf appendHeaders:[dict objectForKey:PCHeaders]];
[mf appendClasses:[dict objectForKey:PCClasses]];
[mf appendCFiles:[dict objectForKey:PCOtherSources]];
[mf appendOtherSources:[dict objectForKey:PCOtherSources]];
[mf appendTailForApp];

View file

@ -118,12 +118,12 @@
[mf appendHeaders:[dict objectForKey:PCHeaders]];
[mf appendClasses:[dict objectForKey:PCClasses]];
[mf appendCFiles:[dict objectForKey:PCOtherSources]];
[mf appendOtherSources:[dict objectForKey:PCOtherSources]];
[mf appendTailForTool];
// Write the new file to disc!
if (mfd = [mf encodedMakefile])
if ((mfd = [mf encodedMakefile]))
{
if ([mfd writeToFile:mfl atomically:YES])
{
@ -151,6 +151,7 @@
- (NSArray *)buildTargets
{
return nil;
}
- (NSString *)projectDescription