Tecmake usage is quite simple. Just call "tecmake" in the folder that contains the "config.mak" file. If your configuration file has a different name, then you should call:
tecmake MF=myconf
In Windows, to add any parameter you must first add the platform, i.e. "tecmake rebuild" must be "tecmake vc7 rebuild" even if vc7 is the default platform. Also in Windows to add a definition you must enclose it with quotes, for ex:
tecmake vc7 "MF=myconf"
Concerning the folder structure, all tecmake needs to run is a folder where the source files will be placed. The diagram below illustrates the folder structure used:
Folders include, obj and lib are created automatically, as well as the subfolders related to the platforms. The folder src is the one from which tecmake must be executed (note: this folder does not need to have this name). Folder include will contain the exported inclusion files associated to the variable EXPINC. This folder will contain only links to the files in folder src. Similarly, the folder lua will exist only when the variable EXPLUA is defined and will also only contain links to files in the src folder.
tecmake was designed to have folder src as reference in the hierarchy presented above, that is, the user will have to work with the current file being src, from where s/he can easily access the product's source files.
These are the compiler parameters used internally by Tecmake.
-Wall (always) -g (DBG) -O2 (OPT) -m64 -fPIC (BUILD_64) -bundle -undefined dynamic_lookup (for shared code libraries in MacOS X) -dynamiclib -install_name lib$(TARGETNAME).dylib (for dynamic libraries in MacOS X when BUILD_DYLIB=Yes)
-od -w4 -5r -bt=nt -mf -e25 -zq (always) -d2 (DBG) -ot (OPT) -b -c -n -q -p=512 (libraries) -bm -br (USE_DLL)
-v -N -x -xp (DBG) -O2 (OPT) -tWDMR (USE_DLL)
-W3 -GX (always) -O2 -GL -LTCG (OPT) -Z7 -Od -GZ (DBG) -ML -MLd (DBG) -MD (USE_DLL) -MDd (USE_DLL+DBG) -MT (USE_MT) -MTd (USE_MT+DBG) O2 = Maximize Speed Z7 = C7 Compatible Gd (default) = cdecl calling convention GZ = Run-Time Error Checks LTCG, GL = Whole Program Optimization M* = Run-Time Library (options are mutually exclusive) (There is no single thread in VC8 or VC9, USE_MT=Yes is always set) _CRT_SECURE_NO_DEPRECATE is defined for VC8 and VC9. To enable automatic manifest file generation and embedding in VC8 or VC9 use GEN_MANIFEST=Yes. To enable C++ additional definitions for RTL functions in VC8 or VC9 use CPP_NARROW_INLINES=Yes.
In UNIX/Posix, Tecmake can be distributed together with the source code with no need for an additional installation. Simply copy the file "tecmake.mak" to your source code and rename it to "Makefile".
To build the target simply do "make" on the command line. The Tecmake parameters can be used simply as doing "make clean". But notice that not all parameters are available (see note bellow).
To build several targets, keep the original name and create a new file called "Makefile" with contents similar to the following:
all: target1 target2 target3 target1: @$(MAKE) --no-print-directory -f tecmake.mak #(to let Tecmake use "config.mak") target2: @$(MAKE) --no-print-directory -f tecmake.mak MF=target2 #(to make Tecmake use "target2.mak") target3: @$(MAKE) --no-print-directory -f tecmake.mak MF=target3 #(to make Tecmake use "target3.mak")
Then you can use your own parameters to build different targets.
As a general rule the following are not supported without instalation: the "*-all" parameters and remote build.
If you are building a library or application that depends on a Tecgraf library like IUP, CD or IM, then define the TECTOOLS_HOME variable inside your "config.mak". It points to the base path where those libraries are installed. It can be a relative path like "../..".
IMPORTANT: This form of Makefile is know NOT to work on the systems: FreeBSD54, AIX43, IRIX6465 and IRIX65. There are unsolved syntax problems on those systems when using the "($shell uname)" command.
Here is a small tutorial on how to setup a minimum Windows build system to use Tecmake and Microsoft Visual C++ 2008.
shortpath "C:\Program Files\Microsoft SDKs\Windows\v6.1" C:\PROGRA~1\MICROS~2\Windows\v6.1 shortpath "C:\Program Files\Microsoft Visual Studio 9.0\VC" C:\PROGRA~1\MICROS~1.0\VC
set TECMAKE_PATH=c:\tecgraf\tecmake set TECMAKE_HOME=/cygdrive/c/tecgraf/tecmake set VC9=C:/PROGRA~1/MICROS~1.0/VC set VC9SDK=C:/PROGRA~1/MICROS~2/Windows/v6.1
The simplest way to use it is to run the "CMD Shell" item in the "Microsoft Windows SDK v6.1" start menu folder. Then at the folder of your project with the "config.mak" file type in the command line:
tecmake vc9
Notice that Visual C++ Express 2008 is not installed, the Windows SDK already includes the necessary command line compilers. But if it is installed will be placed in the same folders of the Windows SDK compilers. On the other hand the Windows SDK does not includes the Visual Studio.
This minimum installation considers that no dependencies are necessary and USE_NODEPEND is set at "config.mak". If you need dependencies then run the Cygwin setup again and mark the "gcc/g++", "sed" and "which" items.
Here is a small tutorial on how to setup a minimum Windows build system to use Tecmake and MingW.
set TECMAKE_PATH=c:\tecgraf\tecmake set TECMAKE_HOME=/cygdrive/c/tecgraf/tecmake set MINGW3=c:/mingw
Start a command line with "cmd", then at the folder of your project with the "config.mak" file type in the command line:
tecmake mingw3
A very minimum MingW installation can be done without installing Cygwin. Only install MingW and set PATH to its bin folder.