Introduction

tecmake is essentially a general GNU makefile with a series of predefined targets and rules with the purpose of providing those in charge of developing libraries and applications the necessary tools so that versions for different platforms can be generated homogeneously. In other words, the tecmake user does not need to create a complete makefile nor be concerned with the current platform to create a library or application.

Its use is based on a configuration file (config.mak) created by the user which is very similar to a makefile, but only describes which are that product's files and its purpose, either being a library or an application.

Among other resources, there is the generation of distribution and installation files for the UNIX environment.

Distribution files are .tar files containing all files required for the product's compilation in any UNIX platform, without assuming that the GNU make will be available. This way, Tecgraf programmers will be able to generate new versions of the library in any UNIX environment.

Installation files are .tar files containing precompiled versions of the library for a given platform, as well as all other files required to its use (typically .h files). Installation files have the purpose of allowing the transportation of new versions of the library to environments out of Tecgraf.

tecmake is free software. It can be used for public and commercial applications. See the License.

Download

Tecmake is available in two formats tecmake.tar.gz or tecmake.zip.

tecmake package contains of the following files:

tecmake.mak the makefile itself
tecmakewin.mak the makefile for compilers in Windows
tecmake.dist model for the makefile generated by option dist
remote UNIX script used in the remote generation of products (options compile-all or <plataform>)
html folder with the present guide
tecmake UNIX script that calls the GNU make in UNIX
tec_uname.csh
or
tec_uname.bsh
UNIX script to update environment variables, to be run once at every logon or from inside the tecmake script - edit the variables TECTOOLS_HOME and TECMAKE_MAKE in this file to configure the enviroment variables in your system.
tecmake.bat batch file to call the GNU make in Windows - edit this file to configure tecmake to your system
tecmakewin.bat  tecmakepause.bat utilities that complement the tecmake.bat script. Uncomment the pause if you want to break after each build.
slash_parser.exe parser required by Watcom C++, because it does not accept paths with "/"

Installation

To install tecmake, simply extract all files from the compressed file to any folder, for example "c:\tecgraf\tecmake" or "/tecgraf/tecmake".

Then edit the configuration files for your system. Tecmake depends on the following environment variables: TECMAKE_HOME, TEC_UNAME, TEC_SYSNAME and TEC_SYSRELEASE. The configuration files will set them for you. But you must edit the tecmake instalation folder in the script.

The "tecmake" scripts must be in PATH. You can add the tecmake folder to the system PATH or move the "tecmake" or "tecmake.bat" scripts for a folder that is already in PATH.

The requirement to use tecmake is to have the GNU version of the make utility.

Windows

In Windows, the installation of Cygwin (http://www.cygwin.com or http://sources.redhat.com/cygwin/) or the GNU make collection (http://unxutils.sourceforge.net/) is required to have a GNU make functional. You can also compile the GNU make for Windows from sources. Then add the "cygwin/bin" folder to the PATH if not done by the instalation. Make shure to add it before others compiler or the wrong make will be executed. OR you can create a copy of the "make.exe" file under the name "gmake.exe" and configure "tecmake.bat" to call "gmake" instead of "make".

The "tecmake.bat" will also set the needed environment variables. But you must edit this file to adjust the tecmake and the compilers instalation folders.

TIP: Notice that if you use the Cygwin shell in Windows, executing "tecmake" will call the UNIX script, to call the Windows script you must write "tecmake.bat" inside the shell or define an alias, for example  "make -f /cygdrive/c/tecgraf/tecmake/tecmakewin.mak".

TIP: Visual C++ does not need to be in PATH, but it will issue a warning about a file in the IDE folder, "C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin" or "C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE". Simply copy the file to the folder "Vc\bin" or "Vc7\bin", or add the IDE folder to the PATH.

UNIX

In Linux the default make is already the GNU make, so no action is required. But in other systems like AIX, IRIX and SunOS usually the default make is NOT the GNU make, so the GNU make must be installed and configured to be in PATH before the default make. OR you can create a copy of the GNU "make" file under the name "gmake" and configure the "tec_name" script to call "gmake" instead of "make".

Some tecmake features depends on the csh shell, you don't need to use it but it must be installed. But it is not required.

The tec_uname scripts sets all the environment variables, tec_uname.csh is for the csh shell and tec_uname.bsh is for the bash shell, if you use another shell you will need to create a similar script or to set these variables manually. It is not enough to run the script just before runing the tecmake script because the environment variables will be set only for the script environment space. You must run it during the logon process or from inside the tecmake script. For example you can call the "tec_uname.bsh" from your ".bash_profile" or ".bashrc", using:

if [ -f /tecgraf/tecmake/tec_uname.bsh ]; then
	. /tecgraf/tecmake/tec_uname.bsh
fi

PATH=$PATH:$TECMAKE_HOME:$TECTOOLS_HOME/lua5.1/bin/$TEC_UNAME
export PATH

TIP: In Ubuntu use ".bashrc" instead of ".bash_profile".

For csh use ".cshrc" :

source /tecgraf/tecmake/tec_uname.csh

set path = ( $path $TECMAKE_HOME $TECTOOLS_HOME/lua5.1/bin/$TEC_UNAME )

TIP: Sometimes when you unpack the files they loose their attributes, so it is also common to set:

chmod a+x tecmake/*

Summary

  1. Unpack tecmake
  2. Install GNU make (Non Linux Systems)
  3. Edit PATH
  4. Edit tecmake.bat or tec_uname.bsh
  5. Edit .bash_profile or .bashrc (For bash shell)

To Do

Team

libmake and appmake were originally developed by André Oliveira da Costa and Renato Ferreira Borges. The Windows version was originally developed by Diogo Andrade. We have also obtained valuable collaboration from João Luiz Campos and André Clínio.

tecmake was developed and it is maintained by Antonio Scuri.

License

Copyright 1994-2006 Tecgraf / PUC-Rio.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.