Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef MAKEFILECREATOR_H
  8. #define MAKEFILECREATOR_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "utlvector.h"
  13. #include "utlsymbol.h"
  14. #include "utldict.h"
  15. #include "utlmap.h"
  16. #include "vcprojconvert.h"
  17. #include "filesystem.h"
  18. class CMakefileCreator
  19. {
  20. public:
  21. CMakefileCreator();
  22. ~CMakefileCreator();
  23. void CreateMakefiles( CVCProjConvert & proj );
  24. private:
  25. void CleanupFileName( char *name );
  26. void OutputDirs( FileHandle_t f );
  27. void OutputBuildTarget( FileHandle_t f );
  28. void OutputObjLists( CVCProjConvert::CConfiguration & config, FileHandle_t f );
  29. void OutputIncludes( CVCProjConvert::CConfiguration & config, FileHandle_t f );
  30. void OutputMainBuilder( FileHandle_t f );
  31. void CreateBaseDirs( CVCProjConvert::CConfiguration & config );
  32. void CreateMakefileName( const char *projectName, CVCProjConvert::CConfiguration & config );
  33. void CreateDirectoryFriendlyName( const char *dirName, char *friendlyDirName, int friendlyDirNameSize );
  34. void CreateObjDirectoryFriendlyName ( char *name );
  35. void FileWrite( FileHandle_t f, PRINTF_FORMAT_STRING const char *fmt, ... );
  36. CUtlDict<CUtlSymbol, int> m_BaseDirs;
  37. CUtlMap<int, int> m_FileToBaseDirMapping;
  38. struct OutputDirMapping_t
  39. {
  40. CUtlSymbol m_SrcDir;
  41. CUtlSymbol m_ObjDir;
  42. CUtlSymbol m_ObjName;
  43. CUtlSymbol m_ObjOutputDir;
  44. int m_iBaseDirIndex;
  45. };
  46. CUtlVector<struct OutputDirMapping_t> m_BuildDirectories;
  47. CUtlSymbol m_MakefileName;
  48. CUtlSymbol m_ProjName;
  49. CUtlSymbol m_BaseDir;
  50. };
  51. #endif // MAKEFILECREATOR_H