From 6c4e1a4c6591026d41f6ec5d65ae42cacc5b9b79 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Thu, 14 Feb 2008 03:11:32 +0000 Subject: [PATCH] * Framework/PCMakefileFactory.m: Correction for bug#22311. Added project-type specific makefile generation. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@26060 72102866-910b-0410-8b05-ffd578937521 --- Framework/PCMakefileFactory.m | 55 +++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/Framework/PCMakefileFactory.m b/Framework/PCMakefileFactory.m index d6139d0..e140938 100644 --- a/Framework/PCMakefileFactory.m +++ b/Framework/PCMakefileFactory.m @@ -110,6 +110,7 @@ static PCMakefileFactory *_factory = nil; NSArray *array = nil; NSDictionary *projectDict = [project projectDict]; NSString *projectPath = [project projectPath]; + NSString *projectType = [project projectTypeName]; // Create the new file [mfp appendString:@"#\n"]; @@ -175,28 +176,52 @@ static PCMakefileFactory *_factory = nil; } [mfp appendString:@"\n\n"]; -// [mfp appendString:[projectDict objectForKey:PCLibraries]]; + // [mfp appendString:[projectDict objectForKey:PCLibraries]]; - // Additional GUI libraries - // TODO: Let the user select objc, base, gui libraries/frameworks - // on the gui - the following works well for GUI stuff only. - [mfp appendString:@"# Additional GUI libraries to link\n"]; - [mfp appendString: @"ADDITIONAL_GUI_LIBS += "]; - array = [projectDict objectForKey:PCLibraries]; - if (array && [array count]) + if([projectType isEqualToString: @"Tool"]) { - NSString *tmp; - NSEnumerator *enumerator = [array objectEnumerator]; - - while ((tmp = [enumerator nextObject])) + // Additional TOOL libraries + [mfp appendString:@"# Additional TOOL libraries to link\n"]; + [mfp appendString: @"ADDITIONAL_TOOL_LIBS += "]; + array = [projectDict objectForKey:PCLibraries]; + if (array && [array count]) { - if (![tmp isEqualToString:@"gnustep-base"] && - ![tmp isEqualToString:@"gnustep-gui"]) + NSString *tmp; + NSEnumerator *enumerator = [array objectEnumerator]; + + while ((tmp = [enumerator nextObject])) { - [mfp appendString:[NSString stringWithFormat:@"-l%@ ",tmp]]; + if (![tmp isEqualToString:@"gnustep-base"]) + { + [mfp appendString:[NSString stringWithFormat:@"-l%@ ",tmp]]; + } } } } + else + { + // Additional GUI libraries + // TODO: Let the user select objc, base, gui libraries/frameworks + // on the gui - the following works well for GUI stuff only. + [mfp appendString:@"# Additional GUI libraries to link\n"]; + [mfp appendString: @"ADDITIONAL_GUI_LIBS += "]; + array = [projectDict objectForKey:PCLibraries]; + if (array && [array count]) + { + NSString *tmp; + NSEnumerator *enumerator = [array objectEnumerator]; + + while ((tmp = [enumerator nextObject])) + { + if (![tmp isEqualToString:@"gnustep-base"] && + ![tmp isEqualToString:@"gnustep-gui"]) + { + [mfp appendString:[NSString stringWithFormat:@"-l%@ ",tmp]]; + } + } + } + } + [mfp appendString:@"\n\n"]; // Write the new file to disc!