⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmake.h

📁 利用XML来作为Makefile的make工具源代码.
💻 H
字号:
//XMLMake.h

#ifndef _XMLMAKE_H__
#define _XMLMAKE_H__

/**
Original makedep.c dependency code: Sulyok P倀er (C) 1994.
Altered by Jim Crafton, Feb,8,2002
*/


// Constants ----------------------------------------------------------------
#ifdef MAXPATH
#undef MAXPATH
#endif
#define MAXPATH					256                  // Maximal size of path.
#define MAX_INCLUDE_DEPTH		150                   // Maximum number of path.

#define NUM_FILE_EXT			6                    // Number of source file extensions.
#define LINE_SIZE				256                  // Line size.


typedef std::vector<String> StringList;
typedef std::vector<String>::iterator StringListIterator;


class XMLNode;

/**
*XMLMake is a just a class witha bunch of static functions to keep thigns grouped together
*/
class XMLMake {
public:
	static long includeCount;

	//this is the list of include directories
	static StringList includeDirectories;

	static String configToBuild;

	static String srcBinExt;

	static String makefile;

	static String usage;

	static String projectToBuild;

	static bool runInstall;

	static bool runClean;

	static StringList dependencyList;

	static StringList buildList;

	static bool verbose;

	static String defaultOutputDir;

	/**
	*Search the dependencies of the given source file.
	*@param char *name source file name	
	*/
	static void makeDependFiles( String name, StringList& dependsList, long& dependencyCount );
	
	static void searchIncludeFile( const String& name, long& dependencyCount, StringList& dependsList );
	
	static const char* nextWhiteSpace( const char *s );
	
	static const char* nextNonWhiteSpace( const char *s );

	static void replaceEnvironmentStrings( Enumerator<XMLNode*>* nodes );
	
	static bool parseCommandLine( int argc, char** argv );

	static void doBuild();

	static void doPreBuild( XMLNode* preBuildnode );

	static void doPostBuild( XMLNode* postBuildnode );

	static void doInstall();

	static void doClean();

	static int exec( const String& commandLine, const String& currentDirectory );

	static bool deleteFile( const String& filename );

	static void buildDependencyList( Enumerator<XMLNode*>* nodes );

	static bool fileNewerThan( const String& file, const String& srcFile );

	static bool isSourceNodeInConfig( const String& configName, XMLNode* node );
	
	static void error( const String& errMessage );

	static bool verifyFileName( const String& filename, const bool& autoBuildDir=true );

	static bool verifyOutputFileForSrc( const String& srcName, const String& outputName ); 

	static String getEnvironmentVariableValue( const String& variableName );

	static String getCurrentDirectory();	

	static String getFileName( const String& fullPathToFile );

	static String getOutputFileName( const String& srcFile, const String& outputName="" );
	
	static int findLastStringIn( const String& src, const String& searchFor );
private:
	static StringList findFilesInDir(String dir);
};


#endif  //_XMLMAKE_H__


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -