Commit ecd4acfb authored by John Biddiscombe's avatar John Biddiscombe

NEW: First check in of Borland Makefile Generator and template stuff

parent cc5c1fa6
This diff is collapsed.
#ifndef cmBorlandMakefileGenerator_h
#define cmBorlandMakefileGenerator_h
#include "cmMakefile.h"
#include "cmMakefileGenerator.h"
/** \class cmBorlandMakefileGenerator
* \brief Write a Unix makefiles.
*
* cmBorlandMakefileGenerator produces a Unix makefile from its
* member m_Makefile.
*/
class cmBorlandMakefileGenerator : public cmMakefileGenerator {
public:
///! Set cache only and recurse to false by default.
cmBorlandMakefileGenerator();
//! just sets the Cache Only and Recurse flags
virtual void SetLocal(bool local);
/**
* If cache only is on.
* Only stub makefiles are generated, and no depends, for speed.
* The default is OFF.
**/
void SetCacheOnlyOn() {m_CacheOnly = true;}
void SetCacheOnlyOff() {m_CacheOnly = false;}
/**
* If recurse is on, then all the makefiles below this one are parsed as well.
*/
void SetRecurseOn() {m_Recurse = true;}
void SetRecurseOff() {m_Recurse = false;}
/**
* Produce the makefile (in this case a Unix makefile).
*/
virtual void GenerateMakefile();
/**
* Output the depend information for all the classes
* in the makefile. These would have been generated
* by the class cmMakeDepend.
*/
void OutputObjectDepends(std::ostream&);
/**
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void ComputeSystemInfo();
private:
void RecursiveGenerateCacheOnly();
void GenerateCacheOnly();
void OutputMakefile(const char* file);
void OutputTargetRules(std::ostream& fout);
void OutputTargets(std::ostream&);
void OutputSubDirectoryRules(std::ostream&);
void OutputDependInformation(std::ostream&);
void OutputDependencies(std::ostream&);
void OutputCustomRules(std::ostream&);
void OutputMakeVariables(std::ostream&);
void OutputMakeRules(std::ostream&);
void OutputSubDirectoryVars(std::ostream& fout,
const char* var,
const char* target,
const char* target1,
const char* target2,
const std::vector<std::string>& SubDirectories);
void OutputMakeRule(std::ostream&,
const char* comment,
const char* target,
const char* depends,
const char* command);
private:
bool m_CacheOnly;
bool m_Recurse;
};
#endif
#
# Borland configuration.
# Note that this is valid for Borland C++Builder 5 with patch #1
#
SET (WORDS_BIGENDIAN )
SET (CMAKE_CXX_COMPILER "Borland_BCB_5.5.1" CACHE STRING "C++ compiler used.")
#
# We need the Borland compiler path
#
FIND_PATH(BCB_BIN_PATH bcc32.exe
"C:/Program Files/Borland/CBuilder5/Bin"
[HKEY_LOCAL_MACHINE/SOFTWARE/Borland/C++Builder/5.0/RootDir]/Bin
)
#
# Set default exe and lib directories
#
IF (NOT LIBRARY_OUTPUT_PATH)
SET (LIBRARY_OUTPUT_PATH "c:/bin" CACHE STRING "Directory for libraries to be built into.")
ENDIF (NOT LIBRARY_OUTPUT_PATH)
IF (NOT EXECUTABLE_OUTPUT_PATH)
SET (EXECUTABLE_OUTPUT_PATH "" CACHE STRING "Directory for executables to be built into.")
ENDIF (NOT EXECUTABLE_OUTPUT_PATH)
#
# override opengl library as it is bound to import32.lib already
#
IF (OPENGL_LIBRARY)
SET (OPENGL_LIBRARY import32 CACHE STRING "OpenGL library linked by Borland's import32.lib")
ENDIF (OPENGL_LIBRARY)
#
# Set debug compile flags if not already set/edited by user
#
IF (NOT FLAGS_CPP_DEBUG)
SET (FLAGS_CPP_DEBUG "-a8 -c -d -tWM -tWR -Ve -Vx -k -Od -r- -v -vi- -y" CACHE STRING "Flags used by CPP compiler in DEBUG mode")
ENDIF (NOT FLAGS_CPP_DEBUG)
#
# Set release compile flags if not already set/edited by user
#
IF (NOT FLAGS_CPP_RELEASE)
SET (FLAGS_CPP_RELEASE "-a8 -c -d -tWM -tWR -Ve -Vx -k- -O2 -r -v-" CACHE STRING "Flags used by CPP compiler in RELEASE mode")
ENDIF (NOT FLAGS_CPP_RELEASE)
#
# Set compiler warning flags if not already set/edited by user
#
IF (NOT FLAGS_CPP_WARNING)
SET (FLAGS_CPP_WARNING "-w- -whid -waus -wpar" CACHE STRING "Flags used to control compiler warnings")
ENDIF (NOT FLAGS_CPP_WARNING)
#
# Set link flags if not already set/edited by user
#
IF (NOT FLAGS_LINK_DLL)
SET (FLAGS_LINK_DLL "-aa -Tpd -x -Gn -Gl" CACHE STRING "Flags used by Linker for DLL")
ENDIF (NOT FLAGS_LINK_DLL)
IF (NOT FLAGS_LINK_BPL)
SET (FLAGS_LINK_BPL "-aa -Tpp -x -Gn -Gi" CACHE STRING "Flags used by Linker for BPL")
ENDIF (NOT FLAGS_LINK_BPL)
IF (NOT FLAGS_LINK_LIB)
SET (FLAGS_LINK_LIB "-aa -x -Gn -Gl -P128" CACHE STRING "Flags used by Linker for DLL")
ENDIF (NOT FLAGS_LINK_LIB)
IF (NOT FLAGS_LINK_EXE)
SET (FLAGS_LINK_EXE "-aa -Tpe -x -Gn" CACHE STRING "Flags used by Linker for EXE")
ENDIF (NOT FLAGS_LINK_EXE)
IF (NOT FLAGS_LINK_DEBUG)
SET (FLAGS_LINK_DEBUG "-v" CACHE STRING "Flags used by Linker in DEBUG mode")
ENDIF (NOT FLAGS_LINK_DEBUG)
IF (NOT FLAGS_LINK_STATIC)
SET (FLAGS_LINK_STATIC "/P128" CACHE STRING "Set default Page size to 128 for static libraries")
ENDIF (NOT FLAGS_LINK_STATIC)
#
# Set User Conditional Defines to Defaults
#
IF (NOT DEFS_USER)
SET (DEFS_USER "" CACHE STRING "Compiler conditional defines set by the user")
ENDIF (NOT DEFS_USER)
#
# Set SYS Conditional Defines to Defaults
#
IF (NOT DEFS_SYS)
SET (DEFS_SYS "-DWIN32;WIN32_LEAN_AND_MEAN;STRICT;_RTLDLL;USEPACKAGES" CACHE STRING "Compiler conditional defines required for correct compilation")
ENDIF (NOT DEFS_SYS)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment