diff --git a/PCLib/PCMakefileFactory.h b/PCLib/PCMakefileFactory.h index a5308ea..d2c34b8 100644 --- a/PCLib/PCMakefileFactory.h +++ b/PCLib/PCMakefileFactory.h @@ -29,6 +29,8 @@ - (void)appendClasses:(NSArray *)array; - (void)appendCFiles:(NSArray *)array; +- (void)appendInstallDir:(NSString*)dir; + - (void)appendResources; - (void)appendResourceItems:(NSArray *)array; @@ -49,7 +51,6 @@ - (void)appendApplication; - (void)appendAppIcon:(NSString*)icn; - (void)appendGuiLibraries:(NSArray*)array; -- (void)appendInstallDir:(NSString*)dir; @end @@ -73,5 +74,13 @@ @end +@interface PCMakefileFactory (ToolProject) + +- (void)appendTool; +- (void)appendToolIcon:(NSString*)icn; +- (void)appendToolLibraries:(NSArray*)array; + +@end + #endif // _PCMAKEFILEFACTORY_H_ diff --git a/PCLib/PCMakefileFactory.m b/PCLib/PCMakefileFactory.m index 8d9c788..9481b9d 100644 --- a/PCLib/PCMakefileFactory.m +++ b/PCLib/PCMakefileFactory.m @@ -19,6 +19,7 @@ #define COMMENT_LIBRARIES @"\n\n#\n# Additional libraries\n#\n\n" #define COMMENT_BUNDLE @"\n\n#\n# Bundle\n#\n\n" #define COMMENT_LIBRARY @"\n\n#\n# Library\n#\n\n" +#define COMMENT_TOOL @"\n\n#\n# Tool\n#\n\n" @implementation PCMakefileFactory @@ -118,6 +119,12 @@ static PCMakefileFactory *_factory = nil; } } +- (void)appendInstallDir:(NSString*)dir +{ + [self appendString: + [NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR=%@\n",dir]]; +} + - (void)appendResources { [self appendString:COMMENT_RESOURCES]; @@ -179,7 +186,13 @@ static PCMakefileFactory *_factory = nil; - (void)appendTailForTool { - [self appendString:@""]; + [self appendString:@"\n\n"]; + + [self appendString:@"-include GNUmakefile.preamble\n"]; + [self appendString:@"-include GNUmakefile.local\n"]; + [self appendString:@"include $(GNUSTEP_MAKEFILES)/aggregate.make\n"]; + [self appendString:@"include $(GNUSTEP_MAKEFILES)/tool.make\n"]; + [self appendString:@"-include GNUmakefile.postamble\n"]; } - (void)appendTailForBundle @@ -243,12 +256,6 @@ static PCMakefileFactory *_factory = nil; } } -- (void)appendInstallDir:(NSString*)dir -{ - [self appendString: - [NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR=%@\n",dir]]; -} - @end @implementation PCMakefileFactory (BundleProject) @@ -412,3 +419,43 @@ static PCMakefileFactory *_factory = nil; @end +@implementation PCMakefileFactory (ToolProject) + +- (void)appendTool +{ + [self appendString:COMMENT_TOOL]; + + [self appendString:[NSString stringWithFormat:@"PACKAGE_NAME=%@\n",pnme]]; + [self appendString:[NSString stringWithFormat:@"TOOL_NAME=%@\n",pnme]]; + +} + +- (void)appendToolIcon:(NSString*)icn +{ + [self appendString: + [NSString stringWithFormat:@"%@_TOOL_ICON=%@\n",pnme, icn]]; +} + +- (void)appendToolLibraries:(NSArray*)array +{ + [self appendString:COMMENT_LIBRARIES]; + + [self appendString:[NSString stringWithFormat:@"%@_TOOL_LIBS += ",pnme]]; + + if( array && [array count] ) + { + NSString *tmp; + NSEnumerator *enumerator = [array objectEnumerator]; + + while (tmp = [enumerator nextObject]) + { + if (![tmp isEqualToString:@"gnustep-base"]) + { + [self appendString:[NSString stringWithFormat:@"-l%@ ",tmp]]; + } + } + } +} + +@end +