summaryrefslogtreecommitdiffstats
path: root/tmake
diff options
context:
space:
mode:
authormueller <mueller@afe2bf4a-e733-0410-8a33-86f594647bc7>1999-12-15 19:25:10 (GMT)
committermueller <mueller@afe2bf4a-e733-0410-8a33-86f594647bc7>1999-12-15 19:25:10 (GMT)
commit719f0a35063be88eddcc4ed8fe7a940de47ef20c (patch)
treecc1cd70cf5761ddf72ff114c0b65576c3f4c1d2a /tmake
parentbd30c025c4651ddda467f1af09d4c7ccab397bde (diff)
downloadDoxygen-719f0a35063be88eddcc4ed8fe7a940de47ef20c.zip
Doxygen-719f0a35063be88eddcc4ed8fe7a940de47ef20c.tar.gz
Doxygen-719f0a35063be88eddcc4ed8fe7a940de47ef20c.tar.bz2
initial version
Diffstat (limited to 'tmake')
-rw-r--r--tmake/CHANGES39
-rw-r--r--tmake/LICENSE9
-rw-r--r--tmake/README7
-rwxr-xr-xtmake/bin/progen249
-rw-r--r--tmake/bin/progen.bat266
-rwxr-xr-xtmake/bin/tmake1099
-rw-r--r--tmake/bin/tmake.bat1093
-rw-r--r--tmake/doc/m-linux-gcc.html85
-rw-r--r--tmake/doc/m-win32-msvc.html89
-rw-r--r--tmake/doc/tmake.html638
-rw-r--r--tmake/doc/tmake_ref.html508
-rw-r--r--tmake/example/hello.cpp102
-rw-r--r--tmake/example/hello.h34
-rw-r--r--tmake/example/hello.pro3
-rw-r--r--tmake/example/main.cpp38
-rw-r--r--tmake/example/wc.t6
-rwxr-xr-xtmake/lib/aix-g++/app.t2
-rwxr-xr-xtmake/lib/aix-g++/lib.t2
-rwxr-xr-xtmake/lib/aix-g++/subdirs.t2
-rwxr-xr-xtmake/lib/aix-g++/tmake.conf57
-rwxr-xr-xtmake/lib/aix-xlc/app.t2
-rwxr-xr-xtmake/lib/aix-xlc/lib.t2
-rwxr-xr-xtmake/lib/aix-xlc/subdirs.t2
-rwxr-xr-xtmake/lib/aix-xlc/tmake.conf63
-rwxr-xr-xtmake/lib/dgux-g++/app.t2
-rwxr-xr-xtmake/lib/dgux-g++/lib.t2
-rwxr-xr-xtmake/lib/dgux-g++/subdirs.t2
-rwxr-xr-xtmake/lib/dgux-g++/tmake.conf58
-rwxr-xr-xtmake/lib/freebsd-g++/app.t2
-rwxr-xr-xtmake/lib/freebsd-g++/lib.t2
-rwxr-xr-xtmake/lib/freebsd-g++/subdirs.t2
-rwxr-xr-xtmake/lib/freebsd-g++/tmake.conf59
-rwxr-xr-xtmake/lib/gnu-g++/app.t2
-rwxr-xr-xtmake/lib/gnu-g++/lib.t2
-rwxr-xr-xtmake/lib/gnu-g++/subdirs.t2
-rwxr-xr-xtmake/lib/gnu-g++/tmake.conf57
-rwxr-xr-xtmake/lib/hpux-acc/app.t2
-rwxr-xr-xtmake/lib/hpux-acc/lib.t2
-rwxr-xr-xtmake/lib/hpux-acc/subdirs.t2
-rwxr-xr-xtmake/lib/hpux-acc/tmake.conf59
-rwxr-xr-xtmake/lib/hpux-cc/app.t2
-rwxr-xr-xtmake/lib/hpux-cc/lib.t2
-rwxr-xr-xtmake/lib/hpux-cc/subdirs.t2
-rwxr-xr-xtmake/lib/hpux-cc/tmake.conf58
-rwxr-xr-xtmake/lib/hpux-g++/app.t2
-rwxr-xr-xtmake/lib/hpux-g++/lib.t2
-rwxr-xr-xtmake/lib/hpux-g++/subdirs.t2
-rwxr-xr-xtmake/lib/hpux-g++/tmake.conf59
-rwxr-xr-xtmake/lib/irix-64/app.t2
-rwxr-xr-xtmake/lib/irix-64/lib.t2
-rwxr-xr-xtmake/lib/irix-64/subdirs.t2
-rwxr-xr-xtmake/lib/irix-64/tmake.conf59
-rwxr-xr-xtmake/lib/irix-dcc/app.t2
-rwxr-xr-xtmake/lib/irix-dcc/lib.t2
-rwxr-xr-xtmake/lib/irix-dcc/subdirs.t2
-rwxr-xr-xtmake/lib/irix-dcc/tmake.conf59
-rwxr-xr-xtmake/lib/irix-g++/app.t2
-rwxr-xr-xtmake/lib/irix-g++/lib.t2
-rwxr-xr-xtmake/lib/irix-g++/subdirs.t2
-rwxr-xr-xtmake/lib/irix-g++/tmake.conf59
-rwxr-xr-xtmake/lib/irix-n32/app.t2
-rwxr-xr-xtmake/lib/irix-n32/lib.t2
-rwxr-xr-xtmake/lib/irix-n32/subdirs.t2
-rwxr-xr-xtmake/lib/irix-n32/tmake.conf59
-rwxr-xr-xtmake/lib/linux-g++/app.t2
-rwxr-xr-xtmake/lib/linux-g++/lib.t2
-rwxr-xr-xtmake/lib/linux-g++/subdirs.t2
-rwxr-xr-xtmake/lib/linux-g++/tmake.conf57
-rwxr-xr-xtmake/lib/netbsd-g++/app.t2
-rwxr-xr-xtmake/lib/netbsd-g++/lib.t2
-rwxr-xr-xtmake/lib/netbsd-g++/subdirs.t2
-rwxr-xr-xtmake/lib/netbsd-g++/tmake.conf60
-rwxr-xr-xtmake/lib/openbsd-g++/app.t2
-rwxr-xr-xtmake/lib/openbsd-g++/lib.t2
-rwxr-xr-xtmake/lib/openbsd-g++/subdirs.t2
-rwxr-xr-xtmake/lib/openbsd-g++/tmake.conf60
-rwxr-xr-xtmake/lib/osf1-cxx/app.t2
-rwxr-xr-xtmake/lib/osf1-cxx/lib.t2
-rwxr-xr-xtmake/lib/osf1-cxx/subdirs.t2
-rwxr-xr-xtmake/lib/osf1-cxx/tmake.conf57
-rwxr-xr-xtmake/lib/osf1-g++/app.t2
-rwxr-xr-xtmake/lib/osf1-g++/lib.t2
-rwxr-xr-xtmake/lib/osf1-g++/subdirs.t2
-rwxr-xr-xtmake/lib/osf1-g++/tmake.conf57
-rwxr-xr-xtmake/lib/qnx-g++/app.t2
-rwxr-xr-xtmake/lib/qnx-g++/lib.t2
-rwxr-xr-xtmake/lib/qnx-g++/subdirs.t2
-rwxr-xr-xtmake/lib/qnx-g++/tmake.conf57
-rwxr-xr-xtmake/lib/sco-g++/app.t2
-rwxr-xr-xtmake/lib/sco-g++/lib.t2
-rwxr-xr-xtmake/lib/sco-g++/subdirs.t2
-rwxr-xr-xtmake/lib/sco-g++/tmake.conf57
-rwxr-xr-xtmake/lib/solaris-cc/app.t2
-rwxr-xr-xtmake/lib/solaris-cc/lib.t2
-rwxr-xr-xtmake/lib/solaris-cc/subdirs.t2
-rwxr-xr-xtmake/lib/solaris-cc/tmake.conf60
-rwxr-xr-xtmake/lib/solaris-g++/app.t2
-rwxr-xr-xtmake/lib/solaris-g++/lib.t2
-rwxr-xr-xtmake/lib/solaris-g++/subdirs.t2
-rwxr-xr-xtmake/lib/solaris-g++/tmake.conf57
-rwxr-xr-xtmake/lib/sunos-g++/app.t2
-rwxr-xr-xtmake/lib/sunos-g++/lib.t2
-rwxr-xr-xtmake/lib/sunos-g++/subdirs.t2
-rwxr-xr-xtmake/lib/sunos-g++/tmake.conf57
-rwxr-xr-xtmake/lib/ultrix-g++/app.t2
-rwxr-xr-xtmake/lib/ultrix-g++/lib.t2
-rwxr-xr-xtmake/lib/ultrix-g++/subdirs.t2
-rwxr-xr-xtmake/lib/ultrix-g++/tmake.conf57
-rwxr-xr-xtmake/lib/unix/app.t6
-rwxr-xr-xtmake/lib/unix/generic.t268
-rwxr-xr-xtmake/lib/unix/lib.t6
-rwxr-xr-xtmake/lib/unix/subdirs.t36
-rwxr-xr-xtmake/lib/unixware-g++/app.t2
-rwxr-xr-xtmake/lib/unixware-g++/lib.t2
-rwxr-xr-xtmake/lib/unixware-g++/subdirs.t2
-rwxr-xr-xtmake/lib/unixware-g++/tmake.conf57
-rwxr-xr-xtmake/lib/win32-borland/app.t6
-rwxr-xr-xtmake/lib/win32-borland/generic.t229
-rwxr-xr-xtmake/lib/win32-borland/lib.t6
-rwxr-xr-xtmake/lib/win32-borland/subdirs.t33
-rwxr-xr-xtmake/lib/win32-borland/tmake.conf56
-rwxr-xr-xtmake/lib/win32-g++/app.t6
-rwxr-xr-xtmake/lib/win32-g++/generic.t226
-rwxr-xr-xtmake/lib/win32-g++/lib.t6
-rwxr-xr-xtmake/lib/win32-g++/subdirs.t2
-rwxr-xr-xtmake/lib/win32-g++/tmake.conf56
-rwxr-xr-xtmake/lib/win32-msvc/app.t6
-rwxr-xr-xtmake/lib/win32-msvc/generic.t221
-rwxr-xr-xtmake/lib/win32-msvc/lib.t6
-rwxr-xr-xtmake/lib/win32-msvc/subdirs.t2
-rwxr-xr-xtmake/lib/win32-msvc/tmake.conf64
-rwxr-xr-xtmake/lib/win32-msvc/vcapp.t226
-rwxr-xr-xtmake/lib/win32-msvc/vclib.t178
-rwxr-xr-xtmake/lib/win32-symantec/app.t6
-rwxr-xr-xtmake/lib/win32-symantec/generic.t212
-rwxr-xr-xtmake/lib/win32-symantec/lib.t6
-rwxr-xr-xtmake/lib/win32-symantec/subdirs.t2
-rwxr-xr-xtmake/lib/win32-symantec/tmake.conf56
-rwxr-xr-xtmake/lib/win32-visage/app.t6
-rwxr-xr-xtmake/lib/win32-visage/generic.t208
-rwxr-xr-xtmake/lib/win32-visage/lib.t6
-rwxr-xr-xtmake/lib/win32-visage/subdirs.t2
-rwxr-xr-xtmake/lib/win32-visage/tmake.conf56
-rwxr-xr-xtmake/lib/win32-watcom/app.t6
-rwxr-xr-xtmake/lib/win32-watcom/generic.t202
-rwxr-xr-xtmake/lib/win32-watcom/lib.t6
-rwxr-xr-xtmake/lib/win32-watcom/subdirs.t2
-rwxr-xr-xtmake/lib/win32-watcom/tmake.conf54
-rwxr-xr-xtmake/lib/win32/subdirs.t35
149 files changed, 8318 insertions, 0 deletions
diff --git a/tmake/CHANGES b/tmake/CHANGES
new file mode 100644
index 0000000..000ac7d
--- /dev/null
+++ b/tmake/CHANGES
@@ -0,0 +1,39 @@
+ Changes from version 1.1 to 1.2
+
+* tmake is no longer restricted to C++ only. You can now use both C++
+ and C files in your project. Thanks to Ulrich Ring for valuable feed-
+ back and comments.
+
+* Added support for building DLL libraries under Windows.
+ NOTE: Qt 1.42 and later now uses qtmain.lib in addition to qt.lib
+ when your application uses the Qt DLL. Add "DEFINES = QT_DLL" to
+ your project file to use the Qt DLL.
+
+* New dist target added in the app and lib templates.
+ Run "make dist" to pack all files in your project using tar/gzip or zip.
+ Thanks to Kalle Dalheimer for this patch.
+
+* Fixed bad command line interpretation bug in tmake.exe and progen.exe.
+
+* Added support for Borland C++ builder 3.
+
+* Initial support for QNX/g++ and the IBM Visual Age compiler on Win32.
+ Thanks to Igor Kovalenko and Joost Kraaijeveld.
+
+* Many fixes in tmake.conf for several Unix configurations.
+
+
+ Changes from version 1.0 to 1.1
+
+* Provides tmake.exe and progen.exe for Windows users without perl.
+
+* Added many new Unix templates.
+
+* Added subdirs.t templates.
+
+* Added system-dependent project settings
+ (e.g. solaris-cc:TMAKE_CFLAGS = -pts)
+
+* Many bug fixes and improvements for existing templates.
+
+* Improved documentation.
diff --git a/tmake/LICENSE b/tmake/LICENSE
new file mode 100644
index 0000000..2836b6a
--- /dev/null
+++ b/tmake/LICENSE
@@ -0,0 +1,9 @@
+ License Statement for tmake
+
+Copyright (C) 1996-1998 by Troll Tech AS. All rights reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted, provided
+that the this copyright notice appears in all copies.
+No representations are made about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
diff --git a/tmake/README b/tmake/README
new file mode 100644
index 0000000..defb697
--- /dev/null
+++ b/tmake/README
@@ -0,0 +1,7 @@
+ tmake version 1.2
+
+tmake is an easy-to-use tool for creating and maintaining makefiles across
+many platforms and compilers. The tmake manual (doc/tmake.html) explains
+how to install and use tmake.
+
+Download the latest version from: <ftp://ftp.troll.no/freebies/tmake>
diff --git a/tmake/bin/progen b/tmake/bin/progen
new file mode 100755
index 0000000..8237fd5
--- /dev/null
+++ b/tmake/bin/progen
@@ -0,0 +1,249 @@
+#!/usr/bin/perl
+############################################################################
+# $Id$
+#
+# Generates a tmake project file.
+#
+# Copyright (C) 1996-1998 by Troll Tech AS. All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that this copyright notice appears in all copies.
+# No representations are made about the suitability of this software for any
+# purpose. It is provided "as is" without express or implied warranty.
+#
+############################################################################
+
+# Default project settings
+$project{"TEMPLATE"} = "app";
+$project{"CONFIG"} = "qt warn_on release";
+
+@project_extra = ();
+
+while ( @ARGV ) { # parse command line args
+ $_ = shift @ARGV;
+ if ( s/^-// ) {
+ if ( /^o(.*)/ ) {
+ $outfile = ($1 eq "") ? shift @ARGV : $1;
+ ($outfile eq "-") && ($outfile = "");
+ } elsif ( /^n(.*)/ ) {
+ $project{"TARGET"} = ($1 eq "") ? shift @ARGV : $1;
+ } elsif ( /^t(.*)/ ) {
+ $project{"TEMPLATE"} = ($1 eq "") ? shift @ARGV : $1;
+ $project{"TEMPLATE"} =~ s/\.t$//i;
+ } elsif ( /lower/ ) {
+ $tolower = 1;
+ } else {
+ &progen_usage;
+ }
+ } elsif ( /^\s*(?:[\w\-]+:)?\w+\s*[\+\-\*\/]?=/ ) { # project override
+ push( @project_extra, $_ );
+ } else {
+ push (@files, $_ );
+ }
+}
+
+$outfile eq "" || open(STDOUT,">" . $outfile) ||
+ &progen_error("Can't create \"$outfile\"");
+
+if ( ! @files ) {
+ @files = &find_files(".",".*",1);
+}
+
+if ( $tolower ) {
+ foreach $f ( @files ) {
+ $f =~ tr/A-Z/a-z/;
+ }
+}
+
+@hdr = sort grep(/\.(h|hh|hpp|hxx)$/i,@files);
+@src = sort grep(/\.(c|cpp|cc|cxx)$/i && ! /moc_/i,@files);
+
+# Remove source files that are included by other source files
+foreach $f ( @src ) {
+ $srcdict{$f} = 1;
+}
+foreach $f ( @src ) {
+ if ( open(F,"< $f") ) {
+ while ( <F> ) {
+ if ( /^\s*#\s*include\s+\"([^\"]*)\"/ ) {
+ $srcdict{$1} = 0;
+ }
+ }
+ }
+}
+foreach $f( @src ) {
+ $srcdict{$f} && (push(@src2,$f));
+}
+@src = @src2;
+
+$project{"HEADERS"} = join(" ",sort @hdr);
+$project{"SOURCES"} = join(" ",sort @src);
+
+foreach $p ( @project_extra ) {
+ if ( $p =~ /^\s*((?:[\w\-]+:)?\w+)\s*([\+\-\*\/])?=\s*(.*)/ ) {
+ if ( $project{$1} ne "" ) {
+ Project($p);
+ }
+ }
+}
+
+$project{"HEADERS"} =~ s/\s+/ \\\n\t\t /g;
+$project{"SOURCES"} =~ s/\s+/ \\\n\t\t /g;
+
+print "TEMPLATE\t= " . $project{"TEMPLATE"} . "\n";
+print "CONFIG\t\t= " . $project{"CONFIG"} . "\n";
+print "HEADERS\t\t= " . $project{"HEADERS"} . "\n";
+print "SOURCES\t\t= " . $project{"SOURCES"} . "\n";
+if ( $project{"TARGET"} ne "" ) {
+ print "TARGET\t\t= " . $project{"TARGET"} . "\n";
+}
+
+foreach ( @project_extra ) {
+ if ( /^\s*((?:[\w\-]+:)?\w+)\s*([\+\-\*\/])?=\s*(.*)/ ) {
+ if ( $project{$1} eq "" ) {
+ $t = $1;
+ if ( length($t) < 8 ) {
+ $t .= "\t\t";
+ } elsif ( length($t) < 16 ) {
+ $t .= "\t";
+ } else {
+ $t .= " ";
+ }
+ print "$t$2= $3\n";
+ }
+ }
+}
+
+exit 0;
+
+
+#
+# progen_usage()
+#
+# Prints a message about program usage and exits
+#
+
+sub progen_usage {
+ print STDERR "Usage:\n progen [options] [files]\n";
+ print STDERR "Options:\n";
+ print STDERR " -lower Lower-case letters filenames (useful for non-Unix)\n";
+ print STDERR " -n name Specify a project name (= TARGET)\n";
+ print STDERR " -o file Write output to \"file\"\n";
+ print STDERR " -t file Specify a template file other than qtapp\n";
+ exit 1;
+}
+
+
+#
+# progen_error(msg)
+#
+# Prints the message and exits
+#
+
+sub progen_error {
+ my($msg) = @_;
+ print STDERR "progen error: " . $msg . "\n";
+ exit 1;
+}
+
+
+#
+# Finds files.
+#
+# Examples:
+# find_files("/usr","\.cpp$",1) - finds .cpp files in /usr and below
+# find_files("/tmp","^#",0) - finds #* files in /tmp
+#
+
+sub find_files {
+ my($dir,$match,$descend) = @_;
+ my($file,$p,@files);
+ local(*D);
+ $dir =~ s=\\=/=g;
+ ($dir eq "") && ($dir = ".");
+ if ( opendir(D,$dir) ) {
+ if ( $dir eq "." ) {
+ $dir = "";
+ } else {
+ ($dir =~ /\/$/) || ($dir .= "/");
+ }
+ foreach $file ( readdir(D) ) {
+ next if ( $file =~ /^\.\.?$/ );
+ $p = $dir . $file;
+ ($file =~ /$match/i) && (push @files, $p);
+ if ( $descend && -d $p && ! -l $p ) {
+ push @files, &find_files($p,$match,$descend);
+ }
+ }
+ closedir(D);
+ }
+ return @files;
+}
+
+
+#
+# strip_project_val(tag)
+#
+# Strips white space from project value strings.
+#
+
+sub strip_project_val {
+ my($v) = @_;
+ $v =~ s/^\s+//; # trim white space
+ $v =~ s/\s+$//;
+ return $v;
+}
+
+
+#
+# Project(strings)
+#
+# This is a powerful function for setting or reading project variables.
+# Returns the resulting project variables (joined with space between).
+#
+# This is a slightly modified version of the Project function in tmake.
+
+sub Project {
+ my @settings = @_;
+ my($r,$t,$s,$v,$p,$c);
+ $r = "";
+ foreach ( @settings ) {
+ $v = $_;
+ if ( $v =~ s/^\s*((?:[\w\-]+:)?\w+)\s*(\+=|\*=|\-=|\/=|=)\s*// ) {
+ $t = $1;
+ $s = $2;
+ $v = strip_project_val($v);
+ $p = $project{$t};
+ if ( $s eq "=" ) { # set variable
+ $p = $v;
+ } elsif ( $s eq "+=" ) { # append
+ if ( $p eq "" ) {
+ $p = $v;
+ } else {
+ $p .= " " . $v;
+ }
+ } elsif ( $s eq "*=" ) { # append if not contained
+ if ( !($p =~ /(?:^|\s)\Q$v\E(?:\s|$)/) ) {
+ if ( $p eq "" ) {
+ $p = $v;
+ } else {
+ $p .= " " . $v;
+ }
+ }
+ } elsif ( $s eq "-=" ) { # subtract
+ $p =~ s/$v//g;
+ } elsif ( $s eq "/=" ) { # sed
+ $cmd = '$p =~ ' . $v;
+ eval $cmd;
+ }
+ $project{$t} = strip_project_val($p);
+ } else {
+ $p = strip_project_val($project{$v});
+ }
+ if ( $p ne "" ) {
+ $r = ($r eq "") ? $p : ($r . " " . $p);
+ }
+ }
+ return $r;
+}
diff --git a/tmake/bin/progen.bat b/tmake/bin/progen.bat
new file mode 100644
index 0000000..54475ee
--- /dev/null
+++ b/tmake/bin/progen.bat
@@ -0,0 +1,266 @@
+@rem = '--*-PERL-*--';
+@rem = '
+@echo off
+rem setlocal
+set ARGS=
+:loop
+if .%1==. goto endloop
+set ARGS=%ARGS% %1
+shift
+goto loop
+:endloop
+rem ***** This assumes PERL is in the PATH *****
+perl.exe -S progen.bat %ARGS%
+goto endofperl
+@rem ';
+#!/usr/bin/perl
+############################################################################
+# $Id$
+#
+# Generates a tmake project file.
+#
+# Copyright (C) 1996-1998 by Troll Tech AS. All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that this copyright notice appears in all copies.
+# No representations are made about the suitability of this software for any
+# purpose. It is provided "as is" without express or implied warranty.
+#
+############################################################################
+
+# Default project settings
+$project{"TEMPLATE"} = "app";
+$project{"CONFIG"} = "qt warn_on release";
+
+@project_extra = ();
+
+while ( @ARGV ) { # parse command line args
+ $_ = shift @ARGV;
+ if ( s/^-// ) {
+ if ( /^o(.*)/ ) {
+ $outfile = ($1 eq "") ? shift @ARGV : $1;
+ ($outfile eq "-") && ($outfile = "");
+ } elsif ( /^n(.*)/ ) {
+ $project{"TARGET"} = ($1 eq "") ? shift @ARGV : $1;
+ } elsif ( /^t(.*)/ ) {
+ $project{"TEMPLATE"} = ($1 eq "") ? shift @ARGV : $1;
+ $project{"TEMPLATE"} =~ s/\.t$//i;
+ } elsif ( /lower/ ) {
+ $tolower = 1;
+ } else {
+ &progen_usage;
+ }
+ } elsif ( /^\s*(?:[\w\-]+:)?\w+\s*[\+\-\*\/]?=/ ) { # project override
+ push( @project_extra, $_ );
+ } else {
+ push (@files, $_ );
+ }
+}
+
+$outfile eq "" || open(STDOUT,">" . $outfile) ||
+ &progen_error("Can't create \"$outfile\"");
+
+if ( ! @files ) {
+ @files = &find_files(".",".*",1);
+}
+
+if ( $tolower ) {
+ foreach $f ( @files ) {
+ $f =~ tr/A-Z/a-z/;
+ }
+}
+
+@hdr = sort grep(/\.(h|hh|hpp|hxx)$/i,@files);
+@src = sort grep(/\.(c|cpp|cc|cxx)$/i && ! /moc_/i,@files);
+
+# Remove source files that are included by other source files
+foreach $f ( @src ) {
+ $srcdict{$f} = 1;
+}
+foreach $f ( @src ) {
+ if ( open(F,"< $f") ) {
+ while ( <F> ) {
+ if ( /^\s*#\s*include\s+\"([^\"]*)\"/ ) {
+ $srcdict{$1} = 0;
+ }
+ }
+ }
+}
+foreach $f( @src ) {
+ $srcdict{$f} && (push(@src2,$f));
+}
+@src = @src2;
+
+$project{"HEADERS"} = join(" ",sort @hdr);
+$project{"SOURCES"} = join(" ",sort @src);
+
+foreach $p ( @project_extra ) {
+ if ( $p =~ /^\s*((?:[\w\-]+:)?\w+)\s*([\+\-\*\/])?=\s*(.*)/ ) {
+ if ( $project{$1} ne "" ) {
+ Project($p);
+ }
+ }
+}
+
+$project{"HEADERS"} =~ s/\s+/ \\\n\t\t /g;
+$project{"SOURCES"} =~ s/\s+/ \\\n\t\t /g;
+
+print "TEMPLATE\t= " . $project{"TEMPLATE"} . "\n";
+print "CONFIG\t\t= " . $project{"CONFIG"} . "\n";
+print "HEADERS\t\t= " . $project{"HEADERS"} . "\n";
+print "SOURCES\t\t= " . $project{"SOURCES"} . "\n";
+if ( $project{"TARGET"} ne "" ) {
+ print "TARGET\t\t= " . $project{"TARGET"} . "\n";
+}
+
+foreach ( @project_extra ) {
+ if ( /^\s*((?:[\w\-]+:)?\w+)\s*([\+\-\*\/])?=\s*(.*)/ ) {
+ if ( $project{$1} eq "" ) {
+ $t = $1;
+ if ( length($t) < 8 ) {
+ $t .= "\t\t";
+ } elsif ( length($t) < 16 ) {
+ $t .= "\t";
+ } else {
+ $t .= " ";
+ }
+ print "$t$2= $3\n";
+ }
+ }
+}
+
+exit 0;
+
+
+#
+# progen_usage()
+#
+# Prints a message about program usage and exits
+#
+
+sub progen_usage {
+ print STDERR "Usage:\n progen [options] [files]\n";
+ print STDERR "Options:\n";
+ print STDERR " -lower Lower-case letters filenames (useful for non-Unix)\n";
+ print STDERR " -n name Specify a project name (= TARGET)\n";
+ print STDERR " -o file Write output to \"file\"\n";
+ print STDERR " -t file Specify a template file other than qtapp\n";
+ exit 1;
+}
+
+
+#
+# progen_error(msg)
+#
+# Prints the message and exits
+#
+
+sub progen_error {
+ my($msg) = @_;
+ print STDERR "progen error: " . $msg . "\n";
+ exit 1;
+}
+
+
+#
+# Finds files.
+#
+# Examples:
+# find_files("/usr","\.cpp$",1) - finds .cpp files in /usr and below
+# find_files("/tmp","^#",0) - finds #* files in /tmp
+#
+
+sub find_files {
+ my($dir,$match,$descend) = @_;
+ my($file,$p,@files);
+ local(*D);
+ $dir =~ s=\\=/=g;
+ ($dir eq "") && ($dir = ".");
+ if ( opendir(D,$dir) ) {
+ if ( $dir eq "." ) {
+ $dir = "";
+ } else {
+ ($dir =~ /\/$/) || ($dir .= "/");
+ }
+ foreach $file ( readdir(D) ) {
+ next if ( $file =~ /^\.\.?$/ );
+ $p = $dir . $file;
+ ($file =~ /$match/i) && (push @files, $p);
+ if ( $descend && -d $p && ! -l $p ) {
+ push @files, &find_files($p,$match,$descend);
+ }
+ }
+ closedir(D);
+ }
+ return @files;
+}
+
+
+#
+# strip_project_val(tag)
+#
+# Strips white space from project value strings.
+#
+
+sub strip_project_val {
+ my($v) = @_;
+ $v =~ s/^\s+//; # trim white space
+ $v =~ s/\s+$//;
+ return $v;
+}
+
+
+#
+# Project(strings)
+#
+# This is a powerful function for setting or reading project variables.
+# Returns the resulting project variables (joined with space between).
+#
+# This is a slightly modified version of the Project function in tmake.
+
+sub Project {
+ my @settings = @_;
+ my($r,$t,$s,$v,$p,$c);
+ $r = "";
+ foreach ( @settings ) {
+ $v = $_;
+ if ( $v =~ s/^\s*((?:[\w\-]+:)?\w+)\s*(\+=|\*=|\-=|\/=|=)\s*// ) {
+ $t = $1;
+ $s = $2;
+ $v = strip_project_val($v);
+ $p = $project{$t};
+ if ( $s eq "=" ) { # set variable
+ $p = $v;
+ } elsif ( $s eq "+=" ) { # append
+ if ( $p eq "" ) {
+ $p = $v;
+ } else {
+ $p .= " " . $v;
+ }
+ } elsif ( $s eq "*=" ) { # append if not contained
+ if ( !($p =~ /(?:^|\s)\Q$v\E(?:\s|$)/) ) {
+ if ( $p eq "" ) {
+ $p = $v;
+ } else {
+ $p .= " " . $v;
+ }
+ }
+ } elsif ( $s eq "-=" ) { # subtract
+ $p =~ s/$v//g;
+ } elsif ( $s eq "/=" ) { # sed
+ $cmd = '$p =~ ' . $v;
+ eval $cmd;
+ }
+ $project{$t} = strip_project_val($p);
+ } else {
+ $p = strip_project_val($project{$v});
+ }
+ if ( $p ne "" ) {
+ $r = ($r eq "") ? $p : ($r . " " . $p);
+ }
+ }
+ return $r;
+}
+__END__
+:endofperl
diff --git a/tmake/bin/tmake b/tmake/bin/tmake
new file mode 100755
index 0000000..2d7e6a7
--- /dev/null
+++ b/tmake/bin/tmake
@@ -0,0 +1,1099 @@
+#!/usr/bin/perl
+############################################################################
+# $Id$
+#
+# Creates a Makefile from a template and a project file.
+#
+# Copyright (C) 1996-1998 by Troll Tech AS. All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that this copyright notice appears in all copies.
+# No representations are made about the suitability of this software for any
+# purpose. It is provided "as is" without express or implied warranty.
+#
+#
+# Some important, global variables in tmake:
+# cpp_ext C++ extension added to moc output (.cpp)
+# obj_ext Object file extension (.o on Unix, .obj otherwise)
+# moc_aware Will scan for files containing Qt signals/slots
+# moc_pre Moc prefix for generated moc file: x.h -> moc_x.cpp
+# moc_ext Moc extension for generated moc file: x.cpp -> x.moc
+# moc_cmd The moc command in your makefile, $(MOC)
+# linebreak Line break character (\)
+# dir_sep Directory separator (/ on Unix, \ on Windows)
+# is_unix Autodetected. If not Unix, assume Windows (Win32).
+#
+# If you need to customize any of these settings, do it before
+# calling StdInit() in the template file.
+#
+############################################################################
+
+if ($] < 5.0) {
+ &tmake_error("This program requires perl version 5 or newer");
+}
+
+$cpp_ext = "cpp";
+$obj_ext = "o";
+$moc_aware = 0;
+$moc_pre = "moc_";
+$moc_ext = "moc";
+$moc_cmd = '$(MOC)';
+$linebreak = "\\";
+$dir_sep = "/";
+$is_unix = 1;
+$really_unix = &check_unix();
+$guess_os = 1;
+$depend_path = "";
+$nodepend = 0;
+$output_count = 0;
+
+$template_name = "";
+$project_name = "";
+$outfile = "";
+@project_extra = ();
+@project_files = ();
+@eval_expr = ();
+$eval_done = 0;
+
+while ( @ARGV ) { # parse command line args
+ $_ = shift @ARGV;
+ if ( s/^-// ) {
+ if ( /^e(.*)/ ) {
+ push( @eval_expr, ($1 eq "") ? shift @ARGV : $1);
+ } elsif ( /^t(.*)/ ) {
+ $template_name = ($1 eq "") ? shift @ARGV : $1;
+ } elsif ( /^o(.*)/ ) {
+ $outfile = ($1 eq "") ? shift @ARGV : $1;
+ ($outfile eq "-") && ($outfile = "");
+ } elsif ( /^p(.*)/ ) {
+ push( @project_files, ($1 eq "") ? shift @ARGV : $1);
+ } elsif ( /^unix$/ ) {
+ $guess_os = 0;
+ $is_unix = 1;
+ } elsif ( /^win32$/ ) {
+ $guess_os = 0;
+ $is_unix = 0;
+ } elsif ( /^nodepend$/ ) {
+ $nodepend = 1; # don't generate dependencies
+ } elsif ( /^v$/ ) {
+ $verbose = 1;
+ } else {
+ &tmake_usage();
+ }
+ } elsif ( /^\s*(?:[\w\-]+:)?\w+\s*[\+\-\*\/]?=/ ) { # project override
+ push( @project_extra, $_ );
+ } else {
+ $project_name &&
+ &tmake_error("You can only specify one project file");
+ $project_name = $_;
+ }
+}
+
+($project_name ne "") || &tmake_usage();
+
+if ( $guess_os && ! check_unix() ) { # probably non-Unix,
+ $is_unix = 0;
+ &tmake_verb("Win32 detected");
+}
+if ( ! $is_unix ) {
+ $obj_ext = "obj";
+ $dir_sep = "\\";
+}
+$outfile eq "" || open(STDOUT,">" . fix_path($outfile)) ||
+ &tmake_error("Can't create \"$outfile\"");
+
+%project = ();
+&ScanProject( &find_template("tmake.conf") );
+&tmake_verb("Reading the project file $project_name");
+if ( ! ($project_name =~ /\.pro$/i) && -f fix_path($project_name . ".pro") ) {
+ $project_name .= ".pro";
+}
+$project{"PROJECT"} = $project_name;
+$project{"PROJECT"} =~ s/\.pro$//i;
+$project{"TARGET"} = $project{"PROJECT"};
+
+unshift(@project_files,$project_name);
+foreach ( @project_files ) {
+ if ( ! ($_ =~ /\.pro$/i) && -f fix_path($_ . ".pro") ) {
+ $_ .= ".pro";
+ }
+ if ( !&ScanProject($_) ) {
+ &tmake_error("Can't open project file \"$_\"");
+ }
+}
+&Project( @project_extra );
+
+if ( $template_name eq "" ) {
+ $template_name = $project{"TEMPLATE"} ?
+ $project{"TEMPLATE"} : "default.t";
+}
+
+foreach ( @eval_expr ) {
+ $text = "";
+ eval( $_ );
+ die $@ if $@;
+ print $text . "\n" if ($text ne "");
+ $eval_done = 1;
+}
+if ( $eval_done ) {
+ &tmake_verb("Done!");
+ exit 0;
+}
+
+$template_name = &find_template($template_name);
+&IncludeTemplate($template_name);
+&tmake_verb("Done!");
+exit 0; # finished!
+
+
+
+##############################################################################
+# Subroutines from here
+##############################################################################
+
+#
+# tmake_usage()
+#
+# Prints a message about program usage and exits
+#
+
+sub tmake_usage {
+ print STDERR "Usage:\n tmake [options] project-file\n";
+ print STDERR "Options:\n";
+ print STDERR " -e expr Evaluate expression, ignore template file\n";
+ print STDERR " -nodepend Don't generate dependency information\n";
+ print STDERR " -o file Write output to file\n";
+ print STDERR " -p project Load additional project file\n";
+ print STDERR " -t file Specify a template file\n";
+ print STDERR " -unix Create output for Unix (auto detects)\n";
+ print STDERR " -v Verbose/debug mode\n";
+ print STDERR " -win32 Create output for Win32 (auto detects)\n";
+ exit 1;
+}
+
+
+#
+# tmake_error(msg)
+#
+# Prints the message and exits
+#
+
+sub tmake_error {
+ my($msg) = @_;
+ print STDERR "tmake error: " . $msg . "\n";
+ exit 1;
+}
+
+
+#
+# tmake_verb()
+#
+# Prints a verbose message
+#
+
+sub tmake_verb {
+ my($msg) = @_;
+ $verbose && print STDERR "tmake: " . $msg . "\n";
+}
+
+
+#
+# check_unix()
+#
+# Returns 1 if this is a Unix, 0 otherwise.
+#
+
+sub check_unix {
+ my($r);
+ $r = 0;
+ if ( -f "/bin/uname" || -f "/usr/bin/uname" ) {
+ $r = 1;
+ (-f "\\bin\\uname") && ($r = 0);
+ }
+ return $r;
+}
+
+
+#
+# find_template(filename)
+#
+# Looks for the template file.
+# 1. search the current directory
+# 2. search the directories in TMAKEPATH
+# 3. search in $HOME/.tmake
+#
+
+sub find_template {
+ my($filename) = @_;
+ my($tb,$d,$p,@dirs);
+ if ( !defined($template_base) || ($template_base eq "") ) {
+ $tb = "";
+ } else {
+ $tb = $template_base . ";";
+ }
+ $d = ";" . $tb . $ENV{"TMAKEPATH"} . ";" . $ENV{"HOME"} . "/.tmake/";
+ @dirs = &split_path( $d );
+ $filename .= ".t" unless ($filename =~ /\.\w+$/);
+ for $d ( @dirs ) {
+ $p = $d . $filename;
+ if ( -f fix_path($p) ) {
+ if ( $filename eq "tmake.conf" ) {
+ $tmake_platform = $d;
+ $tmake_platform =~ s-.*[/\\]([^/\\]*)[/\\]-$1-;
+ &tmake_verb("Detected platform $tmake_platform");
+ }
+ return $p;
+ }
+ return ($d . $filename) if ( -f fix_path($d . $filename) );
+ }
+ &tmake_error("Template file " . $filename . " not found");
+}
+
+
+##############################################################################
+# User functions
+##############################################################################
+
+#
+# StdInit()
+#
+# Standard initialization
+#
+
+sub StdInit {
+ my($p);
+ return if $stdinit_done;
+ $stdinit_done = 1;
+ if ( defined($project{"OBJECTS_DIR"}) ) {
+ $project{"OBJECTS_DIR"} = FixPath($project{"OBJECTS_DIR"});
+ }
+ if ( defined($project{"MOC_DIR"}) ) {
+ $project{"MOC_DIR"} = FixPath($project{"MOC_DIR"});
+ }
+ $project{"OBJECTS"} = &Objects($project{"SOURCES"});
+ if ( $moc_aware ) {
+ $project{"_HDRMOC"} = &list_moc($project{"HEADERS"},$moc_pre,$cpp_ext);
+ $project{"_SRCMOC"} = &list_moc($project{"SOURCES"},"",$moc_ext);
+ $project{"OBJMOC"} = &Objects($project{"_HDRMOC"});
+ $p = $project{"_HDRMOC"} . " " . $project{"_SRCMOC"};
+ $p =~ s/(^\s+|\s+$)//g;
+ $project{"SRCMOC"} = $p;
+ }
+ &AddIncludePath("");
+}
+
+
+sub FixPath {
+ my($p) = @_;
+ if ( !defined($p) || ($p eq "") || ($p eq ".") ) {
+ $p = "";
+ } else {
+ $p .= $dir_sep;
+ $p =~ s-[\\/]+-${dir_sep}-g;
+ }
+ return $p;
+}
+
+
+#
+# Config(name)
+#
+# Returns true if the project variable CONFIG contains the
+# configuration name.
+#
+
+sub Config {
+ my($name) = @_;
+ return $project{"CONFIG"} =~ /\b\Q$name\E\b/;
+}
+
+
+#
+# DisableOutput()
+#
+# Disables tmake output. Must be restored by calling a corresponding
+# EnableOutput().
+#
+
+sub DisableOutput {
+ $output_count++;
+}
+
+
+#
+# EnableOutput()
+#
+# Enables tmake output again after DisableOutput() has been called.
+#
+
+sub EnableOutput {
+ $output_count--;
+}
+
+
+#
+# Now() - sets $text
+#
+# Sets $text to the current date and time.
+#
+
+sub Now {
+ my($sec,$min,$hour,$mday,$mon,$year);
+ ($sec,$min,$hour,$mday,$mon,$year) = localtime(time());
+ $text = sprintf("%02d:%02d, %4d/%02d/%02d",
+ $hour, $min, 1900+$year, 1+$mon, $mday);
+}
+
+
+#
+# expand_project_val(tag)
+#
+# Internal function for Project().
+# Expands a project value string.
+#
+
+sub expand_project_val {
+ my($v) = @_;
+ my($c);
+ return "" if !defined($v);
+ $v =~ s/^\s+//; # trim white space
+ $v =~ s/\s+$//;
+ $c = 0;
+ while ( $c < 100 ) { # expand $$
+ if ( $v =~ s/(\$\$\w+)/\035/ ) {
+ $_ = $1;
+ s/\$\$//g;
+ if ( !defined($project{$_}) ) {
+ $v =~ s/\035//g;
+ } else {
+ $v =~ s/\035/$project{$_}/g;
+ }
+ $c++;
+ } else {
+ $c = 100;
+ }
+ }
+ return $v;
+}
+
+
+#
+# Project(strings)
+#
+# This is a powerful function for setting or reading project variables.
+# Returns the resulting project variables (joined with space between).
+#
+# Get a project variable:
+# $s = Project("TEMPLATE"); -> $s = "TEMPLATE"
+#
+# Set a project variable:
+# Project("TEMPLATE = lib"); -> TEMPLATE = lib
+# Project("CONFIG =";) -> CONFIG empty
+#
+# Append to a project variable:
+# Project("CONFIG = qt"); -> CONFIG = qt
+# Project("CONFIG += debug"); -> CONFIG = qt debug
+#
+# Append to a project variable if it does not contain the value already:
+# Project("CONFIG = qt release"); -> CONFIG = qt release
+# Project("CONFIG *= qt"); -> CONFIG = qt release
+# Project("CONFIG *= opengl"); -> CONFIG = qt release opengl
+#
+# Subtract from a project variable:
+# Project("THINGS = abc xyz"); -> THINGS = abc xyz
+# Project("THINGS -= abc"); -> THINGS = xyz
+#
+# Search/replace on a project variable:
+# Project("CONFIG = tq opengl"); -> CONFIG = tq opengl
+# Project("CONFIG /= s/tq/qt/"); -> CONFIG = qt opengl
+#
+# The operations can be performed on several project variables at a time.
+#
+# Project("TEMPLATE = app", "CONFIG *= opengl", "THINGS += klm");
+#
+
+sub Project {
+ my @settings = @_;
+ my($r,$if_tag,$t,$s,$v,$p,$c);
+ $r = "";
+ foreach ( @settings ) {
+ $v = $_;
+ if ( $v =~ s/^\s*((?:[^:]*?:)?)(\w+)\s*(\+=|\*=|\-=|\/=|=)\s*// ) {
+ $if_tag = $1;
+ if ( $if_tag ne "" ) {
+ chop $if_tag;
+ if ( $if_tag eq "unix" ) {
+ return "" if !$is_unix;
+ } elsif ( $if_tag eq "win32" ) {
+ return "" if $is_unix;
+ } elsif ( ($if_tag ne $tmake_platform) && !Config($if_tag) ) {
+ return "";
+ }
+ }
+ $t = $2;
+ $s = $3;
+ $v = expand_project_val($v);
+ $p = $project{$t};
+ if ( $s eq "=" ) { # set variable
+ $p = $v;
+ } elsif ( $s eq "+=" ) { # append
+ if ( $p eq "" ) {
+ $p = $v;
+ } else {
+ $p .= " " . $v;
+ }
+ } elsif ( $s eq "*=" ) { # append if not contained
+ if ( !($p =~ /(?:^|\s)\Q$v\E(?:\s|$)/) ) {
+ if ( $p eq "" ) {
+ $p = $v;
+ } else {
+ $p .= " " . $v;
+ }
+ }
+ } elsif ( $s eq "-=" ) { # subtract
+ $p =~ s/$v//g;
+ } elsif ( $s eq "/=" ) { # sed
+ $cmd = '$p =~ ' . $v;
+ eval $cmd;
+ }
+ $project{$t} = expand_project_val($p);
+ } else {
+ $p = expand_project_val($project{$v});
+ }
+ if ( $p ne "" ) {
+ $r = ($r eq "") ? $p : ($r . " " . $p);
+ }
+ }
+ return $r;
+}
+
+
+#
+# Substitute(string)
+#
+# This function substitutes project variables in a text.
+#
+# Example:
+# Substitute('The project name is "$$PROJECT"')
+#
+
+sub Substitute {
+ my($subst) = @_;
+ $text = expand_project_val($subst);
+ return $text;
+}
+
+
+#
+# ScanProject(file)
+#
+# Scans a project file. Inserts project variables into the global
+# associative project array.
+#
+
+sub ScanProject {
+ my($file) = @_;
+ my($tag,$var,@v,$more,$line);
+
+ $tag = "";
+ $line = 0;
+ open(TMP,fix_path($file)) || return 0;
+
+ while ( <TMP> ) {
+ $line++;
+ s/\#.*//; # strip comment
+ s/^\s+//; # strip white space
+ s/\s+$//;
+ if ( /^\s*((?:(?:[^:]*?:)?)\w+\s*(\+|\-|\*|\/)?=)/ ) {
+ $tag = $1; # tag also contains the ".="
+ s/^.*?=\s*//;
+ }
+ if ( $tag ne "" ) {
+ $more = ( $_ =~ s/\s*\\\s*$// ); # more if \ at end of line
+ push( @v, split( /\s+/, $_ ) );
+ if ( ! $more ) {
+ $var = join(" ",@v);
+ Project( $tag . $var );
+ $tag = "";
+ @v = ();
+ }
+ } elsif ( $_ ne "" ) {
+ tmake_error("$file:$line: Syntax error");
+ }
+ }
+ close(TMP);
+ return 1;
+}
+
+
+#
+# IncludeTemplate(template_name)
+#
+# Includes and processes a template file.
+#
+# Below, we read the template file and executes any perl code found.
+# Perl code comes after "#$". The variable $text contains the text
+# to replace the perl code that was executed.
+# Template comments begin with "#!".
+#
+
+sub IncludeTemplate {
+ my($t_name) = @_;
+ my($cmd,$cmd_block,$cmd_end,$is_cmd_block,$saveline,$spaceonly);
+ local($text);
+ local(*T);
+
+ $t_name = &find_template($t_name);
+ if ( $tmake_template_dict{$t_name} ) {
+ &tmake_error("Cyclic template inclusion for $t_name");
+ } else {
+ $tmake_template_dict{$t_name} = 1;
+ }
+ $template_base = $t_name;
+ $template_base =~ s-(.*[/\\]).*-$1-;
+ &tmake_verb("Reading the template $t_name");
+ open(T,fix_path($t_name)) ||
+ &tmake_error("Can't open template file \"$t_name\"");
+
+ while ( <T> ) {
+ if ( /\#\!/ ) { # tmake comment
+ s/\s*\#\!.*//;
+ next if /^$/;
+ }
+ if ( /\#\$(\{)?\s*(.*)\n/ ) { # code
+ $cmd = $2;
+ $is_cmd_block = defined($1) && ($1 eq "{");
+ s/\#\$.*\n//;
+ if ( $is_cmd_block ) { # code block #${ ...
+ $saveline = $_;
+ $cmd_block = $cmd;
+ $cmd_end = 0;
+ while ( <T> ) {
+ $cmd = $_;
+ $cmd =~ s/\s*\#\!.*//; # tmake comment
+ if ( $cmd =~ /^\s*\#\$\}/ ) {
+ $_ = "";
+ $cmd_end = 1;
+ last;
+ }
+ $cmd =~ s/^\s*\#(\$)?\s*//;
+ $cmd_block .= $cmd;
+ }
+ $cmd_end || &tmake_error('#$} expected but not found');
+ $cmd = $cmd_block;
+ $_ = $saveline;
+ }
+ $spaceonly = /^\s*$/;
+ $saveline = $_;
+ &tmake_verb("Evaluate: $cmd");
+ $text = "";
+ eval $cmd;
+ die $@ if $@;
+ next if $spaceonly && ($text =~ /^\s*$/);
+ print $saveline . $text . "\n" if $output_count <= 0;
+ } else { # something else
+ print if $output_count <= 0;
+ }
+ }
+ close( T );
+}
+
+
+#
+# Expand(tag) - appends to $text
+#
+# Expands a list of $project{} variables with a space character between them.
+#
+
+sub Expand {
+ my @tags = @_;
+ my($t);
+ $t = Project(@tags);
+ if ( $text eq "" ) {
+ $text = $t;
+ } elsif ( $t ne "" ) {
+ $text .= " " . $t;
+ }
+ return $text;
+}
+
+
+#
+# ExpandGlue(tag,prepend,glue,append) - appends to $text
+#
+# Expands a $project{} tag, splits on whitespace
+# and joins with $glue. $prepend is put at the start
+# of the string and $append is put at the end of the
+# string. The resulting string becomes "" if the project
+# tag is empty or not defined.
+#
+# Example:
+#
+# The project file defines:
+# SOURCES = a b c
+#
+# ExpandGlue("SOURCES","<","-",">")
+#
+# The result:
+# $text = "<a-b-c>"
+#
+
+sub ExpandGlue {
+ my($tag,$prepend,$glue,$append) = @_;
+ my($t,$v);
+ $v = Project($tag);
+ if ( $v eq "" ) {
+ $t = "";
+ } else {
+ $t = $prepend . join($glue,split(/\s+/,$v)) . $append;
+ }
+ if ( $text eq "" ) {
+ $text = $t;
+ } elsif ( $t ne "" ) {
+ $text .= " " . $t;
+ }
+ return $text;
+}
+
+
+#
+# ExpandList(tag) - sets $text.
+#
+# Suitable for expanding HEADERS = ... etc. in a Makefile
+#
+
+sub ExpandList {
+ my($tag) = @_;
+ return ExpandGlue($tag,""," ${linebreak}\n\t\t","");
+}
+
+
+#
+# TmakeSelf()
+#
+# Generates makefile rule to regenerate the makefile using tmake.
+#
+
+sub TmakeSelf {
+ my $a = "tmake $project_name";
+ if ( $nodepend ) {
+ $a .= " -nodepend";
+ }
+ if ( $outfile ) {
+ $text = "tmake: $outfile\n\n$outfile: $project_name\n\t";
+ $a .= " -o $outfile";
+ } else {
+ $text = "tmake:\n\t";
+ }
+ $text .= $a
+}
+
+
+#
+# Objects(files)
+#
+# Replaces any extension with .o ($obj_ext).
+#
+
+sub Objects {
+ local($_) = @_;
+ my(@a);
+ @a = split(/\s+/,$_);
+ foreach ( @a ) {
+ s-\.\w+$-.${obj_ext}-;
+ if ( defined($project{"OBJECTS_DIR"}) ) {
+ s-^.*[\\/]--;
+ $_ = $project{"OBJECTS_DIR"} . $_;
+ }
+ }
+ return join(" ",@a);
+}
+
+
+#
+# list_moc(files,prefix,extension)
+#
+# Scans all files and selects all files that contain Q_OBJECT.
+# Insert a prefix before the filename and replaces the filename extention.
+#
+
+sub list_moc {
+ my($files,$pre,$ext) = @_;
+ my(@v,@m,@lines,$contents,$n,$f,$t);
+ @v = split(/\s+/,$files);
+ undef $/;
+ foreach $f ( @v ) {
+ if ( open(TMP,fix_path($f)) ) {
+ $contents = <TMP>;
+ close(TMP);
+ $n = 0;
+ @lines = split(/\n/,$contents);
+ grep( /tmake\s+ignore\s+Q_OBJECT/ && $n--, @lines );
+ $contents =~ s-/\*.*?\*/--gs; # strip C/C++ comments
+ $contents =~ s-//.*\n--g;
+ @lines = split(/\n/,$contents);
+ grep( /(^|\W)Q_OBJECT(\W|$)/ && $n++, @lines );
+ if ( $n > 0 ) {
+ $t = $f;
+ $t =~ s-^(.*[/\\])?([^/\\]*?)\.(\w+)$-$1${pre}$2.${ext}-;
+ if ( defined($project{"MOC_DIR"}) ) {
+ $t =~ s-^.*[\\/]--;
+ $t = $project{"MOC_DIR"} . $t;
+ }
+ $moc_output{$f} = $t;
+ $moc_input{$t} = $f;
+ push(@m,$t);
+ }
+ $contents = "";
+ }
+ }
+ $/ = "\n";
+ return join(" ",@m);
+}
+
+
+#
+# BuildObj(objects,sources)
+#
+# Builds the object files.
+#
+
+sub BuildObj {
+ my($obj,$src) = @_;
+ my(@objv,$srcv,$i,$s,$o,$d,$c,$comp,$cimp);
+ @objv = split(/\s+/,$obj);
+ @srcv = split(/\s+/,$src);
+ for $i ( 0..$#objv ) {
+ $s = $srcv[$i];
+ $o = $objv[$i];
+ next if $s eq "";
+ $text .= $o . ": " . $s;
+ if ( defined($moc_output{$s}) && ($moc_output{$s} ne "") ) {
+ $text .= " ${linebreak}\n\t\t" . $moc_output{$s};
+ }
+ $d = &make_depend($s);
+ $text .= " ${linebreak}\n\t\t" . $d if $d ne "";
+ if ( ($s =~ /\.c$/) ) {
+ $comp = "TMAKE_RUN_CC";
+ $cimp = "TMAKE_RUN_CC_IMP";
+ } else {
+ $comp = "TMAKE_RUN_CXX";
+ $cimp = "TMAKE_RUN_CXX_IMP";
+ }
+ if ( defined($project{"OBJECTS_DIR"}) ||
+ !defined($project{$cimp}) ) {
+ $c = $project{$comp};
+ $c =~ s/\$src/$s/;
+ $c =~ s/\$obj/$o/;
+ $text .= "\n\t$c";
+ }
+ $text .= "\n\n";
+ }
+ chop $text;
+}
+
+
+#
+# BuildMocObj(objects,sources)
+#
+# Builds the moc object files.
+#
+
+sub BuildMocObj {
+ my($obj,$src) = @_;
+ my(@objv,$srcv,$i,$s,$o,$hdr,$d);
+ @objv = split(/\s+/,$obj);
+ @srcv = split(/\s+/,$src);
+ for $i ( 0..$#objv ) {
+ $s = $srcv[$i];
+ $o = $objv[$i];
+ $hdr = $moc_input{$srcv[$i]};
+ $text .= $o . ": " . $s . " ${linebreak}\n\t\t" . $hdr;
+ $d = &make_depend($hdr);
+ $text .= " ${linebreak}\n\t\t" . $d if $d ne "";
+ if ( defined($project{"OBJECTS_DIR"}) || defined($project{"MOC_DIR"})||
+ !defined($project{"TMAKE_RUN_CXX_IMP"}) ) {
+ $c = $project{"TMAKE_RUN_CXX"};
+ $c =~ s/\$src/$s/;
+ $c =~ s/\$obj/$o/;
+ $text .= "\n\t$c";
+ }
+ $text .= "\n\n";
+ }
+ chop $text;
+}
+
+
+#
+# BuildMocSrc(files)
+#
+# Builds the moc source files from headers and sources.
+#
+
+sub BuildMocSrc {
+ my($f) = @_;
+ my(@v,$m,$o);
+ @v = split(/\s+/,$f);
+ foreach $m ( @v ) {
+ $o = $moc_output{$m};
+ if ( defined($o) && ($o ne "") ) {
+ $text .= "$o: $m\n\t$moc_cmd $m -o $o\n\n";
+ }
+ }
+ chop $text;
+}
+
+
+#
+# AddIncludePath(path)
+#
+# Adds path to the current include path, $project{"INCLUDEPATH"}.
+#
+
+sub AddIncludePath {
+ my($path) = @_;
+ my($p);
+ if ( $project{"INCPATH"} &&
+ ($project{"INCPATH"} =~ /(?:^|\s)\Q$path\E(?:\s|$)/) ) {
+ return;
+ }
+ $project{"INCLUDEPATH"} = "" if !defined($project{"INCLUDEPATH"});
+ $p = $project{"INCLUDEPATH"};
+ $p = ($p && $path) ? ($p . ";" . $path) : ($p . $path);
+ $project{"INCLUDEPATH"} = $p;
+ $p = join(" ",&split_path($p));
+ $p =~ s=[\\/](\s|$)= =g;
+ $project{"INCPATH"} = $p;
+}
+
+
+#
+# FindHighestLibVersion(dir,name)
+#
+# Returns the newest library version. Scans all the files in the specifies
+# directory and returns the highest version number.
+#
+# Used on Windows only.
+#
+# Example:
+# FindHighestLibVersion("c:\qt\lib","qt") returns "200" if
+# the c:\qt\lib directory contains qt141.lib and qt200.lib.
+#
+
+sub FindHighestLibVersion {
+ my($dir,$name) = @_;
+ my(@files,$f,$v,$highest);
+ $highest = "";
+ @files = find_files($dir,"${name}.*\.lib");
+ for $f ( @files ) {
+ if ( $f =~ /(\d+)\.lib/ ) {
+ $v = $1;
+ if ( $highest eq "" || $v > $highest ) {
+ $highest = $v;
+ }
+ }
+ }
+ return $highest;
+}
+
+
+#
+# Finds files.
+#
+# Examples:
+# find_files("/usr","\.cpp$",1) - finds .cpp files in /usr and below
+# find_files("/tmp","^#",0) - finds #* files in /tmp
+#
+
+sub find_files {
+ my($dir,$match,$descend) = @_;
+ my($file,$p,@files);
+ local(*D);
+ $dir =~ s=\\=/=g;
+ ($dir eq "") && ($dir = ".");
+ if ( opendir(D,fix_path($dir)) ) {
+ if ( $dir eq "." ) {
+ $dir = "";
+ } else {
+ ($dir =~ /\/$/) || ($dir .= "/");
+ }
+ foreach $file ( readdir(D) ) {
+ next if ( $file =~ /^\.\.?$/ );
+ $p = $dir . $file;
+ if ( $is_unix ) {
+ ($file =~ /$match/) && (push @files, $p);
+ } else {
+ ($file =~ /$match/i) && (push @files, $p);
+ }
+ if ( $descend && -d $p && ! -l $p ) {
+ push @files, &find_files($p,$match,$descend);
+ }
+ }
+ closedir(D);
+ }
+ return @files;
+}
+
+
+#
+# make_depend(file)
+#
+# Returns a list of included files.
+# Uses the global $depend_path variable.
+#
+
+sub make_depend {
+ my($file) = @_;
+ my($i,$count);
+ if ( $nodepend ) {
+ return "";
+ }
+ if ( ! $depend_path_fixed ) {
+ $depend_path_fixed = 1;
+ if ( defined($project{"DEPENDPATH"}) ) {
+ $depend_path = $project{"DEPENDPATH"};
+ } else {
+ $depend_path = "";
+ }
+ $count = 0;
+ while ( $count < 100 ) {
+ if ( $depend_path =~ s/(\$[\{\(]?\w+[\}\)]?)/035/ ) {
+ $_ = $1;
+ s/[\$\{\}\(\)]//g;
+ $depend_path =~ s/035/$ENV{$_}/g;
+ } else {
+ $count = 100;
+ }
+ }
+ @dep_path = &split_path($depend_path);
+ }
+ @cur_dep_path = @dep_path;
+ if ( $file =~ /(.*[\/\\])/ ) {
+ $dep_curdir = $1;
+ splice( @cur_dep_path, 0, 0, $dep_curdir );
+ } else {
+ $dep_curdir = "";
+ }
+ $dep_file = $file;
+ &canonical_dep($file);
+ %dep_dict = ();
+ $i = &build_dep($file);
+ chop $i;
+ $i =~ s=/=$dir_sep=g unless $is_unix;
+ $i =~ s=([a-zA-Z]):/=//$1/=g if (defined($gnuwin32) && $gnuwin32);
+ return join(" ${linebreak}\n\t\t",split(/ /,$i) );
+}
+
+#
+# build_dep() - Internal for make_depend()
+#
+
+sub build_dep {
+ my($file) = @_;
+ my(@i,$a,$n);
+ $a = "";
+ return $a if !(defined $depend_dict{$file});
+ @i = split(/ /,$depend_dict{$file});
+ for $n ( @i ) {
+ if ( !defined($dep_dict{$n}) && defined($full_path{$n}) ) {
+ $dep_dict{$n} = 1;
+ $a .= $full_path{$n} . " " . &build_dep($n);
+ }
+ }
+ return $a;
+}
+
+#
+# canonical_dep(file) - Internal for make_depend()
+#
+# Reads the file and all included files recursively.
+# %depend_dict associates a file name to a list of included files.
+#
+
+sub canonical_dep {
+ my($file) = @_;
+ my(@inc,$i);
+ @inc = &scan_dep($file);
+ if ( @inc ) {
+ $depend_dict{$file} = join(" ",@inc);
+ for $i ( @inc ) {
+ &canonical_dep($i) if !defined($depend_dict{$i});
+ }
+ }
+}
+
+#
+# scan_dep(file) - Internal for make_depend()
+#
+# Returns an array of included files.
+#
+
+sub scan_dep {
+ my($file) = @_;
+ my($dir,$path,$found,@allincs,@includes,%incs);
+ $path = ($file eq $dep_file) ? $file : $dep_curdir . $file;
+ @includes = ();
+ return @includes if $file =~ /\.$moc_ext$/; # avoid .moc files
+ if ( ! (-f fix_path($path)) ) {
+ $found = 0;
+ for $dir ( @cur_dep_path ) {
+ $path = $dir . $file;
+ last if ( $found = (-f fix_path($path)) );
+ }
+ return @includes if ! $found;
+ }
+ undef $/;
+ if ( open(TMP,fix_path($path)) ) {
+ $full_path{$file} = $path;
+ $_ = <TMP>;
+ s-/\*.*?\*/--gs; # strip C/C++ comments
+ s-//.*\n-\n-g;
+ @allincs = split(/\n/,$_);
+ @allincs = grep(/^\s*#\s*include/,@allincs);
+ foreach ( @allincs ) { # all #include lines
+ next if !(/^\s*#\s*include\s+[<"]([^>"]*)[>"]/) || defined($incs{$1});
+ push(@includes,$1);
+ $incs{$1} = "1";
+ }
+ close(TMP);
+ }
+ $/ = "\n";
+ return @includes;
+}
+
+
+#
+# split_path(path)
+#
+# Splits a path containing : (Unix) or ; (MSDOS, NT etc.) separators.
+# Returns an array.
+#
+
+sub split_path {
+ my($p) = @_;
+ return "" if !defined($p);
+ $p =~ s=:=;=g if $is_unix;
+ $p =~ s=[/\\]+=/=g;
+ $p =~ s=([^/:]);=$1/;=g;
+ $p =~ s=([^:;/])$=$1/=;
+ $p =~ s=/=$dir_sep=g unless $is_unix;
+ return split(/;/,$p);
+}
+
+
+#
+# fix_path(path)
+#
+# Converts all '\' to '/' if this really seems to be a Unix box.
+#
+
+sub fix_path {
+ my($p) = @_;
+ if ( $really_unix ) {
+ $p =~ s-\\-/-g;
+ } else {
+ $p =~ s-/-\\-g;
+ }
+ return $p;
+}
diff --git a/tmake/bin/tmake.bat b/tmake/bin/tmake.bat
new file mode 100644
index 0000000..6fbd6b2
--- /dev/null
+++ b/tmake/bin/tmake.bat
@@ -0,0 +1,1093 @@
+@rem = '--*-PERL-*--';
+@rem = '
+@echo off
+rem setlocal
+set ARGS=
+:loop
+if .%1==. goto endloop
+set ARGS=%ARGS% %1
+shift
+goto loop
+:endloop
+rem ***** This assumes PERL is in the PATH *****
+perl.exe -S tmake.bat %ARGS%
+goto endofperl
+@rem ';
+#!/usr/bin/perl
+############################################################################
+# $Id$
+#
+# Creates a Makefile from a template and a project file.
+#
+# Copyright (C) 1996-1998 by Troll Tech AS. All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that this copyright notice appears in all copies.
+# No representations are made about the suitability of this software for any
+# purpose. It is provided "as is" without express or implied warranty.
+#
+#
+# Some important, global variables in tmake:
+# cpp_ext C++ extension added to moc output (.cpp)
+# obj_ext Object file extension (.o on Unix, .obj otherwise)
+# moc_aware Will scan for files containing Qt signals/slots
+# moc_pre Moc prefix for generated moc file: x.h -> moc_x.cpp
+# moc_ext Moc extension for generated moc file: x.cpp -> x.moc
+# moc_cmd The moc command in your makefile, $(MOC)
+# linebreak Line break character (\)
+# dir_sep Directory separator (/ on Unix, \ on Windows)
+# is_unix Autodetected. If not Unix, assume Windows (Win32).
+#
+# If you need to customize any of these settings, do it before
+# calling StdInit() in the template file.
+#
+############################################################################
+
+if ($] < 5.0) {
+ &tmake_error("This program requires perl version 5 or newer");
+}
+
+$cpp_ext = "cpp";
+$obj_ext = "o";
+$moc_aware = 0;
+$moc_pre = "moc_";
+$moc_ext = "moc";
+$moc_cmd = '$(MOC)';
+$linebreak = "\\";
+$dir_sep = "/";
+$is_unix = 1;
+$really_unix = &check_unix();
+$guess_os = 1;
+$depend_path = "";
+$nodepend = 0;
+$output_count = 0;
+
+$template_name = "";
+$project_name = "";
+$outfile = "";
+@project_extra = ();
+@project_files = ();
+@eval_expr = ();
+$eval_done = 0;
+
+while ( @ARGV ) { # parse command line args
+ $_ = shift @ARGV;
+ if ( s/^-// ) {
+ if ( /^e(.*)/ ) {
+ push( @eval_expr, ($1 eq "") ? shift @ARGV : $1);
+ } elsif ( /^t(.*)/ ) {
+ $template_name = ($1 eq "") ? shift @ARGV : $1;
+ } elsif ( /^o(.*)/ ) {
+ $outfile = ($1 eq "") ? shift @ARGV : $1;
+ ($outfile eq "-") && ($outfile = "");
+ } elsif ( /^p(.*)/ ) {
+ push( @project_files, ($1 eq "") ? shift @ARGV : $1);
+ } elsif ( /^unix$/ ) {
+ $guess_os = 0;
+ $is_unix = 1;
+ } elsif ( /^win32$/ ) {
+ $guess_os = 0;
+ $is_unix = 0;
+ } elsif ( /^nodepend$/ ) {
+ $nodepend = 1; # don't generate dependencies
+ } elsif ( /^v$/ ) {
+ $verbose = 1;
+ } else {
+ &tmake_usage();
+ }
+ } elsif ( /^\s*(?:[\w\-]+:)?\w+\s*[\+\-\*\/]?=/ ) { # project override
+ push( @project_extra, $_ );
+ } else {
+ $project_name &&
+ &tmake_error("You can only specify one project file");
+ $project_name = $_;
+ }
+}
+
+($project_name ne "") || &tmake_usage();
+
+if ( $guess_os && ! check_unix() ) { # probably non-Unix,
+ $is_unix = 0;
+ &tmake_verb("Win32 detected");
+}
+if ( ! $is_unix ) {
+ $obj_ext = "obj";
+ $dir_sep = "\\";
+}
+$outfile eq "" || open(STDOUT,">" . fix_path($outfile)) ||
+ &tmake_error("Can't create \"$outfile\"");
+
+%project = ();
+&ScanProject( &find_template("tmake.conf") );
+&tmake_verb("Reading the project file $project_name");
+if ( ! ($project_name =~ /\.pro$/i) && -f fix_path($project_name . ".pro") ) {
+ $project_name .= ".pro";
+}
+$project{"PROJECT"} = $project_name;
+$project{"PROJECT"} =~ s/\.pro$//i;
+$project{"TARGET"} = $project{"PROJECT"};
+
+unshift(@project_files,$project_name);
+foreach ( @project_files ) {
+ if ( ! ($_ =~ /\.pro$/i) && -f fix_path($_ . ".pro") ) {
+ $_ .= ".pro";
+ }
+ if ( !&ScanProject($_) ) {
+ &tmake_error("Can't open project file \"$_\"");
+ }
+}
+&Project( @project_extra );
+
+if ( $template_name eq "" ) {
+ $template_name = $project{"TEMPLATE"} ?
+ $project{"TEMPLATE"} : "default.t";
+}
+
+foreach ( @eval_expr ) {
+ $text = "";
+ eval( $_ );
+ die $@ if $@;
+ print $text . "\n" if ($text ne "");
+ $eval_done = 1;
+}
+if ( $eval_done ) {
+ &tmake_verb("Done!");
+ exit 0;
+}
+
+$template_name = &find_template($template_name);
+&IncludeTemplate($template_name);
+&tmake_verb("Done!");
+exit 0; # finished!
+
+
+
+##############################################################################
+# Subroutines from here
+##############################################################################
+
+#
+# tmake_usage()
+#
+# Prints a message about program usage and exits
+#
+
+sub tmake_usage {
+ print STDERR "Usage:\n tmake [options] project-file\n";
+ print STDERR "Options:\n";
+ print STDERR " -e expr Evaluate expression, ignore template file\n";
+ print STDERR " -nodepend Don't generate dependency information\n";
+ print STDERR " -o file Write output to file\n";
+ print STDERR " -p project Load additional project file\n";
+ print STDERR " -t file Specify a template file\n";
+ print STDERR " -unix Create output for Unix (auto detects)\n";
+ print STDERR " -v Verbose/debug mode\n";
+ print STDERR " -win32 Create output for Win32 (auto detects)\n";
+ exit 1;
+}
+
+
+#
+# tmake_error(msg)
+#
+# Prints the message and exits
+#
+
+sub tmake_error {
+ my($msg) = @_;
+ print STDERR "tmake error: " . $msg . "\n";
+ exit 1;
+}
+
+
+#
+# tmake_verb()
+#
+# Prints a verbose message
+#
+
+sub tmake_verb {
+ my($msg) = @_;
+ $verbose && print STDERR "tmake: " . $msg . "\n";
+}
+
+
+#
+# check_unix()
+#
+# Returns 1 if this is a Unix, 0 otherwise.
+#
+
+sub check_unix {
+ my($r);
+ $r = 0;
+ if ( -f "/bin/uname" ) {
+ $r = 1;
+ (-f "\\bin\\uname") && ($r = 0);
+ }
+ return $r;
+}
+
+
+#
+# find_template(filename)
+#
+# Looks for the template file.
+# 1. search the current directory
+# 2. search the directories in TMAKEPATH
+# 3. search in $HOME/.tmake
+#
+
+sub find_template {
+ my($filename) = @_;
+ my($tb,$d,$p,@dirs);
+ $tb = ($template_base eq "") ? "" : $template_base . ";";
+ $d = ";" . $tb . $ENV{"TMAKEPATH"} . ";" . $ENV{"HOME"} . "/.tmake/";
+ @dirs = &split_path( $d );
+ $filename .= ".t" unless ($filename =~ /\.\w+$/);
+ for $d ( @dirs ) {
+ $p = $d . $filename;
+ if ( -f fix_path($p) ) {
+ if ( $filename eq "tmake.conf" ) {
+ $tmake_platform = $d;
+ $tmake_platform =~ s-.*[/\\]([^/\\]*)[/\\]-$1-;
+ &tmake_verb("Detected platform $tmake_platform");
+ }
+ return $p;
+ }
+ return ($d . $filename) if ( -f fix_path($d . $filename) );
+ }
+ &tmake_error("Template file " . $filename . " not found");
+}
+
+
+##############################################################################
+# User functions
+##############################################################################
+
+#
+# StdInit()
+#
+# Standard initialization
+#
+
+sub StdInit {
+ my($p);
+ return if $stdinit_done;
+ $stdinit_done = 1;
+ if ( defined($project{"OBJECTS_DIR"}) ) {
+ $project{"OBJECTS_DIR"} = FixPath($project{"OBJECTS_DIR"});
+ }
+ if ( defined($project{"MOC_DIR"}) ) {
+ $project{"MOC_DIR"} = FixPath($project{"MOC_DIR"});
+ }
+ $project{"OBJECTS"} = &Objects($project{"SOURCES"});
+ if ( $moc_aware ) {
+ $project{"_HDRMOC"} = &list_moc($project{"HEADERS"},$moc_pre,$cpp_ext);
+ $project{"_SRCMOC"} = &list_moc($project{"SOURCES"},"",$moc_ext);
+ $project{"OBJMOC"} = &Objects($project{"_HDRMOC"});
+ $p = $project{"_HDRMOC"} . " " . $project{"_SRCMOC"};
+ $p =~ s/(^\s+|\s+$)//g;
+ $project{"SRCMOC"} = $p;
+ }
+ &AddIncludePath("");
+}
+
+
+sub FixPath {
+ my($p) = @_;
+ if ( $p eq "." ) { $p = ""; }
+ elsif ( length($p) > 0 ) {
+ $p .= $dir_sep;
+ $p =~ s-[\\/]+-${dir_sep}-g;
+ }
+ return $p;
+}
+
+
+#
+# Config(name)
+#
+# Returns true if the project variable CONFIG contains the
+# configuration name.
+#
+
+sub Config {
+ my($name) = @_;
+ return $project{"CONFIG"} =~ /\b$name\b/;
+}
+
+
+#
+# DisableOutput()
+#
+# Disables tmake output. Must be restored by calling a corresponding
+# EnableOutput().
+#
+
+sub DisableOutput {
+ $output_count++;
+}
+
+
+#
+# EnableOutput()
+#
+# Enables tmake output again after DisableOutput() has been called.
+#
+
+sub EnableOutput {
+ $output_count--;
+}
+
+
+#
+# Now() - sets $text
+#
+# Sets $text to the current date and time.
+#
+
+sub Now {
+ my($sec,$min,$hour,$mday,$mon,$year);
+ ($sec,$min,$hour,$mday,$mon,$year) = localtime(time());
+ $text = sprintf("%02d:%02d, %4d/%02d/%02d",
+ $hour, $min, 1900+$year, 1+$mon, $mday);
+}
+
+
+#
+# expand_project_val(tag)
+#
+# Internal function for Project().
+# Expands a project value string.
+#
+
+sub expand_project_val {
+ my($v) = @_;
+ my($c);
+ $v =~ s/^\s+//; # trim white space
+ $v =~ s/\s+$//;
+ $c = 0;
+ while ( $c < 100 ) { # expand $$
+ if ( $v =~ s/(\$\$\w+)/\035/ ) {
+ $_ = $1;
+ s/\$\$//g;
+ $v =~ s/\035/$project{$_}/g;
+ $c++;
+ } else {
+ $c = 100;
+ }
+ }
+ return $v;
+}
+
+
+#
+# Project(strings)
+#
+# This is a powerful function for setting or reading project variables.
+# Returns the resulting project variables (joined with space between).
+#
+# Get a project variable:
+# $s = Project("TEMPLATE"); -> $s = "TEMPLATE"
+#
+# Set a project variable:
+# Project("TEMPLATE = lib"); -> TEMPLATE = lib
+# Project("CONFIG =";) -> CONFIG empty
+#
+# Append to a project variable:
+# Project("CONFIG = qt"); -> CONFIG = qt
+# Project("CONFIG += debug"); -> CONFIG = qt debug
+#
+# Append to a project variable if it does not contain the value already:
+# Project("CONFIG = qt release"); -> CONFIG = qt release
+# Project("CONFIG *= qt"); -> CONFIG = qt release
+# Project("CONFIG *= opengl"); -> CONFIG = qt release opengl
+#
+# Subtract from a project variable:
+# Project("THINGS = abc xyz"); -> THINGS = abc xyz
+# Project("THINGS -= abc"); -> THINGS = xyz
+#
+# Search/replace on a project variable:
+# Project("CONFIG = tq opengl"); -> CONFIG = tq opengl
+# Project("CONFIG /= s/tq/qt/"); -> CONFIG = qt opengl
+#
+# The operations can be performed on several project variables at a time.
+#
+# Project("TEMPLATE = app", "CONFIG *= opengl", "THINGS += klm");
+#
+
+sub Project {
+ my @settings = @_;
+ my($r,$if_tag,$t,$s,$v,$p,$c);
+ $r = "";
+ foreach ( @settings ) {
+ $v = $_;
+ if ( $v =~ s/^\s*([\w\-]+:)?(\w+)\s*(\+=|\*=|\-=|\/=|=)\s*// ) {
+ $if_tag = $1;
+ if ( $if_tag ne "" ) {
+ chop $if_tag;
+ if ( $if_tag eq "unix" ) {
+ return "" if !$is_unix;
+ } elsif ( $if_tag eq "win32" ) {
+ return "" if $is_unix;
+ } elsif ( ($if_tag ne $tmake_platform) && !Config($if_tag) ) {
+ return "";
+ }
+ }
+ $t = $2;
+ $s = $3;
+ $v = expand_project_val($v);
+ $p = $project{$t};
+ if ( $s eq "=" ) { # set variable
+ $p = $v;
+ } elsif ( $s eq "+=" ) { # append
+ if ( $p eq "" ) {
+ $p = $v;
+ } else {
+ $p .= " " . $v;
+ }
+ } elsif ( $s eq "*=" ) { # append if not contained
+ if ( !($p =~ /(?:^|\s)\Q$v\E(?:\s|$)/) ) {
+ if ( $p eq "" ) {
+ $p = $v;
+ } else {
+ $p .= " " . $v;
+ }
+ }
+ } elsif ( $s eq "-=" ) { # subtract
+ $p =~ s/$v//g;
+ } elsif ( $s eq "/=" ) { # sed
+ $cmd = '$p =~ ' . $v;
+ eval $cmd;
+ }
+ $project{$t} = expand_project_val($p);
+ } else {
+ $p = expand_project_val($project{$v});
+ }
+ if ( $p ne "" ) {
+ $r = ($r eq "") ? $p : ($r . " " . $p);
+ }
+ }
+ return $r;
+}
+
+
+#
+# Substitute(string)
+#
+# This function substitutes project variables in a text.
+#
+# Example:
+# Substitute('The project name is "$$PROJECT"')
+#
+
+sub Substitute {
+ my($subst) = @_;
+ $text = expand_project_val($subst);
+ return $text;
+}
+
+
+#
+# ScanProject(file)
+#
+# Scans a project file. Inserts project variables into the global
+# associative project array.
+#
+
+sub ScanProject {
+ my($file) = @_;
+ my($tag,$var,@v,$more,$line);
+
+ $tag = "";
+ $line = 0;
+ open(TMP,fix_path($file)) || return 0;
+
+ while ( <TMP> ) {
+ $line++;
+ s/\#.*//; # strip comment
+ s/^\s+//; # strip white space
+ s/\s+$//;
+ if ( /^\s*((?:[\w\-]+:)?\w+\s*(\+|\-|\*|\/)?=)/ ) {
+ $tag = $1; # tag also contains the ".="
+ s/^.*?=\s*//;
+ }
+ if ( $tag ne "" ) {
+ $more = ( $_ =~ s/\s*\\\s*$// ); # more if \ at end of line
+ push( @v, split( /\s+/, $_ ) );
+ if ( ! $more ) {
+ $var = join(" ",@v);
+ Project( $tag . $var );
+ $tag = "";
+ @v = ();
+ }
+ } elsif ( $_ ne "" ) {
+ tmake_error("$file:$line: Syntax error");
+ }
+ }
+ close(TMP);
+ return 1;
+}
+
+
+#
+# IncludeTemplate(template_name)
+#
+# Includes and processes a template file.
+#
+# Below, we read the template file and executes any perl code found.
+# Perl code comes after "#$". The variable $text contains the text
+# to replace the perl code that was executed.
+# Template comments begin with "#!".
+#
+
+sub IncludeTemplate {
+ my($t_name) = @_;
+ my($cmd,$cmd_block,$cmd_end,$is_cmd_block,$saveline,$spaceonly);
+ local($text);
+ local(*T);
+
+ $t_name = &find_template($t_name);
+ if ( $tmake_template_dict{$t_name} ) {
+ &tmake_error("Cyclic template inclusion for $t_name");
+ } else {
+ $tmake_template_dict{$t_name} = 1;
+ }
+ $template_base = $t_name;
+ $template_base =~ s-(.*[/\\]).*-$1-;
+ &tmake_verb("Reading the template $t_name");
+ open(T,fix_path($t_name)) ||
+ &tmake_error("Can't open template file \"$t_name\"");
+
+ while ( <T> ) {
+ if ( /\#\!/ ) { # tmake comment
+ s/\s*\#\!.*//;
+ next if /^$/;
+ }
+ if ( /\#\$(\{)?\s*(.*)\n/ ) { # code
+ $cmd = $2;
+ $is_cmd_block = ($1 eq "{");
+ s/\#\$.*\n//;
+ if ( $is_cmd_block ) { # code block #${ ...
+ $saveline = $_;
+ $cmd_block = $cmd;
+ $cmd_end = 0;
+ while ( <T> ) {
+ $cmd = $_;
+ $cmd =~ s/\s*\#\!.*//; # tmake comment
+ if ( $cmd =~ /^\s*\#\$\}/ ) {
+ $_ = "";
+ $cmd_end = 1;
+ last;
+ }
+ $cmd =~ s/^\s*\#(\$)?\s*//;
+ $cmd_block .= $cmd;
+ }
+ $cmd_end || &tmake_error('#$} expected but not found');
+ $cmd = $cmd_block;
+ $_ = $saveline;
+ }
+ $spaceonly = /^\s*$/;
+ $saveline = $_;
+ &tmake_verb("Evaluate: $cmd");
+ $text = "";
+ eval $cmd;
+ die $@ if $@;
+ next if $spaceonly && ($text =~ /^\s*$/);
+ print $saveline . $text . "\n" if $output_count <= 0;
+ } else { # something else
+ print if $output_count <= 0;
+ }
+ }
+ close( T );
+}
+
+
+#
+# Expand(tag) - appends to $text
+#
+# Expands a list of $project{} variables with a space character between them.
+#
+
+sub Expand {
+ my @tags = @_;
+ my($t);
+ $t = Project(@tags);
+ if ( $text eq "" ) {
+ $text = $t;
+ } elsif ( $t ne "" ) {
+ $text .= " " . $t;
+ }
+ return $text;
+}
+
+
+#
+# ExpandGlue(tag,prepend,glue,append) - appends to $text
+#
+# Expands a $project{} tag, splits on whitespace
+# and joins with $glue. $prepend is put at the start
+# of the string and $append is put at the end of the
+# string. The resulting string becomes "" if the project
+# tag is empty or not defined.
+#
+# Example:
+#
+# The project file defines:
+# SOURCES = a b c
+#
+# ExpandGlue("SOURCES","<","-",">")
+#
+# The result:
+# $text = "<a-b-c>"
+#
+
+sub ExpandGlue {
+ my($tag,$prepend,$glue,$append) = @_;
+ my($t,$v);
+ $v = Project($tag);
+ if ( $v eq "" ) {
+ $t = "";
+ } else {
+ $t = $prepend . join($glue,split(/\s+/,$v)) . $append;
+ }
+ if ( $text eq "" ) {
+ $text = $t;
+ } elsif ( $t ne "" ) {
+ $text .= " " . $t;
+ }
+ return $text;
+}
+
+
+#
+# ExpandList(tag) - sets $text.
+#
+# Suitable for expanding HEADERS = ... etc. in a Makefile
+#
+
+sub ExpandList {
+ my($tag) = @_;
+ return ExpandGlue($tag,""," ${linebreak}\n\t\t","");
+}
+
+
+#
+# TmakeSelf()
+#
+# Generates makefile rule to regenerate the makefile using tmake.
+#
+
+sub TmakeSelf {
+ my $a = "tmake $project_name";
+ if ( $nodepend ) {
+ $a .= " -nodepend";
+ }
+ if ( $outfile ) {
+ $text = "tmake: $outfile\n\n$outfile: $project_name\n\t";
+ $a .= " -o $outfile";
+ } else {
+ $text = "tmake:\n\t";
+ }
+ $text .= $a
+}
+
+
+#
+# Objects(files)
+#
+# Replaces any extension with .o ($obj_ext).
+#
+
+sub Objects {
+ local($_) = @_;
+ my(@a);
+ @a = split(/\s+/,$_);
+ foreach ( @a ) {
+ s-\.\w+$-.${obj_ext}-;
+ if ( defined($project{"OBJECTS_DIR"}) ) {
+ s-^.*[\\/]--;
+ $_ = $project{"OBJECTS_DIR"} . $_;
+ }
+ }
+ return join(" ",@a);
+}
+
+
+#
+# list_moc(files,prefix,extension)
+#
+# Scans all files and selects all files that contain Q_OBJECT.
+# Insert a prefix before the filename and replaces the filename extention.
+#
+
+sub list_moc {
+ my($files,$pre,$ext) = @_;
+ my(@v,@m,@lines,$contents,$n,$f,$t);
+ @v = split(/\s+/,$files);
+ undef $/;
+ foreach $f ( @v ) {
+ if ( open(TMP,fix_path($f)) ) {
+ $contents = <TMP>;
+ close(TMP);
+ $n = 0;
+ @lines = split(/\n/,$contents);
+ grep( /tmake\s+ignore\s+Q_OBJECT/ && $n--, @lines );
+ $contents =~ s-/\*.*?\*/--gs; # strip C/C++ comments
+ $contents =~ s-//.*\n--g;
+ @lines = split(/\n/,$contents);
+ grep( /(^|\W)Q_OBJECT(\W|$)/ && $n++, @lines );
+ if ( $n > 0 ) {
+ $t = $f;
+ $t =~ s-^(.*[/\\])?([^/\\]*?)\.(\w+)$-$1${pre}$2.${ext}-;
+ if ( defined($project{"MOC_DIR"}) ) {
+ $t =~ s-^.*[\\/]--;
+ $t = $project{"MOC_DIR"} . $t;
+ }
+ $moc_output{$f} = $t;
+ $moc_input{$t} = $f;
+ push(@m,$t);
+ }
+ $contents = "";
+ }
+ }
+ $/ = "\n";
+ return join(" ",@m);
+}
+
+
+#
+# BuildObj(objects,sources)
+#
+# Builds the object files.
+#
+
+sub BuildObj {
+ my($obj,$src) = @_;
+ my(@objv,$srcv,$i,$s,$o,$d,$c);
+ @objv = split(/\s+/,$obj);
+ @srcv = split(/\s+/,$src);
+ for $i ( 0..$#objv ) {
+ $s = $srcv[$i];
+ $o = $objv[$i];
+ next if $s eq "";
+ $text .= $o . ": " . $s;
+ if ( $moc_output{$s} ne "" ) {
+ $text .= " ${linebreak}\n\t\t" . $moc_output{$s};
+ }
+ $d = &make_depend($s);
+ $text .= " ${linebreak}\n\t\t" . $d if $d ne "";
+ if ( defined($project{"OBJECTS_DIR"}) ||
+ !defined($project{"TMAKE_COMPILE_IMP"}) ) {
+ $c = $project{"TMAKE_COMPILE"};
+ $c =~ s/\$src/$s/;
+ $c =~ s/\$obj/$o/;
+ $text .= "\n\t$c";
+ }
+ $text .= "\n\n";
+ }
+ chop $text;
+}
+
+
+#
+# BuildMocObj(objects,sources)
+#
+# Builds the moc object files.
+#
+
+sub BuildMocObj {
+ my($obj,$src) = @_;
+ my(@objv,$srcv,$i,$s,$o,$hdr,$d);
+ @objv = split(/\s+/,$obj);
+ @srcv = split(/\s+/,$src);
+ for $i ( 0..$#objv ) {
+ $s = $srcv[$i];
+ $o = $objv[$i];
+ $hdr = $moc_input{$srcv[$i]};
+ $text .= $o . ": " . $s . " ${linebreak}\n\t\t" . $hdr;
+ $d = &make_depend($hdr);
+ $text .= " ${linebreak}\n\t\t" . $d if $d ne "";
+ if ( defined($project{"OBJECTS_DIR"}) || defined($project{"MOC_DIR"})||
+ !defined($project{"TMAKE_COMPILE_IMP"}) ) {
+ $c = $project{"TMAKE_COMPILE"};
+ $c =~ s/\$src/$s/;
+ $c =~ s/\$obj/$o/;
+ $text .= "\n\t$c";
+ }
+ $text .= "\n\n";
+ }
+ chop $text;
+}
+
+
+#
+# BuildMocSrc(files)
+#
+# Builds the moc source files from headers and sources.
+#
+
+sub BuildMocSrc {
+ my($f) = @_;
+ my(@v,$m,$o);
+ @v = split(/\s+/,$f);
+ foreach $m ( @v ) {
+ $o = $moc_output{$m};
+ if ( $o ne "" ) {
+ $text .= "$o: $m\n\t$moc_cmd $m -o $o\n\n";
+ }
+ }
+ chop $text;
+}
+
+
+#
+# AddIncludePath(path)
+#
+# Adds path to the current include path, $project{"INCLUDEPATH"}.
+#
+
+sub AddIncludePath {
+ my($path) = @_;
+ my($p);
+ if ( $project{"INCPATH"} &&
+ ($project{"INCPATH"} =~ /(?:^|\s)\Q$path\E(?:\s|$)/) ) {
+ return;
+ }
+ $p = $project{"INCLUDEPATH"};
+ $p = ($p && $path) ? ($p . ";" . $path) : ($p . $path);
+ $project{"INCLUDEPATH"} = $p;
+ $p = join(" ",&split_path($p));
+ $p =~ s=[\\/](\s|$)= =g;
+ $project{"INCPATH"} = $p;
+}
+
+
+#
+# FindHighestLibVersion(dir,name)
+#
+# Returns the newest library version. Scans all the files in the specifies
+# directory and returns the highest version number.
+#
+# Used on Windows only.
+#
+# Example:
+# FindHighestLibVersion("c:\qt\lib","qt") returns "200" if
+# the c:\qt\lib directory contains qt141.lib and qt200.lib.
+#
+
+sub FindHighestLibVersion {
+ my($dir,$name) = @_;
+ my(@files,$f,$v,$highest);
+ $highest = "";
+ @files = find_files($dir,"${name}.*\.lib");
+ for $f ( @files ) {
+ if ( $f =~ /(\d+)\.lib/ ) {
+ $v = $1;
+ if ( $highest eq "" || $v > $highest ) {
+ $highest = $v;
+ }
+ }
+ }
+ return $highest;
+}
+
+
+#
+# Finds files.
+#
+# Examples:
+# find_files("/usr","\.cpp$",1) - finds .cpp files in /usr and below
+# find_files("/tmp","^#",0) - finds #* files in /tmp
+#
+
+sub find_files {
+ my($dir,$match,$descend) = @_;
+ my($file,$p,@files);
+ local(*D);
+ $dir =~ s=\\=/=g;
+ ($dir eq "") && ($dir = ".");
+ if ( opendir(D,fix_path($dir)) ) {
+ if ( $dir eq "." ) {
+ $dir = "";
+ } else {
+ ($dir =~ /\/$/) || ($dir .= "/");
+ }
+ foreach $file ( readdir(D) ) {
+ next if ( $file =~ /^\.\.?$/ );
+ $p = $dir . $file;
+ if ( $is_unix ) {
+ ($file =~ /$match/) && (push @files, $p);
+ } else {
+ ($file =~ /$match/i) && (push @files, $p);
+ }
+ if ( $descend && -d $p && ! -l $p ) {
+ push @files, &find_files($p,$match,$descend);
+ }
+ }
+ closedir(D);
+ }
+ return @files;
+}
+
+
+#
+# make_depend(file)
+#
+# Returns a list of included files.
+# Uses the global $depend_path variable.
+#
+
+sub make_depend {
+ my($file) = @_;
+ my($i,$count);
+ if ( $nodepend ) {
+ return "";
+ }
+ if ( ! $depend_path_fixed ) {
+ $depend_path_fixed = 1;
+ $depend_path = $project{"DEPENDPATH"};
+ $count = 0;
+ while ( $count < 100 ) {
+ if ( $depend_path =~ s/(\$[\{\(]?\w+[\}\)]?)/035/ ) {
+ $_ = $1;
+ s/[\$\{\}\(\)]//g;
+ $depend_path =~ s/035/$ENV{$_}/g;
+ } else {
+ $count = 100;
+ }
+ }
+ @dep_path = &split_path($depend_path);
+ }
+ @cur_dep_path = @dep_path;
+ if ( $file =~ /(.*[\/\\])/ ) {
+ $dep_curdir = $1;
+ splice( @cur_dep_path, 0, 0, $dep_curdir );
+ } else {
+ $dep_curdir = "";
+ }
+ $dep_file = $file;
+ &canonical_dep($file);
+ %dep_dict = ();
+ $i = &build_dep($file);
+ chop $i;
+ $i =~ s=/=$dir_sep=g unless $is_unix;
+ $i =~ s=([a-zA-Z]):/=//$1/=g if $gnuwin32;
+ return join(" ${linebreak}\n\t\t",split(/ /,$i) );
+}
+
+#
+# build_dep() - Internal for make_depend()
+#
+
+sub build_dep {
+ my($file) = @_;
+ my(@i,$a,$n);
+ $a = "";
+ return $a if !(defined $depend_dict{$file});
+ @i = split(/ /,$depend_dict{$file});
+ for $n ( @i ) {
+ if ( !defined($dep_dict{$n}) && defined($full_path{$n}) ) {
+ $dep_dict{$n} = 1;
+ $a .= $full_path{$n} . " " . &build_dep($n);
+ }
+ }
+ return $a;
+}
+
+#
+# canonical_dep(file) - Internal for make_depend()
+#
+# Reads the file and all included files recursively.
+# %depend_dict associates a file name to a list of included files.
+#
+
+sub canonical_dep {
+ my($file) = @_;
+ my(@inc,$i);
+ @inc = &scan_dep($file);
+ if ( @inc ) {
+ $depend_dict{$file} = join(" ",@inc);
+ for $i ( @inc ) {
+ &canonical_dep($i) if !defined($depend_dict{$i});
+ }
+ }
+}
+
+#
+# scan_dep(file) - Internal for make_depend()
+#
+# Returns an array of included files.
+#
+
+sub scan_dep {
+ my($file) = @_;
+ my($dir,$path,$found,@allincs,@includes,%incs);
+ $path = ($file eq $dep_file) ? $file : $dep_curdir . $file;
+ @includes = ();
+ return @includes if $file =~ /\.$moc_ext$/; # avoid .moc files
+ if ( ! (-f fix_path($path)) ) {
+ $found = 0;
+ for $dir ( @cur_dep_path ) {
+ $path = $dir . $file;
+ last if ( $found = (-f fix_path($path)) );
+ }
+ return @includes if ! $found;
+ }
+ undef $/;
+ if ( open(TMP,fix_path($path)) ) {
+ $full_path{$file} = $path;
+ $_ = <TMP>;
+ s-/\*.*?\*/--gs; # strip C/C++ comments
+ s-//.*\n-\n-g;
+ @allincs = split(/\n/,$_);
+ @allincs = grep(/^\s*#\s*include/,@allincs);
+ foreach ( @allincs ) { # all #include lines
+ next if !(/^\s*#\s*include\s+[<"]([^>"]*)[>"]/) || defined($incs{$1});
+ push(@includes,$1);
+ $incs{$1} = "1";
+ }
+ close(TMP);
+ }
+ $/ = "\n";
+ return @includes;
+}
+
+
+#
+# split_path(path)
+#
+# Splits a path containing : (Unix) or ; (MSDOS, NT etc.) separators.
+# Returns an array.
+#
+
+sub split_path {
+ my($p) = @_;
+ $p =~ s=:=;=g if $is_unix;
+ $p =~ s=[/\\]+=/=g;
+ $p =~ s=([^/:]);=$1/;=g;
+ $p =~ s=([^:;/])$=$1/=;
+ $p =~ s=/=$dir_sep=g unless $is_unix;
+ return split(/;/,$p);
+}
+
+
+#
+# fix_path(path)
+#
+# Converts all '\' to '/' if this really seems to be a Unix box.
+#
+
+sub fix_path {
+ my($p) = @_;
+ if ( $really_unix ) {
+ $p =~ s-\\-/-g;
+ } else {
+ $p =~ s-/-\\-g;
+ }
+ return $p;
+}
+__END__
+:endofperl
diff --git a/tmake/doc/m-linux-gcc.html b/tmake/doc/m-linux-gcc.html
new file mode 100644
index 0000000..300ef35
--- /dev/null
+++ b/tmake/doc/m-linux-gcc.html
@@ -0,0 +1,85 @@
+<!doctype HTML public "-//W3C//DTD HTML 3.2//EN">
+<html><head><title>
+Generated Makefile for Linux / GNU g++
+</title></head><body bgcolor="#ffffff">
+<h2 align=center>Generated Makefile for Linux / GNU gcc</h2>
+
+<pre>
+#############################################################################
+# Makefile for building hello
+# Generated by tmake at 10:11, 1998/07/07
+# Project: hello
+# Template: app
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = g++
+CFLAGS = -Wall -W -O2 -fno-strength-reduce
+INCPATH = -I$(QTDIR)/include
+LINK = g++
+LFLAGS =
+LIBS = -L$(QTDIR)/lib -lqt -L/usr/X11R6/lib -lX11
+MOC = moc
+
+####### Files
+
+HEADERS = hello.h
+SOURCES = hello.cpp \
+ main.cpp
+OBJECTS = hello.o \
+ main.o
+SRCMOC = moc_hello.cpp
+OBJMOC = moc_hello.o
+TARGET = hello
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .C .c
+
+.cpp.o:
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+
+.cxx.o:
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+
+.cc.o:
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+
+.C.o:
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+
+.c.o:
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+
+####### Build rules
+
+all: $(TARGET)
+
+$(TARGET): $(OBJECTS) $(OBJMOC)
+ $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
+
+moc: $(SRCMOC)
+
+tmake:
+ tmake hello.pro
+
+clean:
+ -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(TARGET)
+ -rm -f *~ core
+
+####### Compile
+
+hello.o: hello.cpp \
+ hello.h
+
+main.o: main.cpp \
+ hello.h
+
+moc_hello.o: moc_hello.cpp \
+ hello.h
+
+moc_hello.cpp: hello.h
+ $(MOC) hello.h -o moc_hello.cpp
+</pre>
+</body></html>
diff --git a/tmake/doc/m-win32-msvc.html b/tmake/doc/m-win32-msvc.html
new file mode 100644
index 0000000..24097cc
--- /dev/null
+++ b/tmake/doc/m-win32-msvc.html
@@ -0,0 +1,89 @@
+<!doctype HTML public "-//W3C//DTD HTML 3.2//EN">
+<html><head><title>
+Generated Makefile for Win32 / Microsoft Visual C++
+</title></head><body bgcolor="#ffffff">
+<h2 align=center>Generated Makefile for Win32 / Microsoft Visual C++</h2>
+
+<pre>
+#############################################################################
+# Makefile for building hello
+# Generated by tmake at 20:40, 1998/02/27
+# Project: hello
+# Template: app
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = cl
+CFLAGS = -nologo -W3 -O2
+INCPATH = -I"$(QTDIR)\include"
+LINK = link
+LFLAGS = /NOLOGO /SUBSYSTEM:windows
+LIBS = $(QTDIR)\lib\qt.lib user32.lib gdi32.lib comdlg32.lib wsock32.lib
+MOC = moc
+
+####### Files
+
+HEADERS = hello.h
+SOURCES = hello.cpp \
+ main.cpp
+OBJECTS = hello.obj \
+ main.obj
+SRCMOC = moc_hello.cpp
+OBJMOC = moc_hello.obj
+TARGET = hello.exe
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .c
+
+.cpp.obj:
+ $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $<
+
+.cxx.obj:
+ $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $<
+
+.cc.obj:
+ $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $<
+
+.c.obj:
+ $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $<
+
+####### Build rules
+
+all: $(TARGET)
+
+$(TARGET): $(OBJECTS) $(OBJMOC)
+ $(LINK) $(LFLAGS) /OUT:$(TARGET) @<<
+ $(OBJECTS) $(OBJMOC) $(LIBS)
+<<
+
+moc: $(SRCMOC)
+
+tmake: Makefile
+
+Makefile: hello.pro
+ tmake hello.pro -o Makefile
+
+clean:
+ -del hello.obj
+ -del main.obj
+ -del moc_hello.cpp
+ -del moc_hello.obj
+ -del $(TARGET)
+
+####### Compile
+
+hello.obj: hello.cpp \
+ hello.h
+
+main.obj: main.cpp \
+ hello.h
+
+moc_hello.obj: moc_hello.cpp \
+ hello.h
+
+moc_hello.cpp: hello.h
+ $(MOC) hello.h -o moc_hello.cpp
+</pre>
+</body></html>
diff --git a/tmake/doc/tmake.html b/tmake/doc/tmake.html
new file mode 100644
index 0000000..b19af51
--- /dev/null
+++ b/tmake/doc/tmake.html
@@ -0,0 +1,638 @@
+<!doctype HTML public "-//W3C//DTD HTML 3.2//EN">
+<html><head><title>
+tmake User's Guide
+</title></head><body bgcolor="#ffffff">
+<p><h1 align=center>tmake User's Guide</h1>
+
+
+<hr>
+<h2>License Statement</h2>
+
+Copyright (C) 1996-1998 by Troll Tech AS. All rights reserved.<p>
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted, provided
+that this copyright notice appears in all copies.
+No representations are made about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+
+
+<hr>
+<h2>Introduction</h2>
+
+tmake is an easy-to-use tool for creating and maintaining makefiles across
+many platforms and compilers. The idea is that you should spend your time
+writing code, not makefiles.
+
+<p>
+We wrote tmake because we spent too much time maintaining makefiles for
+Windows and Unix compilers. Being the developer of the multi-platform GUI
+toolkit <a href="http://www.troll.no/qt">Qt</a>, Troll Tech must provide
+Qt makefiles for more than 30 different OS/compiler combinations.
+
+<p>
+We looked at GNU autoconf, but it was Unix-specific and not flexible
+enough in our opinion. Our makefile system also had to deal with Qt
+<a href="http://www.troll.no/qt/metaobjects.html">meta object
+compiler</a> (moc) issues. The moc program extracts meta information from
+C++ files and generates a C++ file with data tables etc. It takes work to
+add makefile rules for the moc and wanted to automate this task.
+
+<p>
+The tmake project was started around mid 1996 and version 1.0 was released
+in September 1997. It soon became a success and is now widely used among
+Qt programmers.
+
+<p>
+tmake is written in Perl and requires perl version 5 or newer. You do not
+need to be familiar with Perl programming to use tmake, but you should
+learn Perl if you want to write your own makefile templates.
+
+<p>
+<b>Windows users:</b> The tmake distribution for Win32 includes tmake.exe
+(built by the perl2exe utility) and you do not need to download and
+install perl unless you want to modify the tmake source code or run other
+perl scripts. You can download perl for Win32 (Windows NT and 95) from <a
+href="http://www.activestate.com">www.activestate.com</a>
+
+<p>
+Feedback is highly appreciated. Contact the author hanord@troll.no if you
+have ideas, patches etc. for tmake.
+
+
+<hr>
+<h2>Installation</h2>
+
+<ol>
+<li>Make sure you have perl version 5 or later installed (optional
+for Windows users).
+<li>Unpack the tmake tar.gz or zip archive.
+<li>Set the TMAKEPATH environment variable to the directories
+containing the template files (see below).
+<li>Add the tmake/bin directory to your PATH.
+</ol>
+
+Here are some examples:<p>
+<strong>Unix Bourne shell:</strong><pre>
+ TMAKEPATH=/local/tmake/lib/linux-g++
+ PATH=$PATH:/local/tmake/bin
+ export TMAKEPATH PATH
+</pre>
+
+<strong>Unix C shell:</strong><pre>
+ setenv TMAKEPATH /local/tmake/lib/linux-g++
+ setenv PATH $PATH:/local/tmake/bin
+</pre>
+
+<strong>Windows NT and Windows 95:</strong><pre>
+ set TMAKEPATH=c:\tmake\lib\win32-msvc
+ set PATH=%PATH%;c:\tmake\bin
+</pre>
+
+<p>
+The template directory name has the form <em>platform</em>-<em>compiler</em>.
+Each template directory contains template files and a configuration file.
+
+<p>
+Supported platforms: AIX, Data General, FreeBSD, HPUX, SGI Irix, Linux,
+NetBSD, OpenBSD, OSF1/DEC, SCO, Solaris, SunOS, Ultrix, Unixware and
+Win32.
+
+<p>
+Have a look at the tmake/lib directory to see if your platform-compiler
+combination is supported. If it's not there, please tell us.
+
+<p>
+<b>Unix users:</b> tmake requires that perl is in /usr/bin. If your
+version of perl is elsewehere, either change the first line of tmake or
+make a small shell script which invokes tmake with the correct perl.
+
+
+<hr>
+<h2>Getting Started</h2>
+
+Let's assume you have a small Qt application consisting of one C++ header
+file and two source files.
+
+First you need to create a project file, e.g. hello.pro:<pre>
+ HEADERS = hello.h
+ SOURCES = hello.cpp main.cpp
+ TARGET = hello
+</pre>
+
+Then run tmake to create a Makefile:<pre>
+ tmake hello.pro -o Makefile
+</pre>
+And finally:<pre>
+ make
+</pre>
+This builds the hello program. Remember to set the <code>TMAKEPATH</code>
+environment variable before you run tmake.
+<p>
+See <a href="m-linux-gcc.html">Makefile for Linux/g++</a>.<br>
+See <a href="m-win32-msvc.html">Makefile for Win32/msvc</a>
+(Microsoft Visual C++).<br>
+
+
+<hr>
+<h2>Makefile Templates</h2>
+
+The tmake distribution includes three makefile templates and one
+configuration file for each platform/compiler combination. The
+<code>TMAKEPATH</code> environment variable tells tmake where to find
+these files:
+<p>
+<table border="0">
+ <tr>
+ <td>&nbsp;</td>
+ <td>app.t</td>
+ <td>&nbsp;</td>
+ <td>Creates a makefile for building applications.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>lib.t</td>
+ <td>&nbsp;</td>
+ <td>Creates a makefile for building libraries.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>subdirs.t</td>
+ <td>&nbsp;</td>
+ <td>Creates a makefile for building targets in subdirectories.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>tmake.conf</td>
+ <td>&nbsp;</td>
+ <td>This configuration file contains compiler options and lists
+ tools and libraries.
+ </tr>
+</table>
+
+
+<p>
+The hello.pro project file above does not have a <code>TEMPLATE</code> or
+a <code>CONFIG</code> tag. The default template is <tt>app</tt> (the .t
+extension is optional) and the default configuration is <tt>qt warn_on
+release</tt>.
+
+This project file produces exactly the same result as the hello.pro
+above:<pre>
+ TEMPLATE = app
+ CONFIG = qt warn_on release
+ HEADERS = hello.h
+ SOURCES = hello.cpp main.cpp
+ TARGET = hello
+</pre>
+
+
+
+<h4>Makefile Configuration</h4>
+
+<p>
+The <code>CONFIG</code> tag is recognized by both the app.t and lib.t
+templates and specifies what compiler options to use and which extra
+libraries to link in.
+
+These options control the compilation flags:
+<p>
+<table border="0">
+ <tr>
+ <td>&nbsp;</td>
+ <td>release</td>
+ <td>&nbsp;</td>
+ <td>Compile with optimization enabled, ignored if
+ "debug" is specified.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>debug</td>
+ <td>&nbsp;</td>
+ <td>Compile with debug options enabled.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>warn_on</td>
+ <td>&nbsp;</td>
+ <td>The compiler should emit more warnings than normally, ignored if
+ "warn_off" is specified.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>warn_off</td>
+ <td>&nbsp;</td>
+ <td>The compiler should emit no warnings or as few as possible.</td>
+ </tr>
+</table>
+
+<p>
+These options defines the application/library type:
+<p>
+<table border="0">
+ <tr>
+ <td>&nbsp;</td>
+ <td>qt</td>
+ <td>&nbsp;</td>
+ <td>The target is a Qt application/library and requires Qt header
+ files/library.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>opengl</td>
+ <td>&nbsp;</td>
+ <td>The target requires the OpenGL (or Mesa) headers/libraries.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>x11</td>
+ <td>&nbsp;</td>
+ <td>The target is a X11 application (app.t only).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>windows</td>
+ <td>&nbsp;</td>
+ <td>The target is a Win32 window application (app.t only).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>console</td>
+ <td>&nbsp;</td>
+ <td>The target is a Win32 console application (app.t only).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>dll</td>
+ <td>&nbsp;</td>
+ <td>The target is a shared object/DLL (app.t only).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>staticlib</td>
+ <td>&nbsp;</td>
+ <td>The target is a static library (lib.t only).</td>
+ </tr>
+</table>
+
+<p>
+As an example, if the hello application uses both Qt and OpenGL and you
+want to compile it for debugging, your <code>CONFIG</code> line should
+read:<pre>
+ CONFIG = qt opengl debug
+</pre>
+
+<p>
+The most common tmake options and project tags are described here.
+See the tmake <a href="tmake_ref.html">reference manual</a> for
+details.<p>
+
+
+
+<h4>The Application Template</h4>
+
+The application template, app.t, lets you compile and link executable
+programs or shared objects (DLLs).
+
+This template recognizes several tags.
+<p>
+<table border="0">
+ <tr>
+ <td>&nbsp;</td>
+ <td>HEADERS</td>
+ <td>&nbsp;</td>
+ <td>Header files.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>SOURCES</td>
+ <td>&nbsp;</td>
+ <td>Source files.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>TARGET</td>
+ <td>&nbsp;</td>
+ <td>Name of executable (adds .exe if on Windows).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>DESTDIR</td>
+ <td>&nbsp;</td>
+ <td>Where to put the target.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>DEFINES</td>
+ <td>&nbsp;</td>
+ <td>Tell compiler to define C preprocessor macros (-D option).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>INCLUDEPATH</td>
+ <td>&nbsp;</td>
+ <td>Sets the include file search path for the compiler (-I
+ option).
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>DEPENDPATH</td>
+ <td>&nbsp;</td>
+ <td>Sets the dependency search path for tmake.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>DEF_FILE</td>
+ <td>&nbsp;</td>
+ <td>Win32 only: Link with a .def file.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>RC_FILE</td>
+ <td>&nbsp;</td>
+ <td>Win32 only: Use a .rc file (compile to temporary .res).
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>RES_FILE</td>
+ <td>&nbsp;</td>
+ <td>Win32 only: Link with a .res file.
+ </td>
+ </tr>
+</table>
+
+<p>
+
+
+<h4>The Library Template</h4>
+
+The library template, lib.t, lets you compile and create static or shared
+libraries.
+
+<p>
+The lib.t template supports the same project tags as app.t, but also
+<code>VERSION</code>. <code>VERSION</code> is the version number of the
+target library, e.g. 1.40. The version is important for Unix shared
+libraries, but ignored on Windows.
+
+
+
+<h4>The Subdirs Template</h4>
+
+The subdirs template, subdirs.t, lets you invoke make in subdirectories.
+
+<p>The <code>SUBDIRS</code> tag contains the name of all subdirectories to
+be processed.
+
+
+<h4>Special Templates for Microsoft Visual C++</h4>
+
+If you have Microsoft Visual C++ 5.0, you can use two special templates to
+generate a MSVC++ IDE project (.dsp file). After you have generated
+e.g. hello.dsp, choose "File"->"Open Workspace" and select the hello.dsp
+file. Visual C++ will then create a workspace (.dsw file) for you.<p>
+<table border="0">
+ <tr>
+ <td>&nbsp;</td>
+ <td>vcapp.t</td>
+ <td>&nbsp;</td>
+ <td>Creates an application project file (Microsoft Visual C++ 5.0
+ only).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>vclib.t</td>
+ <td>&nbsp;</td>
+ <td>Creates a library project file (Microsoft Visual C++ 5.0
+ only).</td>
+ </tr>
+</table>
+
+<p>
+Run tmake to create a hello.dsp file (use -t to override the default
+template):<pre>
+ tmake -t vcapp -o hello.dsp hello.pro
+</pre>
+
+
+<hr>
+<h2><a name="usage"></a>Program Usage: tmake</h2>
+
+Usage:<pre>
+ tmake [options] <em>project-file</em>
+</pre>
+Options:<pre>
+ -e expr Evaluate the Perl expression. Ignores the template file.
+ -nodepend Don't generate dependency information.
+ -o <em>file</em> Write output to <em>file</em> instead of stdout.
+ -p <em>file</em> Load an additional project file.
+ -t <em>file</em> Specify a template <em>file</em>.
+ -unix Force tmake into Unix mode.
+ -v Verbose/debugging on.
+ -win32 Force tmake into Win32 mode.
+</pre>
+
+The -t option overrides any <code>TEMPLATE</code> tag in the project file.
+<p>
+The default project file extension is ".pro". The default template file
+extension is ".t". If you do not specify these extension tmake will
+automatically add them for you.
+<p>
+
+
+<hr>
+<h2><a name="progen"></a>The progen Utility</h2>
+
+The progen utility creates project files for you. It can be used like
+this:<pre>
+ progen -n hello -o hello.pro
+</pre>
+If no .cpp or .h files are specified on the command line, progen
+searches for .cpp and .h (except moc_*.cpp) in the current directory
+and below.
+<p>
+Usage:<pre>
+ progen [options] [<em>C/C++ header files and source files</em>]
+</pre>
+Options:<pre>
+ -lower Lower-case letters in filenames (useful on Windows).
+ -n <em>name</em> Specify a project name (<code>TARGET</code>).
+ -o <em>file</em> Write output to <em>file</em> instead of stdout.
+ -t <em>file</em> Specify a template <em>file</em>.
+</pre>
+
+
+<hr>
+<h2>Advanced Topics</h2>
+
+In most cases you will be happy with using tmake as described above, but
+sometimes you need to add special compiler options or even add new
+makefile rules. This chapter describes how to customize your makefiles.
+
+<h4>Conditional Project Settings</h4>
+
+If you need a special compiler option etc., you can add platform-dependent
+settings in your project file:<pre>
+ solaris-cc:TMAKE_CC = /opt/bin/CC_5.0
+ solaris-cc:TMAKE_CFLAGS = -pts
+ unix:TMAKE_LIBS = -lXext
+ win32:INCLUDE_PATH = c:\myinclude
+ win32-borland:DEFINES = NO_BOOL
+</pre>
+
+You can prefix a project tag with unix: or win32: to make it specific for
+either Unix or Windows. You can also prefix tags with
+<em>platform-compiler</em>
+
+<h4>Your Own Templates</h4>
+
+If you know Perl programming, there is virtually no limitation to what you
+can do with tmake. First you need to know how tmake works.
+
+<h4>Template Processing</h4>
+
+When you run tmake, it first reads the <tt>tmake.conf</tt> file.
+This configuration file has the same syntax as the project file.
+
+tmake then reads the project file and sets the project tags it
+finds, e.g. <code>HEADERS</code>, <code>SOURCES</code> etc.
+
+All tags and values are stored in a global associative Perl hash
+array called <code>project</code>. For example,
+<code>$project{"SOURCES"}</code> contains "hello.cpp main.cpp"
+after processing hello.pro.
+
+When both the <tt>tmake.conf</tt> and the project files have been
+read, tmake starts reading the template file line by line and
+executes any Perl code it finds in the template.
+
+<ul>
+<li>Anything after <code>#$</code> until newline is
+ evaluated as perl code. The perl code is substituted
+ with the contents of the <code>$text</code>
+ variable.
+<li>Block of perl code: <code>#${</code> until
+ <code>#$}</code>.
+<li>Comments; <code>#!</code> until newline is stripped.
+<li>Anything else is copied directly from the template to
+ the output.
+</ul>
+
+<p>
+Example:<pre>
+ #! This is a comment which will be removed.
+ This text will appear in the output.
+ #$ $text = "The header file(s) are: " . $project{"HEADERS"};
+ # This text also appears in the output.
+ #${
+ $a = 12;
+ $b = 13;
+ $text = $a * $b;
+ #$}
+ That's all.
+</pre>
+Output:<pre>
+ This text will appear in the output.
+ The header file(s) are: hello.h
+ # This text also appears in the output.
+ 156
+ That's all.
+</pre>
+
+
+<h3>Using tmake With Lex and Yacc</h3>
+
+The standard tmake templates knows how to process C and C++ files, but
+sometimes you need to process additional files and link them into your
+project. A typical example is to process lex and yacc files when you're
+building a parser.
+
+<p>
+Parser template:<pre>
+ #!
+ #! parser.t: This is a custom template for building a parser
+ #!
+ #$ IncludeTemplate("app.t");
+
+ ####### Lex/yacc programs and options
+
+ LEX = flex
+ YACC = #$ $text = ($is_unix ? "yacc -d" : "byacc -d");
+
+ ####### Lex/yacc files
+
+ LEXIN = #$ Expand("LEXINPUT");
+ LEXOUT = lex.yy.c
+ YACCIN = #$ Expand("YACCINPUT");
+ YACCOUT = y.tab.c
+ YACCHDR = y.tab.h
+ PARSER = #$ Expand("PARSER");
+
+ ####### Process lex/yacc files
+
+ $(LEXOUT): $(LEXIN)
+ $(LEX) $(LEXIN)
+
+ $(PARSER): $(YACCIN) $(LEXOUT)
+ $(YACC) $(YACCIN)
+ #$ $text = ($is_unix ? "-rm -f " : "-del ") . '$(PARSER)';
+ #$ $text = ($is_unix ? "-mv " : "-ren ") . '$(YACCOUT) $(PARSER)';
+</pre>
+
+The parser template adds some extra rules to the application template
+in order to build the lex and yacc portions of the project. This
+template is portable across Unix and Windows since it generates different
+commands depending on the <code>$is_unix</code> variable.
+
+<p>
+To learn more about the Expand() function and other Perl functions which
+tmake provides, consult the <a href="tmake_ref.html">reference manual</a>.
+
+<p>
+Example project file:<pre>
+ TEMPLATE = parser.t
+ CONFIG = console release
+ LEXINPUT = lexer.l
+ YACCINPUT = grammar.y
+ PARSER = parser.cpp
+ SOURCES = $$PARSER \
+ node.cpp \
+ asmgen.cpp
+ TARGET = parser
+</pre>
+
+Here we use macro expansion <code>$$PARSER</code> to avoid writing parser.cpp
+two places.
+
+
+<h3>Counting the Number of Code Lines</h3>
+
+tmake is generic since it is based on Perl. You can create your own
+templates for other purposes than producing makefiles. Here is an example
+template that counts the number of code lines in our project.
+
+<p>
+Template wc.t:<pre>
+ #! Template that count number of C++ lines.
+ The number of C++ code lines for #$ $text=$project_name;
+ #${
+ $files = $project{"HEADERS"} . " " . $project{"SOURCES"};
+ $text = `wc -l $files`;
+ #$}
+</pre>
+Run it:<pre>
+ tmake -t wc hello
+</pre>
+Output:<pre>
+ The number of C++ code lines for hello.pro
+ 25 hello.h
+ 98 hello.cpp
+ 38 main.cpp
+ 161 total
+</pre>
+This will only work if the wc program is installed on your system.
+
+
+</body></html>
diff --git a/tmake/doc/tmake_ref.html b/tmake/doc/tmake_ref.html
new file mode 100644
index 0000000..0b89b28
--- /dev/null
+++ b/tmake/doc/tmake_ref.html
@@ -0,0 +1,508 @@
+<!doctype HTML public "-//W3C//DTD HTML 3.2//EN">
+<html><head><title>
+tmake Reference Manual
+</title></head><body bgcolor="#ffffff">
+<p><h1 align=center>tmake Reference Manual</h1>
+
+<hr>
+<h2>Project Settings</h2>
+
+tmake recognizes several project tags. The syntax for setting a
+project variable is:<pre>
+ TAG = value
+</pre>
+You can also do tag expansion using $$:<pre>
+ ALLFILES = Project files: $$HEADERS $$SOURCES
+</pre>
+Normally you assign to a tag, but you can also add to a tag, subtract
+from a tag or replace parts of the tag.<pre>
+ A = abc
+ X = xyz
+ A += def # A = abc def
+ X *= xyz # X = xyz
+ B = $$A # B = abc def
+ B -= abc # B = def
+ X /= s/y/Y/ # X = xYz
+</pre>
+The *= operation adds the value if the tag does not already contain it.
+The /= operation performs regular expression substitution.
+
+<p>
+You can also set tags from the command line when running the tmake program.
+For instance, if you want to generate a makefile with debug information:<pre>
+ tmake hello.pro "CONFIG+=debug"
+</pre>
+
+<p>
+Use the <tt>unix:</tt> or <tt>win32:</tt> qualifier if you want a
+platform-specific tag:<pre>
+ SOURCES = common.cpp # common for all platforms
+ unix:SOURCES += unix.cpp # additional sources for Unix
+ win32:SOURCES += win32.cpp # additional sources for Windows
+ unix:LIBS += -lm # on Unix we need the math lib
+</pre>
+If none of the platforms match, tmake looks for the tag in <a
+href="#CONFIG">CONFIG</a> setting:<pre>
+ debug:SOURCES += dbgstuff.cpp # additional source for debugging
+</pre>
+
+Finally, you can set platform and compiler-dependent tags:<pre>
+ linux-g++:TMAKE_CFLAGS = -fno-rtti
+</pre>
+
+<p>
+You may define your own project tags to be used by custom templates. A
+project tag is stored in <code>%project</code>, which is an associative
+Perl array. Access it like this: <code>$project{"tag"}</code> or via the
+function <code>Project('tag')</code>. For example, after reading
+"hello.pro", <code>$project{"SOURCES"}</code> contains "hello.cpp
+main.cpp". One limitation of tmake is that it cannot handle file names
+with white space.<p>
+
+
+<hr>
+<h2>Project Tag Reference</h2>
+
+<h4><a name="ALL_DEPS"></a>ALL_DEPS</h4>
+Specifies additional dependencies for the makefile target "all:".<p>
+
+
+<h4><a name="CLEAN_FILES"></a>CLEAN_FILES</h4>
+Specifies additional files to be removed for "make clean".<p>
+Example:<pre>
+ CLEAN_FILES = core *~
+</pre>
+
+
+<h4><a name="CONFIG"></a>CONFIG</h4>
+Sets the make configuration. It tells the tmake templates what compiler
+options to use and which extra libraries to link in.<p>
+These options control the compilation flags:
+<p>
+<table border="0">
+ <tr>
+ <td>&nbsp;</td>
+ <td>release</td>
+ <td>&nbsp;</td>
+ <td>Compile with optimization enabled, ignored if
+ "debug" is specified.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>debug</td>
+ <td>&nbsp;</td>
+ <td>Compile with debug options enabled.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>warn_on</td>
+ <td>&nbsp;</td>
+ <td>The compiler should emit more warnings than normally, ignored if
+ "warn_off" is specified.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>warn_off</td>
+ <td>&nbsp;</td>
+ <td>The compiler should emit no warnings or as few as possible.</td>
+ </tr>
+</table>
+
+<p>
+These options defines the application/library type:
+<p>
+<table border="0">
+ <tr>
+ <td>&nbsp;</td>
+ <td>qt</td>
+ <td>&nbsp;</td>
+ <td>The target is a Qt application/library and requires Qt header
+ files/library.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>opengl</td>
+ <td>&nbsp;</td>
+ <td>The target requires the OpenGL (or Mesa) headers/libraries.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>x11</td>
+ <td>&nbsp;</td>
+ <td>The target is a X11 application (app.t only).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>windows</td>
+ <td>&nbsp;</td>
+ <td>The target is a Win32 window application (app.t only).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>console</td>
+ <td>&nbsp;</td>
+ <td>The target is a Win32 console application (app.t only).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>dll</td>
+ <td>&nbsp;</td>
+ <td>The target is a shared object/DLL (app.t only).</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>staticlib</td>
+ <td>&nbsp;</td>
+ <td>The target is a static library (lib.t only).</td>
+ </tr>
+</table>
+
+
+<h4><a name="DEF_FILE"></a>DEF_FILE</h4>
+Win32/app.t only: Specifies a .def file.
+
+
+<h4><a name="DESTDIR"></a>DESTDIR</h4>
+Specifies where to put the target file.
+Example:<pre>
+ DESTDIR = ../../lib
+</pre>
+You must create this directory before running make.
+
+
+<h4><a name="HEADERS"></a>HEADERS</h4>
+Defines the header files of the project.
+
+
+<h4><a name="INCPATH"></a>INCPATH</h4>
+This tag is generated from <code>INCLUDEPATH</code>. The ';' or ':'
+separators have been replaced by ' ' (single space). This makes it
+easier to split. qtapp.t and other templates expand
+<code>INCPATH</code> to set -I options for the C++ compiler.
+
+
+<h4><a name="INCLUDEPATH"></a>INCLUDEPATH</h4>
+This tag specifies the #include directories. It can be set in the
+project file, or by the <a href="#AddIncludePath">AddIncludePath()</a>
+function.<p>
+Example:<pre>
+ INCLUDEPATH = c:\msdev\include d:\stl\include
+</pre>
+Use ';' or space as the directory separator.
+
+
+<h4><a name="LIBS"></a>LIBS</h4>
+Defines additional libraries to be linked in when creating an application
+or a shared library. You probably want to use a platform qualifier since
+libraries are specified differently on Unix and Win32.<p>
+Example:<pre>
+ unix:LIBS = -lXext -lm
+ win32:LIBS = ole32.lib
+</pre>
+
+
+<h4><a name="MOC_DIR"></a>MOC_DIR</h4>
+Specifies where to put the temporary moc output files. By default they
+are stored in the directory where the moc input files are.
+<p>
+Example:<pre>
+ MOC_DIR = tmp
+</pre>
+You must create this directory before running make.
+<p>
+See also: <a href="#OBJECTS_DIR">OBJECTS_DIR</a>.
+
+
+<h4><a name="OBJECTS"></a>OBJECTS</h4>
+This tag is generated from <code>SOURCES</code> by the StdInit() function.
+The extension of each source file has been replaced by .o (Unix) or .obj
+(Win32).<p>
+Example:<pre>
+ SOURCES = a.x b.y
+</pre>
+Then <code>OBJECTS</code> become "a.o b.o" on Unix and "a.obj b.obj" on
+Win32.
+
+
+<h4><a name="OBJECTS_DIR"></a>OBJECTS_DIR</h4>
+Specifies where to put object files. By default they are stored in
+the directory where the source files are.<p>
+Example:<pre>
+ OBJECTS_DIR = tmp
+</pre>
+You must create this directory before running make.
+<p>
+See also: <a href="#MOC_DIR">MOC_DIR</a>.
+
+
+<h4><a name="OBJMOC"></a>OBJMOC</h4>
+This tag is generated by the <a href="#StdInit">StdInit()</a> function if
+<code>$moc_aware</code> is true. <code>OBJMOC</code> contains the name of
+all intermediate moc object files.<p>
+Example:<pre>
+ HEADERS = demo.h
+ SOURCES = demo.cpp main.cpp
+</pre>
+If <tt>demo.h</tt> and <tt>main.cpp</tt> define classes that use signals
+and slots (i.e. the <code>Q_OBJECT</code> "keyword" is found in these two
+files), <code>OBJMOC</code> becomes:<pre>
+ OBJMOC = moc_demo.obj
+</pre>
+See also: <a href="#SRCMOC">SRCMOC</a>.
+
+
+<h4><a name="PROJECT"></a>PROJECT</h4>
+This is the name of the project. It defaults to the name of the project
+file, excluding the .pro extension.
+
+
+<h4><a name="RC_FILE"></a>RC_FILE</h4>
+Win32/app.t only: Specifies a .rc file. Cannot be used with the RES_FILE
+tag.
+
+
+<h4><a name="RES_FILE"></a>RES_FILE</h4>
+Win32/app.t only: Specifies a .res file. You can either specify a
+.rc file or one or more .res files.
+
+
+<h4><a name="SOURCES"></a>SOURCES</h4>
+Defines the source files of the project.
+
+
+<h4><a name="SRCMOC"></a>SRCMOC</h4>
+This tag is generated by the <a href="#StdInit">StdInit()</a> function if
+<code>CONFIG</code> contains "qt". <code>SRCMOC</code> contains the name of
+all intermediate moc files.<p>
+Example:<pre>
+ HEADERS = demo.h
+ SOURCES = demo.cpp main.cpp
+</pre>
+If <tt>demo.h</tt> and <tt>main.cpp</tt> define classes that use signals
+and slots (i.e. the <code>Q_OBJECT</code> "keyword" is found in these two
+files), <code>SRCMOC</code> becomes:<pre>
+ SRCMOC = moc_demo.cpp main.moc
+</pre>
+See also: <a href="#OBJMOC">OBJMOC</a>.
+
+
+<h4><a name="TARGET"></a>TARGET</h4>
+Sets the makefile target, i.e. what program to build.
+
+
+<h4><a name="TEMPLATE"></a>TEMPLATE</h4>
+Sets the default template. This can be overridden by the tmake -t
+<a href="tmake.html#usage">option</a>.
+
+
+<h4><a name="TMAKE_CC"></a>TMAKE_CC</h4>
+Contains the name of the compiler.
+
+
+<h4><a name="TMAKE_CFLAGS"></a>TMAKE_CFLAGS</h4>
+Contains the default compiler flags.
+
+
+<h4><a name="TMAKE_FILETAGS"></a>TMAKE_FILETAGS</h4>
+Tells tmake which tags contain file names. This is because tmake
+on Windows replace the directory separator / with \.
+
+
+<hr>
+<h2>Function Reference</h2>
+This section contains a brief description of some important
+tmake functions used by the templates.
+
+
+<h3><a name="AddIncludePath"></a>AddIncludePath(path)</h3>
+Adds <em>path</em> to the include path variable,
+<a href="#INCLUDEPATH">INCLUDEPATH</a>. The include path is used
+for two purposes:<ol>
+<li>Searching files when generating include dependencies.
+<li>Setting -I options for the C/C++ compiler.
+</ol>
+<p>
+Example:<pre>
+ #$ AddIncludePath('$QTDIR/include;/local/include');
+</pre>
+
+
+<h3>BuildMocObj(objects,sources)</h3>
+Creates build rules for moc source files. Generates
+include dependencies.<p>
+Example:<pre>
+ #$ BuildMocObj($project{"OBJMOC"},$project{"SRCMOC"});
+</pre>Output:<pre>
+ moc_hello.o: moc_hello.cpp \
+ hello.h \
+ ...
+</pre>
+
+<h3>BuildMocSrc(files)</h3>
+Creates moc source files from C++ files containing classes that
+define signals and slots. For a header file <tt>x.h</tt>, the
+generated moc file is called <tt>moc_x.h</tt>. For a source file
+<tt>y.cpp</tt>, the generates moc file is called <tt>y.moc</tt> and
+should be #include'd by <tt>y.cpp</tt>.<p>
+Example:<pre>
+ #$ BuildMocSrc($project{"HEADERS"});
+ #$ BuildMocSrc($project{"SOURCES"});
+</pre>Output:<pre>
+ moc_hello.cpp: hello.h
+ $(MOC) hello.h -o moc_hello.cpp
+</pre>
+
+
+<h3>BuildObj(objects,sources)</h3>
+Creates build rules for source files. Generates
+include dependencies.<p>
+Example:<pre>
+ #$ BuildObj($project{"OBJECTS"},$project{"SOURCES"});
+</pre>Output:<pre>
+ hello.o: hello.cpp \
+ hello.h \
+ ...
+
+ main.o: main.cpp \
+ hello.h \
+ ...
+</pre>
+
+
+<h3>Config(string)</h3>
+Returns true if the <code>CONFIG</code> tag contains the given string.
+<p>Example:<pre>
+ #$ if ( Config("release") { }
+</pre>
+
+
+<h3>DisableOutput()</h3>
+Call this function to force tmake to generate no output until
+EnableOutput() is called.
+<p>Example:<pre>
+ #$ Config("debug") && DisableOutput();
+ Anything here is skipped if CONFIG contains "debug".
+ #$ Config("debug") && EnableOutput();
+</pre>
+
+
+<h3>EnableOutput()</h3>
+Enables tmake output after DisableOutput() was called.
+
+
+<h3>Expand(tag)</h3>
+Expands a project tag. Equivalent to <code>$text = $project{$tag}</code>.
+<p>Example:<pre>
+ VERSION = #$ Expand("VERSION");
+</pre>Output:<pre>
+ VERSION = 1.1
+</pre>
+
+<h3>ExpandGlue(tag,prepend,glue,append)</h3>
+Expands a $project{} tag, splits on whitespace
+and joins with $glue. $prepend is put at the start
+of the string and $append is put at the end of the
+string. The resulting string ($text) becomes "" if
+the project tag is empty or not defined.<p>
+Example:<pre>
+ clear:
+ #$ ExpandGlue("OBJECTS","-del","\n\t-del ","");
+</pre>Output (Windows NT):<pre>
+ clear:
+ -del hello.obj
+ -del main.obj
+</pre>
+
+
+<h3>ExpandList(tag)</h3>
+This function is suitable for expanding lists of files.
+Equivalent with <code>ExpandGlue($tag,""," \\\n\t\t","")</code>.<p>
+Example:<pre>
+ OBJECTS = #$ ExpandList("OBJECTS");
+</pre>Output:<pre>
+ OBJECTS = hello.o \
+ main.o
+</pre>
+
+
+<h3>IncludeTemplate(file)</h3>
+Includes a template file. The ".t" extension is optional.<p>
+Example:<pre>
+ #$ IncludeTemplate("mytemplate");
+</pre>
+
+
+<h3>Now()</h3>
+Sets $text to the current date and time.<p>
+Example:<pre>
+ # Generated at #$ Now()
+</pre>Output:<pre>
+ # Generated at 12:58, 1996/11/19
+</pre>
+
+
+<h3>Project(strings)</h3>
+This is a powerful function for setting and reading project
+variables. Returns the resulting project variables (joined with space
+between).
+<p>Examples:<pre>
+# Get a project variable:
+ $s = Project("TEMPLATE"); -> $s = "TEMPLATE"
+
+# Set a project variable:
+ Project("TEMPLATE = lib"); -> TEMPLATE = lib
+ Project("CONFIG =";) -> CONFIG empty
+
+# Append to a project variable:
+ Project("CONFIG = qt"); -> CONFIG = qt
+ Project("CONFIG += debug"); -> CONFIG = qt debug
+
+# Append to a project variable if it does not contain the value already:
+ Project("CONFIG = qt release"); -> CONFIG = qt release
+ Project("CONFIG *= qt"); -> CONFIG = qt release
+ Project("CONFIG *= opengl"); -> CONFIG = qt release opengl
+
+# Subtract from a project variable:
+ Project("THINGS = abc xyz"); -> THINGS = abc xyz
+ Project("THINGS -= abc"); -> THINGS = xyz
+
+# Search/replace on a project variable:
+ Project("CONFIG = tq opengl"); -> CONFIG = tq opengl
+ Project("CONFIG /= s/tq/qt/"); -> CONFIG = qt opengl
+
+# The operations can be performed on several project variables at a time.
+
+ Project("TEMPLATE = app", "CONFIG *= opengl", "THINGS += klm");
+</pre>
+
+
+<h3><a name="ScanProject"></a>ScanProject(file)</h3>
+Scans a project file and stores the project tags and values in the
+global associative <code>%project</code> array.
+
+
+<h3><a name="StdInit"></a>StdInit()</h3>
+Standard initialization of tmake. StdInit() should be
+called from one of the first lines in the template.<p>
+
+This function creates some new project tags:<ul>
+<li><code><a href="#OBJECTS">OBJECTS</a></code>
+ - Object files corresponding to
+ <code><a href="#SOURCES">SOURCES</a></code>.
+<li><code><a href="#SRCMOC">SRCMOC</a></code> - moc source files.
+<li><code><a href="#OBJMOC">OBJMOC</a></code> - moc object files.
+</ul>
+
+The moc-related tags are created only if <code>CONFIG</code> contains "qt"
+
+
+<h3>Substitute(string)</h3>
+This function takes a string and substitutes any occurrence of $$tag
+with the actual content of the tag. Returns the substituted string.
+Also sets $text.
+<p>
+Important: Use single quotes around the string, otherwise perl will expand
+any $tags it finds.
+<p>Example:<pre>
+ Substitute('Project name: $$PROJECT, uses template $$TEMPLATE');
+</pre>
diff --git a/tmake/example/hello.cpp b/tmake/example/hello.cpp
new file mode 100644
index 0000000..dc6ff77
--- /dev/null
+++ b/tmake/example/hello.cpp
@@ -0,0 +1,102 @@
+/****************************************************************************
+** $Id$
+**
+** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved.
+**
+** This file is part of an example program for Qt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include "hello.h"
+#include <qpushbutton.h>
+#include <qtimer.h>
+#include <qpainter.h>
+#include <qpixmap.h>
+
+
+/*
+ Constructs a Hello widget. Starts a 40 ms animation timer.
+*/
+
+Hello::Hello( const char *text, QWidget *parent, const char *name )
+ : QWidget(parent,name), t(text), b(0)
+{
+ QTimer *timer = new QTimer(this);
+ connect( timer, SIGNAL(timeout()), SLOT(animate()) );
+ timer->start( 40 );
+
+ resize( 200, 100 );
+}
+
+
+/*
+ This private slot is called each time the timer fires.
+*/
+
+void Hello::animate()
+{
+ b = (b + 1) & 15;
+ repaint( FALSE );
+}
+
+
+/*
+ Handles mouse button release events for the Hello widget.
+
+ We emit the clicked() signal when the mouse is released inside
+ the widget.
+*/
+
+void Hello::mouseReleaseEvent( QMouseEvent *e )
+{
+ if ( rect().contains( e->pos() ) )
+ emit clicked();
+}
+
+
+/*
+ Handles paint events for the Hello widget.
+
+ Flicker-free update. The text is first drawn in the pixmap and the
+ pixmap is then blt'ed to the screen.
+*/
+
+void Hello::paintEvent( QPaintEvent * )
+{
+ static int sin_tbl[16] = {
+ 0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38};
+
+ if ( t.isEmpty() )
+ return;
+
+ // 1: Compute some sizes, positions etc.
+ QFontMetrics fm = fontMetrics();
+ int w = fm.width(t) + 20;
+ int h = fm.height() * 2;
+ int pmx = width()/2 - w/2;
+ int pmy = height()/2 - h/2;
+
+ // 2: Create the pixmap and fill it with the widget's background
+ QPixmap pm( w, h );
+ pm.fill( this, pmx, pmy );
+
+ // 3: Paint the pixmap. Cool wave effect
+ QPainter p;
+ int x = 10;
+ int y = h/2 + fm.descent();
+ int i = 0;
+ p.begin( &pm );
+ p.setFont( font() );
+ while ( t[i] ) {
+ int i16 = (b+i) & 15;
+ p.setPen( QColor((15-i16)*16,255,255,QColor::Hsv) );
+ p.drawText( x, y-sin_tbl[i16]*h/800, &t[i], 1 );
+ x += fm.width( t[i] );
+ i++;
+ }
+ p.end();
+
+ // 4: Copy the pixmap to the Hello widget
+ bitBlt( this, pmx, pmy, &pm );
+}
diff --git a/tmake/example/hello.h b/tmake/example/hello.h
new file mode 100644
index 0000000..16e0871
--- /dev/null
+++ b/tmake/example/hello.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+** $Id$
+**
+** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved.
+**
+** This file is part of an example program for Qt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#ifndef HELLO_H
+#define HELLO_H
+
+#include <qwidget.h>
+
+
+class Hello : public QWidget
+{
+ Q_OBJECT
+public:
+ Hello( const char *text, QWidget *parent=0, const char *name=0 );
+signals:
+ void clicked();
+protected:
+ void mouseReleaseEvent( QMouseEvent * );
+ void paintEvent( QPaintEvent * );
+private slots:
+ void animate();
+private:
+ QString t;
+ int b;
+};
+
+#endif
diff --git a/tmake/example/hello.pro b/tmake/example/hello.pro
new file mode 100644
index 0000000..a299923
--- /dev/null
+++ b/tmake/example/hello.pro
@@ -0,0 +1,3 @@
+HEADERS = hello.h
+SOURCES = hello.cpp main.cpp
+TARGET = hello
diff --git a/tmake/example/main.cpp b/tmake/example/main.cpp
new file mode 100644
index 0000000..4b55a58
--- /dev/null
+++ b/tmake/example/main.cpp
@@ -0,0 +1,38 @@
+//
+// File: main.cpp
+//
+// A small Qt example application written by Troll Tech.
+//
+// It displays a text in a window and quits when you click
+// the mouse in the window.
+//
+
+#include "hello.h"
+#include <qapp.h>
+
+
+/*
+ The program starts here. It parses the command line and build a message
+ string to be displayed by the Hello widget.
+*/
+
+int main( int argc, char **argv )
+{
+ QApplication a(argc,argv);
+ QString s;
+ for ( int i=1; i<argc; i++ ) {
+ s += argv[i];
+ if ( i<argc-1 )
+ s += " ";
+ }
+ if ( s.isEmpty() )
+ s = "Hello, World";
+ Hello h( s );
+ h.setCaption( "Qt says hello" );
+ QObject::connect( &h, SIGNAL(clicked()), &a, SLOT(quit()) );
+ h.setFont( QFont("times",32,QFont::Bold) ); // default font
+ h.setBackgroundColor( white ); // default bg color
+ a.setMainWidget( &h );
+ h.show();
+ return a.exec();
+}
diff --git a/tmake/example/wc.t b/tmake/example/wc.t
new file mode 100644
index 0000000..dc041b5
--- /dev/null
+++ b/tmake/example/wc.t
@@ -0,0 +1,6 @@
+#! Template that count number of C++ lines
+The number of C++ code lines for #$ $text=$project_name;
+#${
+ $files = $project{"HEADERS"} . " " . $project{"SOURCES"};
+ $text = `wc -l $files`;
+#$}
diff --git a/tmake/lib/aix-g++/app.t b/tmake/lib/aix-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/aix-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/aix-g++/lib.t b/tmake/lib/aix-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/aix-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/aix-g++/subdirs.t b/tmake/lib/aix-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/aix-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/aix-g++/tmake.conf b/tmake/lib/aix-g++/tmake.conf
new file mode 100755
index 0000000..f2fe571
--- /dev/null
+++ b/tmake/lib/aix-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for aix-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB =
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB =
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB =
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/aix-xlc/app.t b/tmake/lib/aix-xlc/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/aix-xlc/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/aix-xlc/lib.t b/tmake/lib/aix-xlc/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/aix-xlc/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/aix-xlc/subdirs.t b/tmake/lib/aix-xlc/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/aix-xlc/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/aix-xlc/tmake.conf b/tmake/lib/aix-xlc/tmake.conf
new file mode 100755
index 0000000..401e390
--- /dev/null
+++ b/tmake/lib/aix-xlc/tmake.conf
@@ -0,0 +1,63 @@
+#
+# $Id$
+#
+# tmake configuration for aix-xlc
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = xlC
+TMAKE_CFLAGS = -+ -qstrict -D_BSD
+TMAKE_CFLAGS_WARN_ON =
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O3
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB =
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = xlC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = xlC
+TMAKE_LINK_SHLIB = ld
+TMAKE_LINK_SHLIB_CMD = /usr/lpp/xlC/bin/makeC++SharedLib -p 0 \
+ -o lib$(TARGET).so.$(VER_MAJ).$(VER_MIN) \
+ -lX11 -lXext $(OBJECTS) $(OBJMOC); \
+ ar q lib$(TARGET).a lib$(TARGET).so.$(VER_MAJ).$(VER_MIN); \
+ ranlib lib$(TARGET).a; \
+ mv lib$(TARGET).a $(DESTDIR)
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB =
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB = ranlib
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/dgux-g++/app.t b/tmake/lib/dgux-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/dgux-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/dgux-g++/lib.t b/tmake/lib/dgux-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/dgux-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/dgux-g++/subdirs.t b/tmake/lib/dgux-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/dgux-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/dgux-g++/tmake.conf b/tmake/lib/dgux-g++/tmake.conf
new file mode 100755
index 0000000..54e4ac3
--- /dev/null
+++ b/tmake/lib/dgux-g++/tmake.conf
@@ -0,0 +1,58 @@
+#
+# $Id$
+#
+# tmake configuration for linux-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+# "Frithjof.Brestrich" <brest@infp.fzk.de> suggests -h not -soname
+TMAKE_LFLAGS_SONAME = -Wl,-h,
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/freebsd-g++/app.t b/tmake/lib/freebsd-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/freebsd-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/freebsd-g++/lib.t b/tmake/lib/freebsd-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/freebsd-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/freebsd-g++/subdirs.t b/tmake/lib/freebsd-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/freebsd-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/freebsd-g++/tmake.conf b/tmake/lib/freebsd-g++/tmake.conf
new file mode 100755
index 0000000..d7dbb21
--- /dev/null
+++ b/tmake/lib/freebsd-g++/tmake.conf
@@ -0,0 +1,59 @@
+#
+# $Id$
+#
+# tmake configuration for freebsd-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS = -pipe
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+
+# soname does not work on fbsd 2.x
+#TMAKE_LFLAGS_SONAME = -Wl,-soname
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/gnu-g++/app.t b/tmake/lib/gnu-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/gnu-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/gnu-g++/lib.t b/tmake/lib/gnu-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/gnu-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/gnu-g++/subdirs.t b/tmake/lib/gnu-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/gnu-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/gnu-g++/tmake.conf b/tmake/lib/gnu-g++/tmake.conf
new file mode 100755
index 0000000..eed7c32
--- /dev/null
+++ b/tmake/lib/gnu-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for linux-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS = -Wl,-rpath=/lib:/usr/X11R6/lib:$(QTDIR)/lib
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME = -Wl,-soname,
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/hpux-acc/app.t b/tmake/lib/hpux-acc/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/hpux-acc/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/hpux-acc/lib.t b/tmake/lib/hpux-acc/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/hpux-acc/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/hpux-acc/subdirs.t b/tmake/lib/hpux-acc/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/hpux-acc/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/hpux-acc/tmake.conf b/tmake/lib/hpux-acc/tmake.conf
new file mode 100755
index 0000000..381fa97
--- /dev/null
+++ b/tmake/lib/hpux-acc/tmake.conf
@@ -0,0 +1,59 @@
+#
+# $Id$
+#
+# tmake configuration for hpux-acc
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = aCC
+TMAKE_CFLAGS = -w -D__STRICT_ANSI__
+TMAKE_CFLAGS_WARN_ON =
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = +Z
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = aCC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = aCC
+TMAKE_LINK_SHLIB = aCC
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -b
+TMAKE_LFLAGS_SONAME =
+TMAKE_HPUX_SHLIB = 1
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+TMAKE_LIBS_YACC = -ly
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/hpux-cc/app.t b/tmake/lib/hpux-cc/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/hpux-cc/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/hpux-cc/lib.t b/tmake/lib/hpux-cc/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/hpux-cc/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/hpux-cc/subdirs.t b/tmake/lib/hpux-cc/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/hpux-cc/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/hpux-cc/tmake.conf b/tmake/lib/hpux-cc/tmake.conf
new file mode 100755
index 0000000..851cb67
--- /dev/null
+++ b/tmake/lib/hpux-cc/tmake.conf
@@ -0,0 +1,58 @@
+#
+# $Id$
+#
+# tmake configuration for hpux-cc
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = cc
+TMAKE_CFLAGS = -w +a1
+TMAKE_CFLAGS_WARN_ON =
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = +Z
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = CC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = CC
+TMAKE_LINK_SHLIB = CC
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -b
+TMAKE_LFLAGS_SONAME =
+TMAKE_HPUX_SHLIB = 1
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/hpux-g++/app.t b/tmake/lib/hpux-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/hpux-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/hpux-g++/lib.t b/tmake/lib/hpux-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/hpux-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/hpux-g++/subdirs.t b/tmake/lib/hpux-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/hpux-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/hpux-g++/tmake.conf b/tmake/lib/hpux-g++/tmake.conf
new file mode 100755
index 0000000..f9b47d4
--- /dev/null
+++ b/tmake/lib/hpux-g++/tmake.conf
@@ -0,0 +1,59 @@
+#
+# $Id$
+#
+# tmake configuration for hpux-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -fPIC -shared
+TMAKE_LFLAGS_SONAME =
+TMAKE_HPUX_SHLIB = 1
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL =
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/irix-64/app.t b/tmake/lib/irix-64/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/irix-64/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/irix-64/lib.t b/tmake/lib/irix-64/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/irix-64/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/irix-64/subdirs.t b/tmake/lib/irix-64/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/irix-64/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/irix-64/tmake.conf b/tmake/lib/irix-64/tmake.conf
new file mode 100755
index 0000000..2d20f07
--- /dev/null
+++ b/tmake/lib/irix-64/tmake.conf
@@ -0,0 +1,59 @@
+#
+# $Id$
+#
+# tmake configuration for irix-64
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = CC
+TMAKE_CFLAGS = -64 LANG:bool=ON -woff 1209,1233,1314,1355,1375,1506
+TMAKE_CFLAGS_WARN_ON = -fullwarn
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -OPT:Olimit=3000
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB =
+TMAKE_CFLAGS_YACC = -woff 1110,1174,3262
+
+TMAKE_CXX = CC
+TMAKE_CXXFLAGS = -64 LANG:bool=ON -woff 1209,1233,1314,1355,1375,1506
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = CC
+TMAKE_LINK_SHLIB = CC
+TMAKE_LFLAGS = -64
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME = -Wl,-soname,
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB =
+
+TMAKE_CLEAN = so_locations
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/irix-dcc/app.t b/tmake/lib/irix-dcc/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/irix-dcc/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/irix-dcc/lib.t b/tmake/lib/irix-dcc/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/irix-dcc/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/irix-dcc/subdirs.t b/tmake/lib/irix-dcc/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/irix-dcc/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/irix-dcc/tmake.conf b/tmake/lib/irix-dcc/tmake.conf
new file mode 100755
index 0000000..5f69690
--- /dev/null
+++ b/tmake/lib/irix-dcc/tmake.conf
@@ -0,0 +1,59 @@
+#
+# $Id$
+#
+# tmake configuration for irix-dcc
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = DCC
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -fullwarn
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB =
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = DCC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = DCC
+TMAKE_LINK_SHLIB = DCC
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME = -Wl,-soname,
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB =
+
+TMAKE_CLEAN = so_locations
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/irix-g++/app.t b/tmake/lib/irix-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/irix-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/irix-g++/lib.t b/tmake/lib/irix-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/irix-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/irix-g++/subdirs.t b/tmake/lib/irix-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/irix-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/irix-g++/tmake.conf b/tmake/lib/irix-g++/tmake.conf
new file mode 100755
index 0000000..f6fea61
--- /dev/null
+++ b/tmake/lib/irix-g++/tmake.conf
@@ -0,0 +1,59 @@
+#
+# $Id$
+#
+# tmake configuration for irix-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME = -Wl,-soname,
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB = ranlib
+
+TMAKE_CLEAN = so_locations
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/irix-n32/app.t b/tmake/lib/irix-n32/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/irix-n32/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/irix-n32/lib.t b/tmake/lib/irix-n32/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/irix-n32/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/irix-n32/subdirs.t b/tmake/lib/irix-n32/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/irix-n32/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/irix-n32/tmake.conf b/tmake/lib/irix-n32/tmake.conf
new file mode 100755
index 0000000..52a6a38
--- /dev/null
+++ b/tmake/lib/irix-n32/tmake.conf
@@ -0,0 +1,59 @@
+#
+# $Id$
+#
+# tmake configuration for irix-n32
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = CC
+TMAKE_CFLAGS = -n32 LANG:bool=ON -woff 1209,1233,1314,1355,1375,1506
+TMAKE_CFLAGS_WARN_ON = -fullwarn
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -OPT:Olimit=3000
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB =
+TMAKE_CFLAGS_YACC = -woff 1110,1174,3262
+
+TMAKE_CXX = CC
+TMAKE_CXXFLAGS = -n32 LANG:bool=ON -woff 1209,1233,1314,1355,1375,1506
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = CC
+TMAKE_LINK_SHLIB = CC
+TMAKE_LFLAGS = -n32
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME = -Wl,-soname,
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB =
+
+TMAKE_CLEAN = so_locations
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/linux-g++/app.t b/tmake/lib/linux-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/linux-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/linux-g++/lib.t b/tmake/lib/linux-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/linux-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/linux-g++/subdirs.t b/tmake/lib/linux-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/linux-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/linux-g++/tmake.conf b/tmake/lib/linux-g++/tmake.conf
new file mode 100755
index 0000000..01b0d82
--- /dev/null
+++ b/tmake/lib/linux-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for linux-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS = -pipe
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME = -Wl,-soname,
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/netbsd-g++/app.t b/tmake/lib/netbsd-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/netbsd-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/netbsd-g++/lib.t b/tmake/lib/netbsd-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/netbsd-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/netbsd-g++/subdirs.t b/tmake/lib/netbsd-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/netbsd-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/netbsd-g++/tmake.conf b/tmake/lib/netbsd-g++/tmake.conf
new file mode 100755
index 0000000..53bbadc
--- /dev/null
+++ b/tmake/lib/netbsd-g++/tmake.conf
@@ -0,0 +1,60 @@
+#
+# $Id$
+#
+# tmake configuration for netbsd-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = ld
+TMAKE_LINK_SHLIB_CMD = $(SYSCONF_LINK_SHLIB) -Bshareable $(LFLAGS) -o $(DESTDIR)$(SYSCONF_LINK_TARGET_SHARED) \
+ `lorder /usr/lib/c++rt0.o $(OBJECTS) $(OBJMOC) | \
+ tsort` $(LIBS)
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -Bshareable
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/openbsd-g++/app.t b/tmake/lib/openbsd-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/openbsd-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/openbsd-g++/lib.t b/tmake/lib/openbsd-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/openbsd-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/openbsd-g++/subdirs.t b/tmake/lib/openbsd-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/openbsd-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/openbsd-g++/tmake.conf b/tmake/lib/openbsd-g++/tmake.conf
new file mode 100755
index 0000000..e45b6d7
--- /dev/null
+++ b/tmake/lib/openbsd-g++/tmake.conf
@@ -0,0 +1,60 @@
+#
+# $Id$
+#
+# tmake configuration for netbsd-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = ld
+TMAKE_LINK_SHLIB_CMD = $(SYSCONF_LINK_SHLIB) -Bshareable $(LFLAGS) -o $(DESTDIR)$(SYSCONF_LINK_TARGET_SHARED) \
+ `lorder /usr/lib/c++rt0.o $(OBJECTS) $(OBJMOC) | \
+ tsort` $(LIBS)
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -Bshareable
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar q
+TMAKE_RANLIB = ranlib
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/osf1-cxx/app.t b/tmake/lib/osf1-cxx/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/osf1-cxx/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/osf1-cxx/lib.t b/tmake/lib/osf1-cxx/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/osf1-cxx/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/osf1-cxx/subdirs.t b/tmake/lib/osf1-cxx/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/osf1-cxx/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/osf1-cxx/tmake.conf b/tmake/lib/osf1-cxx/tmake.conf
new file mode 100755
index 0000000..7e4200e
--- /dev/null
+++ b/tmake/lib/osf1-cxx/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for osf1-cxx (a.k.a. DEC Unix)
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = cxx
+TMAKE_CFLAGS = -x cxx -w -D_POSIX_SOURCE -D_OSF_SOURCE -D_AES_SOURCE
+TMAKE_CFLAGS_WARN_ON =
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB =
+TMAKE_CFLAGS_YACC = -Olimit 1000
+
+TMAKE_CXX = cxx
+TMAKE_CXXFLAGS = -x cxx -w -D_POSIX_SOURCE -D_OSF_SOURCE -D_AES_SOURCE
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = cxx
+TMAKE_LINK_SHLIB = cxx
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/osf1-g++/app.t b/tmake/lib/osf1-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/osf1-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/osf1-g++/lib.t b/tmake/lib/osf1-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/osf1-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/osf1-g++/subdirs.t b/tmake/lib/osf1-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/osf1-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/osf1-g++/tmake.conf b/tmake/lib/osf1-g++/tmake.conf
new file mode 100755
index 0000000..54aa2c1
--- /dev/null
+++ b/tmake/lib/osf1-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for osf1-g++ (a.k.a. DEC Unix)
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS = -D_POSIX_SOURCE -D_OSF_SOURCE -D_AES_SOURCE
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME = -Wl,-soname,
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/qnx-g++/app.t b/tmake/lib/qnx-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/qnx-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/qnx-g++/lib.t b/tmake/lib/qnx-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/qnx-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/qnx-g++/subdirs.t b/tmake/lib/qnx-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/qnx-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/qnx-g++/tmake.conf b/tmake/lib/qnx-g++/tmake.conf
new file mode 100755
index 0000000..0bb70ae
--- /dev/null
+++ b/tmake/lib/qnx-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for qnx-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS = -pipe
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O -fno-inline -fno-pack-struct
+TMAKE_CFLAGS_DEBUG = -g -fno-inline -fno-pack-struct
+TMAKE_CFLAGS_SHLIB =
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses -fno-inline -fno-pack-struct
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB =
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS = -lunix
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/sco-g++/app.t b/tmake/lib/sco-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/sco-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/sco-g++/lib.t b/tmake/lib/sco-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/sco-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/sco-g++/subdirs.t b/tmake/lib/sco-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/sco-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/sco-g++/tmake.conf b/tmake/lib/sco-g++/tmake.conf
new file mode 100755
index 0000000..8ee470c
--- /dev/null
+++ b/tmake/lib/sco-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for sco-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext -lsocket
+TMAKE_LIBS_QT = -lqt -lsocket
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB = ranlib
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/solaris-cc/app.t b/tmake/lib/solaris-cc/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/solaris-cc/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/solaris-cc/lib.t b/tmake/lib/solaris-cc/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/solaris-cc/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/solaris-cc/subdirs.t b/tmake/lib/solaris-cc/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/solaris-cc/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/solaris-cc/tmake.conf b/tmake/lib/solaris-cc/tmake.conf
new file mode 100755
index 0000000..dd8801b
--- /dev/null
+++ b/tmake/lib/solaris-cc/tmake.conf
@@ -0,0 +1,60 @@
+#
+# $Id$
+#
+# tmake configuration for solaris-cc
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = cc
+TMAKE_CFLAGS = -pto
+TMAKE_CFLAGS_WARN_ON =
+TMAKE_CFLAGS_WARN_OFF = -w
+TMAKE_CFLAGS_RELEASE = -O2
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -PIC
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = CC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/openwin/include
+TMAKE_LIBDIR_X11 = /usr/openwin/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = CC
+# Jan Wortelboer <janw@wins.uva.nl> suggests avoiding $LD_LIBRARY_PATH:
+TMAKE_LINK_SHLIB = CC -R$(QTDIR)/lib:/usr/openwin/lib
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -G
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = CC -xar -o
+TMAKE_RANLIB =
+
+TMAKE_CLEAN = -r Templates.DB
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/solaris-g++/app.t b/tmake/lib/solaris-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/solaris-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/solaris-g++/lib.t b/tmake/lib/solaris-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/solaris-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/solaris-g++/subdirs.t b/tmake/lib/solaris-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/solaris-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/solaris-g++/tmake.conf b/tmake/lib/solaris-g++/tmake.conf
new file mode 100755
index 0000000..c23c9b4
--- /dev/null
+++ b/tmake/lib/solaris-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for solaris-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/openwin/include
+TMAKE_LIBDIR_X11 = /usr/openwin/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -B dynamic -h lib$(TARGET).so.$(VER_MAJ) -shared
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/sunos-g++/app.t b/tmake/lib/sunos-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/sunos-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/sunos-g++/lib.t b/tmake/lib/sunos-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/sunos-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/sunos-g++/subdirs.t b/tmake/lib/sunos-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/sunos-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/sunos-g++/tmake.conf b/tmake/lib/sunos-g++/tmake.conf
new file mode 100755
index 0000000..43115f8
--- /dev/null
+++ b/tmake/lib/sunos-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for sunos-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/openwin/include
+TMAKE_LIBDIR_X11 = /usr/openwin/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -fPIC -shared
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lGL -lGLU -lXmu
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB = ranlib
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/ultrix-g++/app.t b/tmake/lib/ultrix-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/ultrix-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/ultrix-g++/lib.t b/tmake/lib/ultrix-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/ultrix-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/ultrix-g++/subdirs.t b/tmake/lib/ultrix-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/ultrix-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/ultrix-g++/tmake.conf b/tmake/lib/ultrix-g++/tmake.conf
new file mode 100755
index 0000000..59147d7
--- /dev/null
+++ b/tmake/lib/ultrix-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for ultrix-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB =
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 = /usr/X11R6/include
+TMAKE_LIBDIR_X11 = /usr/X11R6/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL = /usr/X11R6/include
+TMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
+
+TMAKE_LINK = g++
+#TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+#TMAKE_LFLAGS_SHLIB = -shared
+#TMAKE_LFLAGS_SONAME = -Wl,-soname,
+
+TMAKE_LIBS =
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/unix/app.t b/tmake/lib/unix/app.t
new file mode 100755
index 0000000..f59c9f9
--- /dev/null
+++ b/tmake/lib/unix/app.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Unix applications.
+#!
+#$ Project('TMAKE_APP_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/unix/generic.t b/tmake/lib/unix/generic.t
new file mode 100755
index 0000000..d9dc6ea
--- /dev/null
+++ b/tmake/lib/unix/generic.t
@@ -0,0 +1,268 @@
+#!
+#! This is a tmake template for building UNIX applications or libraries.
+#!
+#${
+ if ( Project("TMAKE_LIB_FLAG") && !Config("staticlib") ) {
+ Project('CONFIG *= dll');
+ } elsif ( Project("TMAKE_APP_FLAG") || Config("dll") ) {
+ Project('CONFIG -= staticlib');
+ }
+ if ( Config("warn_off") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_OFF');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_WARN_OFF');
+ } elsif ( Config("warn_on") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_ON');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_WARN_ON');
+ }
+ if ( Config("debug") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_DEBUG');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_DEBUG');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_DEBUG');
+ } elsif ( Config("release") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_RELEASE');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_RELEASE');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_RELEASE');
+ }
+ if ( Config("qt") || Config("opengl") ) {
+ Project('CONFIG *= x11lib');
+ if ( Config("opengl") ) {
+ Project('CONFIG *= x11inc');
+ }
+ }
+ if ( Config("x11") ) {
+ Project('CONFIG *= x11lib');
+ Project('CONFIG *= x11inc');
+ }
+ if ( Config("qt") ) {
+ $moc_aware = 1;
+ AddIncludePath(Project("TMAKE_INCDIR_QT"));
+ if ( Config("opengl") ) {
+ Project("TMAKE_LIBDIR_QT") &&
+ Project('TMAKE_LIBS *= -L$$TMAKE_LIBDIR_QT');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
+ }
+ if ( !((Project("TARGET") eq "qt") && Project("TMAKE_LIB_FLAG")) ) {
+ Project("TMAKE_LIBDIR_QT") &&
+ Project('TMAKE_LIBS *= -L$$TMAKE_LIBDIR_QT');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
+ }
+ }
+ if ( Config("opengl") ) {
+ AddIncludePath(Project("TMAKE_INCDIR_OPENGL"));
+ Project("TMAKE_LIBDIR_OPENGL") &&
+ Project('TMAKE_LIBS *= -L$$TMAKE_LIBDIR_OPENGL');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
+ }
+ if ( Config("x11inc") ) {
+ AddIncludePath(Project("TMAKE_INCDIR_X11"));
+ }
+ if ( Config("x11lib") ) {
+ Project("TMAKE_LIBDIR_X11") &&
+ Project('TMAKE_LIBS *= -L$$TMAKE_LIBDIR_X11');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_X11');
+ }
+ Project('TMAKE_LIBS += $$LIBS');
+ if ( !Project("TMAKE_RUN_CC") ) {
+ Project('TMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src');
+ }
+ if ( !Project("TMAKE_RUN_CC_IMP") ) {
+ Project('TMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<');
+ }
+ if ( !Project("TMAKE_RUN_CXX") ) {
+ Project('TMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src');
+ }
+ if ( !Project("TMAKE_RUN_CXX_IMP") ) {
+ Project('TMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<');
+ }
+ Project('TMAKE_FILETAGS = HEADERS SOURCES TARGET DESTDIR $$FILETAGS');
+ StdInit();
+ $project{"DESTDIR"} = FixPath($project{"DESTDIR"});
+ $project{"VERSION"} || ($project{"VERSION"} = "1.0");
+ $project{"VER_MAJ"} = $project{"VERSION"};
+ $project{"VER_MAJ"} =~ s/\.\d+$//;
+ $project{"VER_MIN"} = $project{"VERSION"};
+ $project{"VER_MIN"} =~ s/^\d+\.//;
+ Project('DESTDIR_TARGET = $(TARGET)');
+ if ( Project("TMAKE_APP_FLAG") ) {
+ if ( Config("dll") ) {
+ Project('TARGET = $$TARGET.so');
+ Project("TMAKE_LFLAGS_SONAME") &&
+ ($project{"TMAKE_LFLAGS_SONAME"} .= $project{"TARGET"});
+ }
+ $project{"TARGET"} = $project{"DESTDIR"} . $project{"TARGET"};
+ } elsif ( Config("staticlib") ) {
+ $project{"TARGET"} = $project{"DESTDIR"} . "lib" .
+ $project{"TARGET"} . ".a";
+ Project("TMAKE_AR_CMD") ||
+ Project('TMAKE_AR_CMD = $(AR) $(TARGET) $(OBJECTS) $(OBJMOC)');
+ } else {
+ $project{"TARGETA"} = $project{"DESTDIR"} . "lib" .
+ $project{"TARGET"} . ".a";
+ if ( Project("TMAKE_AR_CMD") ) {
+ $project{"TMAKE_AR_CMD"} =~ s/\(TARGET\)/\(TARGETA\)/g;
+ } else {
+ Project('TMAKE_AR_CMD = $(AR) $(TARGETA) $(OBJECTS) $(OBJMOC)');
+ }
+ if ( $project{"TMAKE_HPUX_SHLIB"} ) {
+ $project{"TARGET_x.y"} = "lib" . $project{"TARGET"} . ".sl";
+ } else {
+ $project{"TARGET_"} = "lib" . $project{"TARGET"} . ".so";
+ $project{"TARGET_x"} = $project{"TARGET_"} . "." .
+ $project{"VER_MAJ"};
+ $project{"TARGET_x.y"} = $project{"TARGET_"} . "." .
+ $project{"VERSION"};
+ $project{"TMAKE_LN_SHLIB"} = "-ln -s";
+ }
+ $project{"TARGET"} = $project{"TARGET_x.y"};
+ if ( $project{"DESTDIR"} ) {
+ $project{"DESTDIR_TARGET"} = $project{"DESTDIR"} .
+ $project{"TARGET"};
+ }
+ Project("TMAKE_LFLAGS_SONAME") &&
+ ($project{"TMAKE_LFLAGS_SONAME"} .= $project{"TARGET_x"});
+ $project{"TMAKE_LINK_SHLIB_CMD"} ||
+ ($project{"TMAKE_LINK_SHLIB_CMD"} =
+ '$(LINK) $(LFLAGS) -o $(TARGETD) $(OBJECTS) $(OBJMOC) $(LIBS)');
+ }
+ if ( Config("dll") ) {
+ Project('TMAKE_CFLAGS *= $$TMAKE_CFLAGS_SHLIB' );
+ Project('TMAKE_CXXFLAGS *= $$TMAKE_CXXFLAGS_SHLIB' );
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_SHLIB $$TMAKE_LFLAGS_SONAME');
+ }
+#$}
+#!
+# Makefile for building #$ Expand("TARGET")
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = #$ Expand("TMAKE_CC");
+CXX = #$ Expand("TMAKE_CXX");
+CFLAGS = #$ Expand("TMAKE_CFLAGS"); ExpandGlue("DEFINES","-D"," -D","");
+CXXFLAGS= #$ Expand("TMAKE_CXXFLAGS"); ExpandGlue("DEFINES","-D"," -D","");
+INCPATH = #$ ExpandGlue("INCPATH","-I"," -I","");
+#$ Config("staticlib") && DisableOutput();
+LINK = #$ Expand("TMAKE_LINK");
+LFLAGS = #$ Expand("TMAKE_LFLAGS");
+LIBS = #$ Expand("TMAKE_LIBS");
+#$ Config("staticlib") && EnableOutput();
+#$ Project("TMAKE_LIB_FLAG") || DisableOutput();
+AR = #$ Expand("TMAKE_AR");
+RANLIB = #$ Expand("TMAKE_RANLIB");
+#$ Project("TMAKE_LIB_FLAG") || EnableOutput();
+MOC = #$ Expand("TMAKE_MOC");
+
+TAR = #$ Expand("TMAKE_TAR");
+GZIP = #$ Expand("TMAKE_GZIP");
+
+####### Files
+
+HEADERS = #$ ExpandList("HEADERS");
+SOURCES = #$ ExpandList("SOURCES");
+OBJECTS = #$ ExpandList("OBJECTS");
+SRCMOC = #$ ExpandList("SRCMOC");
+OBJMOC = #$ ExpandList("OBJMOC");
+DIST = #$ ExpandList("DISTFILES");
+TARGET = #$ Expand("TARGET");
+#$ (Project("TMAKE_APP_FLAG") || Config("staticlib")) && DisableOutput();
+TARGETA = #$ Expand("TARGETA");
+TARGETD = #$ Expand("TARGET_x.y");
+TARGET0 = #$ Expand("TARGET_");
+TARGET1 = #$ Expand("TARGET_x");
+#$ (Project("TMAKE_APP_FLAG") || Config("staticlib")) && EnableOutput();
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .C .c
+
+.cpp.o:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.cxx.o:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.cc.o:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.C.o:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.c.o:
+ #$ Expand("TMAKE_RUN_CC_IMP");
+
+####### Build rules
+
+#$ Project("TMAKE_APP_FLAG") || DisableOutput();
+all: #$ ExpandGlue("ALL_DEPS",""," "," "); $text .= '$(TARGET)';
+
+$(TARGET): $(OBJECTS) $(OBJMOC) #$ Expand("TARGETDEPS");
+ $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
+#$ Project("TMAKE_APP_FLAG") || EnableOutput();
+#$ (Config("staticlib") || Project("TMAKE_APP_FLAG")) && DisableOutput();
+all: #$ ExpandGlue("ALL_DEPS",""," ",""); Expand("DESTDIR_TARGET");
+
+#$ Substitute('$$DESTDIR_TARGET: $(OBJECTS) $(OBJMOC) $$TARGETDEPS');
+ -rm -f $(TARGET) $(TARGET0) $(TARGET1)
+ #$ Expand("TMAKE_LINK_SHLIB_CMD");
+ #$ ExpandGlue("TMAKE_LN_SHLIB",""," "," \$(TARGET) \$(TARGET0)");
+ #$ ExpandGlue("TMAKE_LN_SHLIB",""," "," \$(TARGET) \$(TARGET1)");
+ #${
+ $d = Project("DESTDIR");
+ if ( $d ) {
+ $d =~ s-([^/])$-$1/-;
+ if ( Project("TMAKE_HPUX_SHLIB") ) {
+ $text = "-rm -f $d\$(TARGET)\n\t" .
+ "-mv \$(TARGET) $d";
+ } else {
+ $text = "-rm -f $d\$(TARGET)\n\t" .
+ "-rm -f $d\$(TARGET0)\n\t" .
+ "-rm -f $d\$(TARGET1)\n\t" .
+ "-mv \$(TARGET) \$(TARGET0) \$(TARGET1) $d";
+ }
+ }
+ #$}
+
+staticlib: $(TARGETA)
+
+$(TARGETA): $(OBJECTS) $(OBJMOC) #$ Expand("TARGETDEPS");
+ -rm -f $(TARGETA)
+ #$ Expand("TMAKE_AR_CMD");
+ #$ ExpandGlue("TMAKE_RANLIB","",""," \$(TARGETA)");
+#$ (Config("staticlib") || Project("TMAKE_APP_FLAG")) && EnableOutput();
+#$ Config("staticlib") || DisableOutput();
+all: #$ ExpandGlue("ALL_DEPS",""," "," "); $text .= '$(TARGET)';
+
+staticlib: $(TARGET)
+
+$(TARGET): $(OBJECTS) $(OBJMOC) #$ Expand("TARGETDEPS");
+ -rm -f $(TARGET)
+ #$ Expand("TMAKE_AR_CMD");
+ #$ ExpandGlue("TMAKE_RANLIB","",""," \$(TARGET)");
+#$ Config("staticlib") || EnableOutput();
+
+moc: $(SRCMOC)
+
+#$ TmakeSelf();
+
+dist:
+ #$ Substitute('$(TAR) $$PROJECT.tar $$PROJECT.pro $(SOURCES) $(HEADERS) $(DIST)');
+ #$ Substitute('$(GZIP) $$PROJECT.tar');
+
+clean:
+ -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(TARGET)
+#$ (Config("staticlib") || Project("TMAKE_APP_FLAG")) && DisableOutput();
+ -rm -f $(TARGET0) $(TARGET1) $(TARGETA)
+#$ (Config("staticlib") || Project("TMAKE_APP_FLAG")) && EnableOutput();
+ #$ ExpandGlue("TMAKE_CLEAN","-rm -f "," ","");
+ -rm -f *~ core
+ #$ ExpandGlue("CLEAN_FILES","-rm -f "," ","");
+
+####### Compile
+
+#$ BuildObj(Project("OBJECTS"),Project("SOURCES"));
+#$ BuildMocObj(Project("OBJMOC"),Project("SRCMOC"));
+#$ BuildMocSrc(Project("HEADERS"));
+#$ BuildMocSrc(Project("SOURCES"));
diff --git a/tmake/lib/unix/lib.t b/tmake/lib/unix/lib.t
new file mode 100755
index 0000000..dd24c63
--- /dev/null
+++ b/tmake/lib/unix/lib.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Unix libraries.
+#!
+#$ Project('TMAKE_LIB_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/unix/subdirs.t b/tmake/lib/unix/subdirs.t
new file mode 100755
index 0000000..8f20097
--- /dev/null
+++ b/tmake/lib/unix/subdirs.t
@@ -0,0 +1,36 @@
+#############################################################################
+#!
+#! This is a tmake template for creating a makefile that invokes make in
+#! sub directories - for Unix.
+#!
+#${
+ StdInit();
+ Project('MAKEFILE') || Project('MAKEFILE = Makefile');
+ Project('TMAKE') || Project('TMAKE = tmake');
+#$}
+#!
+# Makefile for building targets in sub directories.
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+MAKEFILE= #$ Expand("MAKEFILE");
+TMAKE = #$ Expand("TMAKE");
+
+SUBDIRS = #$ ExpandList("SUBDIRS");
+
+all: $(SUBDIRS)
+
+$(SUBDIRS): FORCE
+ cd $@; $(MAKE)
+
+tmake:
+#${
+ $text = "\t" . 'for i in $(SUBDIRS); do ( cd $$i ; $(TMAKE) $$i.pro -o $(MAKEFILE); grep "TEMPLATE.*subdirs" $$i.pro 2>/dev/null >/dev/null && $(MAKE) -f $(MAKEFILE) tmake ) ; done';
+#$}
+
+clean:
+ for i in $(SUBDIRS); do ( cd $$i ; $(MAKE) clean ) ; done
+
+FORCE:
diff --git a/tmake/lib/unixware-g++/app.t b/tmake/lib/unixware-g++/app.t
new file mode 100755
index 0000000..867725e
--- /dev/null
+++ b/tmake/lib/unixware-g++/app.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/app.t");
diff --git a/tmake/lib/unixware-g++/lib.t b/tmake/lib/unixware-g++/lib.t
new file mode 100755
index 0000000..2523b2f
--- /dev/null
+++ b/tmake/lib/unixware-g++/lib.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/lib.t");
diff --git a/tmake/lib/unixware-g++/subdirs.t b/tmake/lib/unixware-g++/subdirs.t
new file mode 100755
index 0000000..5e888af
--- /dev/null
+++ b/tmake/lib/unixware-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Unix template
+#$ IncludeTemplate("../unix/subdirs.t");
diff --git a/tmake/lib/unixware-g++/tmake.conf b/tmake/lib/unixware-g++/tmake.conf
new file mode 100755
index 0000000..24300a9
--- /dev/null
+++ b/tmake/lib/unixware-g++/tmake.conf
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+# tmake configuration for sco-g++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = gcc
+TMAKE_CFLAGS = -D_UNIXWARE
+TMAKE_CFLAGS_WARN_ON = -Wall -W
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O2 -fno-strength-reduce
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_SHLIB = -fPIC
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = g++
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_SHLIB = $$TMAKE_CFLAGS_SHLIB
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_LIBDIR =
+TMAKE_INCDIR_X11 =
+TMAKE_LIBDIR_X11 = /usr/X/lib
+TMAKE_INCDIR_QT = $(QTDIR)/include
+TMAKE_LIBDIR_QT = $(QTDIR)/lib
+TMAKE_INCDIR_OPENGL =
+TMAKE_LIBDIR_OPENGL =
+
+TMAKE_LINK = g++
+TMAKE_LINK_SHLIB = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_SHLIB = -shared
+TMAKE_LFLAGS_SONAME =
+
+TMAKE_LIBS = -lsocket -lnsl -lc
+TMAKE_LIBS_X11 = -lX11 -lXext
+TMAKE_LIBS_QT = -lqt
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lMesaGL -lMesaGLU -lXmu -lXt -lXext -lm
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cq
+TMAKE_RANLIB =
+
+TMAKE_TAR = tar -cf
+TMAKE_GZIP = gzip -9f
diff --git a/tmake/lib/win32-borland/app.t b/tmake/lib/win32-borland/app.t
new file mode 100755
index 0000000..fc4dc2c
--- /dev/null
+++ b/tmake/lib/win32-borland/app.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 applications.
+#!
+#$ Project('TMAKE_APP_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-borland/generic.t b/tmake/lib/win32-borland/generic.t
new file mode 100755
index 0000000..88190d8
--- /dev/null
+++ b/tmake/lib/win32-borland/generic.t
@@ -0,0 +1,229 @@
+#!
+#! This is a tmake template for building Win32 applications or libraries.
+#!
+#${
+ if ( Config("qt") ) {
+ if ( !(Project("DEFINES") =~ /QT_NODLL/) &&
+ ((Project("DEFINES") =~ /QT_(?:MAKE)?DLL/) ||
+ ($ENV{"QT_DLL"} && !$ENV{"QT_NODLL"})) ) {
+ Project('TMAKE_QT_DLL = 1');
+ if ( (Project("TARGET") eq "qt") && Project("TMAKE_LIB_FLAG") ) {
+ Project('CONFIG += dll');
+ }
+ }
+ }
+ if ( Config("dll") || Project("TMAKE_APP_FLAG") ) {
+ Project('CONFIG -= staticlib');
+ Project('TMAKE_APP_OR_DLL = 1');
+ } else {
+ Project('CONFIG += staticlib');
+ }
+ if ( Config("warn_off") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_OFF');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_WARN_OFF');
+ } elsif ( Config("warn_on") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_ON');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_WARN_ON');
+ }
+ if ( Config("debug") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_DEBUG');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_DEBUG');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_DEBUG');
+ } elsif ( Config("release") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_RELEASE');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_RELEASE');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_RELEASE');
+ }
+ if ( Config("qt") || Config("opengl") ) {
+ Project('CONFIG += windows' );
+ }
+ if ( Config("qt") ) {
+ $moc_aware = 1;
+ AddIncludePath(Project("TMAKE_INCDIR_QT"));
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
+ }
+ if ( (Project("TARGET") eq "qt") && Project("TMAKE_LIB_FLAG") ) {
+ if ( Project("TMAKE_QT_DLL") ) {
+ Project('DEFINES -= QT_DLL');
+ Project('DEFINES *= QT_MAKEDLL');
+ }
+ } else {
+ if ( Project("TMAKE_QT_DLL") ) {
+ Project('DEFINES *= QT_DLL');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
+ if ( Project("TMAKE_QT_DLL") ) {
+ my $qtver =FindHighestLibVersion($ENV{"QTDIR"} . "/lib", "qt");
+ Project("TMAKE_LIBS /= s/qt.lib/qt${qtver}.lib/");
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_DLL');
+ }
+ }
+ }
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
+ }
+ if ( Config("dll") ) {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE_DLL');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS_DLL');
+ if ( Project("TMAKE_LIB_FLAG") ) {
+ my $ver = Project("VERSION");
+ $ver =~ s/\.//g;
+ $project{"TARGET_EXT"} = "${ver}.dll";
+ } else {
+ $project{"TARGET_EXT"} = ".dll";
+ }
+ } else {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS');
+ if ( Project("TMAKE_APP_FLAG") ) {
+ $project{"TARGET_EXT"} = ".exe";
+ } else {
+ $project{"TARGET_EXT"} = ".lib";
+ }
+ }
+ if ( Config("windows") ) {
+ if ( Config("console") ) {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_WINDOWS_ANY');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_WINDOWS');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ }
+ Project('TMAKE_LIBS += $$LIBS');
+ Project('TMAKE_FILETAGS = HEADERS SOURCES DEF_FILE RC_FILE TARGET TMAKE_LIBS DESTDIR DLLDESTDIR $$FILETAGS');
+ foreach ( split(/\s/,Project("TMAKE_FILETAGS")) ) {
+ $project{$_} =~ s-[/\\]+-\\-g;
+ }
+ if ( Project("DEF_FILE") ) {
+ Project('TMAKE_LFLAGS *= /DEF:$$DEF_FILE');
+ }
+ if ( Project("RC_FILE") ) {
+ if ( Project("RES_FILE") ) {
+ tmake_error("Both .rc and .res file specified.\n" .
+ "Please specify one of them, not both.");
+ }
+ $project{"RES_FILE"} = $project{"RC_FILE"};
+ $project{"RES_FILE"} =~ s/\.rc$/.res/i;
+ Project('TARGETDEPS += $$RES_FILE');
+ }
+ if ( Project("RES_FILE") ) {
+ Project('TMAKE_LIBS *= $$RES_FILE');
+ }
+ StdInit();
+ $project{"DESTDIR"} = FixPath($project{"DESTDIR"});
+ if ( Project("VERSION") ) {
+ $project{"VER_MAJ"} = $project{"VERSION"};
+ $project{"VER_MAJ"} =~ s/\.\d+$//;
+ $project{"VER_MIN"} = $project{"VERSION"};
+ $project{"VER_MIN"} =~ s/^\d+\.//;
+ }
+ Project('TMAKE_CLEAN += $$TARGET.tds');
+#$}
+#!
+# Makefile for building #$ Expand("TARGET")
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+!if !$d(BCB)
+BCB = $(MAKEDIR)\..
+!endif
+
+####### Compiler, tools and options
+
+CC = #$ Expand("TMAKE_CC");
+CXX = #$ Expand("TMAKE_CXX");
+CFLAGS = #$ Expand("TMAKE_CFLAGS"); ExpandGlue("DEFINES","-D"," -D","");
+CXXFLAGS= #$ Expand("TMAKE_CXXFLAGS"); ExpandGlue("DEFINES","-D"," -D","");
+INCPATH = #$ ExpandGlue("INCPATH",'-I"','" -I"','"');
+#$ !Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LINK = #$ Expand("TMAKE_LINK");
+LFLAGS = #$ Expand("TMAKE_LFLAGS");
+LIBS = #$ Expand("TMAKE_LIBS");
+#$ !Project("TMAKE_APP_OR_DLL") && EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LIB = #$ Expand("TMAKE_LIB");
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+MOC = #$ Expand("TMAKE_MOC");
+
+ZIP = #$ Expand("TMAKE_ZIP");
+
+####### Files
+
+HEADERS = #$ ExpandList("HEADERS");
+SOURCES = #$ ExpandList("SOURCES");
+OBJECTS = #$ ExpandList("OBJECTS");
+SRCMOC = #$ ExpandList("SRCMOC");
+OBJMOC = #$ ExpandList("OBJMOC");
+DIST = #$ ExpandList("DISTFILES");
+TARGET = #$ ExpandGlue("TARGET",$project{"DESTDIR"},"",$project{"TARGET_EXT"});
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .c
+
+.cpp.obj:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.cxx.obj:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.cc.obj:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.c.obj:
+ #$ Expand("TMAKE_RUN_CC_IMP");
+
+####### Build rules
+
+all: #$ ExpandGlue("ALL_DEPS",""," "," "); $text .= '$(TARGET)';
+
+$(TARGET): $(OBJECTS) $(OBJMOC) #$ Expand("TARGETDEPS");
+#$ Project("TMAKE_APP_OR_DLL") || DisableOutput();
+ $(LINK) @&&|
+ $(LFLAGS) $(OBJECTS) $(OBJMOC), $(TARGET),,$(LIBS)
+#$ Project("TMAKE_APP_OR_DLL") || EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+ -del $(TARGET)
+ $(LIB) $(TARGET) @&&|
+#${
+# $text = "+" . join(" \\\n+",split(/\s+/,$project{"OBJECTS"})) . " \\\n+"
+# . join(" \\\n+",split(/\s+/,$project{"OBJMOC"}));
+#$}
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+|
+#$ (Config("dll") && Project("DLLDESTDIR")) || DisableOutput();
+ -copy $(TARGET) #$ Expand("DLLDESTDIR");
+#$ (Config("dll") && Project("DLLDESTDIR")) || EnableOutput();
+#$ Project("RC_FILE") || DisableOutput();
+
+#$ Substitute("\$\$RES_FILE: \$\$RC_FILE\n\t\$\$TMAKE_RC \$\$RC_FILE");
+#$ Project("RC_FILE") || EnableOutput();
+
+moc: $(SRCMOC)
+
+#$ TmakeSelf();
+
+dist:
+ #$ Substitute('$(ZIP) $$PROJECT.zip $$PROJECT.pro $(SOURCES) $(HEADERS) $(DIST)');
+
+clean:
+ #$ ExpandGlue("OBJECTS","-del ","\n\t-del ","");
+ #$ ExpandGlue("SRCMOC" ,"-del ","\n\t-del ","");
+ #$ ExpandGlue("OBJMOC" ,"-del ","\n\t-del ","");
+ -del $(TARGET)
+ #$ ExpandGlue("TMAKE_CLEAN","-del ","\n\t-del ","");
+ #$ ExpandGlue("CLEAN_FILES","-del ","\n\t-del ","");
+
+####### Compile
+
+#$ BuildObj(Project("OBJECTS"),Project("SOURCES"));
+#$ BuildMocObj(Project("OBJMOC"),Project("SRCMOC"));
+#$ BuildMocSrc(Project("HEADERS"));
+#$ BuildMocSrc(Project("SOURCES"));
diff --git a/tmake/lib/win32-borland/lib.t b/tmake/lib/win32-borland/lib.t
new file mode 100755
index 0000000..d8ac6c7
--- /dev/null
+++ b/tmake/lib/win32-borland/lib.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 libraries.
+#!
+#$ Project('TMAKE_LIB_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-borland/subdirs.t b/tmake/lib/win32-borland/subdirs.t
new file mode 100755
index 0000000..8e70c0e
--- /dev/null
+++ b/tmake/lib/win32-borland/subdirs.t
@@ -0,0 +1,33 @@
+#############################################################################
+#!
+#! This is a tmake template for creating a makefile that invokes make in
+#! sub directories - for Win32/Borland C++.
+#!
+#${
+ StdInit();
+ $m = "";
+ foreach ( split(/\s+/,$project{"SUBDIRS"}) ) {
+ $m = $m . "\tcd $_\n\tDOMAKE\n\t\@cd ..\n";
+ }
+ $project{"SUBMAKE"} = $m;
+#$}
+#!
+# Makefile for building targets in sub directories.
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+SUBDIRS = #$ ExpandList("SUBDIRS");
+
+all: $(SUBDIRS)
+
+#${
+ foreach ( split(/\s+/,$project{"SUBDIRS"}) ) {
+ $text = $text . $_ . ":\n\t" .
+ "cd $_\n\t\$(MAKE\)\n\t\@cd ..\n\n";
+ }
+#$}
+
+clean:
+#$ $text = $project{"SUBMAKE"}; $text =~ s/DOMAKE/\$(MAKE\) clean/g;
diff --git a/tmake/lib/win32-borland/tmake.conf b/tmake/lib/win32-borland/tmake.conf
new file mode 100755
index 0000000..4dd3636
--- /dev/null
+++ b/tmake/lib/win32-borland/tmake.conf
@@ -0,0 +1,56 @@
+#
+# $Id$
+#
+# tmake configuration for Win32/Borland C++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = bcc32
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON = -w
+TMAKE_CFLAGS_WARN_OFF = -w-
+TMAKE_CFLAGS_RELEASE = -O2
+TMAKE_CFLAGS_DEBUG = -v
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = $$TMAKE_CC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_INCDIR_QT = $(QTDIR)\include
+
+TMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o$obj $src
+TMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o$@ $<
+TMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o$obj $src
+TMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o$@ $<
+
+TMAKE_LINK = ilink32
+TMAKE_LFLAGS = -L$(BCB)\lib -c -x -Gn
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG = -v
+TMAKE_LFLAGS_CONSOLE = -ap -Tpe c0x32.obj
+TMAKE_LFLAGS_WINDOWS = -aa -Tpe c0w32.obj
+TMAKE_LFLAGS_CONSOLE_DLL= -Gi -ap -Tpd c0d32.obj
+TMAKE_LFLAGS_WINDOWS_DLL= -Gi -aa -Tpd c0d32.obj
+
+TMAKE_LIBS = import32.lib cw32.lib
+TMAKE_LIBS_CONSOLE =
+TMAKE_LIBS_WINDOWS =
+TMAKE_LIBS_QT = $(QTDIR)\lib\qt.lib
+TMAKE_LIBS_QT_DLL = $(QTDIR)\lib\qtmain.lib
+TMAKE_LIBS_QT_OPENGL = $(QTDIR)\lib\qgl.lib
+TMAKE_LIBS_OPENGL =
+
+TMAKE_MOC = moc
+
+TMAKE_LIB = tlib /C /P256
+TMAKE_RC = rc
+
+TMAKE_ZIP = zip -r -9
diff --git a/tmake/lib/win32-g++/app.t b/tmake/lib/win32-g++/app.t
new file mode 100755
index 0000000..fc4dc2c
--- /dev/null
+++ b/tmake/lib/win32-g++/app.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 applications.
+#!
+#$ Project('TMAKE_APP_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-g++/generic.t b/tmake/lib/win32-g++/generic.t
new file mode 100755
index 0000000..253c401
--- /dev/null
+++ b/tmake/lib/win32-g++/generic.t
@@ -0,0 +1,226 @@
+#!
+#! This is a tmake template for building Win32 applications or libraries.
+#!
+#${
+ if ( Config("qt") ) {
+ if ( $ENV{"QT_DLL"} && !$ENV{"QT_NODLL"} ) {
+ Project('TMAKE_QT_DLL = 1');
+ if ( Project("TARGET") eq "qt" ) {
+ Project('CONFIG += dll');
+ }
+ }
+ }
+ if ( Config("dll") || Project("TMAKE_APP_FLAG") ) {
+ Project('CONFIG -= staticlib');
+ Project('TMAKE_APP_OR_DLL = 1');
+ } else {
+ Project('CONFIG += staticlib');
+ }
+ if ( Config("warn_off") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_OFF');
+ } elsif ( Config("warn_on") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_ON');
+ }
+ if ( Config("debug") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_DEBUG');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_DEBUG');
+ } elsif ( Config("release") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_RELEASE');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_RELEASE');
+ }
+ if ( Config("qt") || Config("opengl") ) {
+ Project('CONFIG += windows' );
+ }
+ if ( Config("qt") ) {
+ $moc_aware = 1;
+ AddIncludePath(Project('TMAKE_INCDIR_QT'));
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
+ }
+ if ( Project("TARGET") eq "qt" ) {
+ if ( Project("TMAKE_QT_DLL") && !(Project("DEFINES") =~ /QT_NODLL/) ) {
+ Project('DEFINES *= QT_MAKEDLL');
+ }
+ } else {
+ if ( Project("TMAKE_QT_DLL") && !(Project("DEFINES") =~ /QT_NODLL/) ) {
+ Project('DEFINES *= QT_DLL');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
+ if ( (Project("DEFINES") =~ /QT_DLL/) ) {
+ my $qtver =FindHighestLibVersion($ENV{"QTDIR"} . "/lib", "qt");
+ Project("TMAKE_LIBS /= s/qt.lib/qt${qtver}.lib/");
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_DLL');
+ }
+ }
+ }
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
+ }
+ if ( Config("dll") ) {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE_DLL');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS_DLL');
+ if ( Project("TMAKE_LIB_FLAG") ) {
+ my $ver = Project("VERSION");
+ $ver =~ s/\.//g;
+ $project{"TARGET_EXT"} = "${ver}.dll";
+ } else {
+ $project{"TARGET_EXT"} = ".dll";
+ }
+ } else {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS');
+ if ( Project('TMAKE_APP_FLAG') ) {
+ $project{"TARGET_EXT"} = ".exe";
+ } else {
+ $project{"TARGET_EXT"} = ".a";
+ }
+ }
+ if ( Config("windows") ) {
+ if ( Config("console") ) {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_WINDOWS_ANY');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_WINDOWS');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ }
+ Project('TMAKE_LIBS += $$LIBS');
+ Project('TMAKE_FILETAGS = HEADERS SOURCES DEF_FILE RC_FILE TARGET TMAKE_LIBS DESTDIR DLLDESTDIR $$FILETAGS');
+ foreach ( split(/\s/,Project('TMAKE_FILETAGS')) ) {
+ $project{$_} =~ s-[/\\]+-/-g;
+ }
+ $obj_ext = "o";
+ $dir_sep = "/";
+ $gnuwin32 = 1;
+ if ( Config("qt") ) {
+ $qtdir = $ENV{"QTDIR"};
+ $project{"INCPATH"} =~ s/\$\(QTDIR\)/$qtdir/;
+ $project{"INCPATH"} =~ s/\\/\//g;
+ $project{"TMAKE_LIBS"} =~ s/\$\(QTDIR\)/$qtdir/;
+ $project{"TMAKE_LIBS"} =~ s/\\/\//g;
+ }
+ if ( Project('DEF_FILE') ) {
+ Project('TMAKE_LFLAGS *= $$DEF_FILE');
+ }
+ if ( Project('RC_FILE') ) {
+ if ( Project('RES_FILE') ) {
+ tmake_error("Both .rc and .res file specified.\n" .
+ "Please specify one of them, not both.");
+ }
+ $project{"RES_FILE"} = $project{"RC_FILE"};
+ $project{"RES_FILE"} =~ s/\.rc$/.res/i;
+ Project('TARGETDEPS += $$RES_FILE');
+ }
+ if ( Project('RES_FILE') ) {
+ Project('TMAKE_LFLAGS *= $$RES_FILE');
+ }
+ StdInit();
+ $project{"DESTDIR"} = FixPath($project{"DESTDIR"});
+ if ( Project("VERSION") ) {
+ $project{"VER_MAJ"} = $project{"VERSION"};
+ $project{"VER_MAJ"} =~ s/\.\d+$//;
+ $project{"VER_MIN"} = $project{"VERSION"};
+ $project{"VER_MIN"} =~ s/^\d+\.//;
+ }
+ if ( Config("staticlib") ) {
+ $project{"TARGET"} = $project{"DESTDIR"} . "lib" . $project{"TARGET"} .
+ $project{"TARGET_EXT"};
+ } else {
+ $project{"TARGET"} = $project{"DESTDIR"} . $project{"TARGET"} .
+ $project{"TARGET_EXT"};
+ }
+#$}
+#!
+# Makefile for building #$ Expand("TARGET")
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = #$ Expand("TMAKE_CC");
+CFLAGS = #$ Expand("TMAKE_CFLAGS"); ExpandGlue("DEFINES","-D"," -D","");
+INCPATH = #$ ExpandGlue("INCPATH","-I"," -I","");
+#$ !Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LINK = #$ Expand("TMAKE_LINK");
+LFLAGS = #$ Expand("TMAKE_LFLAGS");
+LIBS = #$ Expand("TMAKE_LIBS");
+#$ !Project("TMAKE_APP_OR_DLL") && EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+AR = #$ Expand("TMAKE_AR");
+RANLIB = #$ Expand("TMAKE_RANLIB");
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+MOC = #$ Expand("TMAKE_MOC");
+
+ZIP = #$ Expand("TMAKE_ZIP");
+
+####### Files
+
+HEADERS = #$ ExpandList("HEADERS");
+SOURCES = #$ ExpandList("SOURCES");
+OBJECTS = #$ ExpandList("OBJECTS");
+SRCMOC = #$ ExpandList("SRCMOC");
+OBJMOC = #$ ExpandList("OBJMOC");
+DIST = #$ ExpandList("DISTFILES");
+TARGET = #$ ExpandGlue("TARGET",$project{"DESTDIR"},"",$project{"TARGET_EXT"});
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .c
+
+.cpp.o:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+.cxx.o:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+.cc.o:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+.c.o:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+####### Build rules
+
+all: #$ ExpandGlue("ALL_DEPS",""," "," "); $text .= '$(TARGET)';
+
+$(TARGET): $(OBJECTS) $(OBJMOC) #$ Expand("TARGETDEPS");
+#$ Project("TMAKE_APP_OR_DLL") || DisableOutput();
+ $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
+#$ Project("TMAKE_APP_OR_DLL") || EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+ -rm -f $(TARGET)
+ $(AR) $(TARGET) $(OBJECTS) $(OBJMOC)
+ #$ ExpandGlue("TMAKE_RANLIB","",""," \$(TARGET)");
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+#$ (Config("dll") && Project("DLLDESTDIR")) || DisableOutput();
+ -cp $(TARGET) #$ Expand("DLLDESTDIR");
+#$ (Config("dll") && Project("DLLDESTDIR")) || EnableOutput();
+#$ Project('RC_FILE') || DisableOutput();
+
+#$ Substitute("\$\$RES_FILE: \$\$RC_FILE\n\t\$\$TMAKE_RC \$\$RC_FILE");
+#$ Project('RC_FILE') || EnableOutput();
+
+moc: $(SRCMOC)
+
+#$ TmakeSelf();
+
+dist:
+ #$ Substitute('$(ZIP) $$PROJECT.zip $$PROJECT.pro $(SOURCES) $(HEADERS) $(DIST)');
+
+clean:
+ -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(TARGET)
+ #$ ExpandGlue("TMAKE_CLEAN","-rm -f "," ","");
+ -rm -f *~ core
+ #$ ExpandGlue("CLEAN_FILES","-rm -f "," ","");
+
+####### Compile
+
+#$ BuildObj(Project("OBJECTS"),Project("SOURCES"));
+#$ BuildMocObj(Project("OBJMOC"),Project("SRCMOC"));
+#$ BuildMocSrc(Project("HEADERS"));
+#$ BuildMocSrc(Project("SOURCES"));
diff --git a/tmake/lib/win32-g++/lib.t b/tmake/lib/win32-g++/lib.t
new file mode 100755
index 0000000..d8ac6c7
--- /dev/null
+++ b/tmake/lib/win32-g++/lib.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 libraries.
+#!
+#$ Project('TMAKE_LIB_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-g++/subdirs.t b/tmake/lib/win32-g++/subdirs.t
new file mode 100755
index 0000000..8b881ab
--- /dev/null
+++ b/tmake/lib/win32-g++/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Win32 template
+#$ IncludeTemplate("../win32/subdirs.t");
diff --git a/tmake/lib/win32-g++/tmake.conf b/tmake/lib/win32-g++/tmake.conf
new file mode 100755
index 0000000..59667bd
--- /dev/null
+++ b/tmake/lib/win32-g++/tmake.conf
@@ -0,0 +1,56 @@
+#
+# $Id$
+#
+# tmake configuration for Win32/g++ (Cygnus gnu-win32)
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = g++
+TMAKE_CFLAGS =
+TMAKE_CFLAGS_WARN_ON =
+TMAKE_CFLAGS_WARN_OFF =
+TMAKE_CFLAGS_RELEASE = -O
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+TMAKE_CXX = $$TMAKE_CC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_INCDIR_QT = $(QTDIR)/include
+
+TMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
+TMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+TMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
+TMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+TMAKE_LINK = g++
+TMAKE_LFLAGS =
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG =
+TMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
+TMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
+TMAKE_LFLAGS_CONSOLE_DLL= -Wl,-subsystem,console
+TMAKE_LFLAGS_WINDOWS_DLL= -Wl,-subsystem,windows
+
+TMAKE_LIBS =
+TMAKE_LIBS_CONSOLE =
+TMAKE_LIBS_WINDOWS = -luser32 -lgdi32 -lcomdlg32 -lole32 -luuid -lwsock32
+TMAKE_LIBS_QT = -L$(QTDIR)/lib -lqt
+TMAKE_LIBS_QT_DLL = -lqtmain
+TMAKE_LIBS_QT_OPENGL = -lqgl
+TMAKE_LIBS_OPENGL = -lopengl32
+
+TMAKE_MOC = moc
+
+TMAKE_AR = ar cqs
+TMAKE_RANLIB =
+
+TMAKE_ZIP = zip -r -9
diff --git a/tmake/lib/win32-msvc/app.t b/tmake/lib/win32-msvc/app.t
new file mode 100755
index 0000000..fc4dc2c
--- /dev/null
+++ b/tmake/lib/win32-msvc/app.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 applications.
+#!
+#$ Project('TMAKE_APP_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-msvc/generic.t b/tmake/lib/win32-msvc/generic.t
new file mode 100755
index 0000000..e57180d
--- /dev/null
+++ b/tmake/lib/win32-msvc/generic.t
@@ -0,0 +1,221 @@
+#!
+#! This is a tmake template for building Win32 applications or libraries.
+#!
+#${
+ if ( Config("qt") ) {
+ if ( !(Project("DEFINES") =~ /QT_NODLL/) &&
+ ((Project("DEFINES") =~ /QT_(?:MAKE)?DLL/) ||
+ ($ENV{"QT_DLL"} && !$ENV{"QT_NODLL"})) ) {
+ Project('TMAKE_QT_DLL = 1');
+ if ( (Project("TARGET") eq "qt") && Project("TMAKE_LIB_FLAG") ) {
+ Project('CONFIG += dll');
+ }
+ }
+ }
+ if ( Config("dll") || Project("TMAKE_APP_FLAG") ) {
+ Project('CONFIG -= staticlib');
+ Project('TMAKE_APP_OR_DLL = 1');
+ } else {
+ Project('CONFIG += staticlib');
+ }
+ if ( Config("warn_off") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_OFF');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_WARN_OFF');
+ } elsif ( Config("warn_on") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_ON');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_WARN_ON');
+ }
+ if ( Config("debug") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_DEBUG');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_DEBUG');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_DEBUG');
+ } elsif ( Config("release") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_RELEASE');
+ Project('TMAKE_CXXFLAGS += $$TMAKE_CXXFLAGS_RELEASE');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_RELEASE');
+ }
+ if ( Config("qt") || Config("opengl") ) {
+ Project('CONFIG += windows' );
+ }
+ if ( Config("qt") ) {
+ $moc_aware = 1;
+ AddIncludePath(Project("TMAKE_INCDIR_QT"));
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
+ }
+ if ( (Project("TARGET") eq "qt") && Project("TMAKE_LIB_FLAG") ) {
+ if ( Project("TMAKE_QT_DLL") ) {
+ Project('DEFINES -= QT_DLL');
+ Project('DEFINES *= QT_MAKEDLL');
+ }
+ } else {
+ if ( Project("TMAKE_QT_DLL") ) {
+ Project('DEFINES *= QT_DLL');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
+ if ( Project("TMAKE_QT_DLL") ) {
+ my $qtver =FindHighestLibVersion($ENV{"QTDIR"} . "/lib", "qt");
+ Project("TMAKE_LIBS /= s/qt.lib/qt${qtver}.lib/");
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_DLL');
+ }
+ }
+ }
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
+ }
+ if ( Config("dll") ) {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE_DLL');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS_DLL');
+ if ( Project("TMAKE_LIB_FLAG") ) {
+ my $ver = Project("VERSION");
+ $ver =~ s/\.//g;
+ $project{"TARGET_EXT"} = "${ver}.dll";
+ } else {
+ $project{"TARGET_EXT"} = ".dll";
+ }
+ } else {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS');
+ if ( Project("TMAKE_APP_FLAG") ) {
+ $project{"TARGET_EXT"} = ".exe";
+ } else {
+ $project{"TARGET_EXT"} = ".lib";
+ }
+ }
+ if ( Config("windows") ) {
+ if ( Config("console") ) {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_WINDOWS_ANY');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_WINDOWS');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ }
+ Project('TMAKE_LIBS += $$LIBS');
+ Project('TMAKE_FILETAGS = HEADERS SOURCES DEF_FILE RC_FILE TARGET TMAKE_LIBS DESTDIR DLLDESTDIR $$FILETAGS');
+ foreach ( split(/\s/,Project("TMAKE_FILETAGS")) ) {
+ $project{$_} =~ s-[/\\]+-\\-g;
+ }
+ if ( Project("DEF_FILE") ) {
+ Project('TMAKE_LFLAGS *= /DEF:$$DEF_FILE');
+ }
+ if ( Project("RC_FILE") ) {
+ if ( Project("RES_FILE") ) {
+ tmake_error("Both .rc and .res file specified.\n" .
+ "Please specify one of them, not both.");
+ }
+ $project{"RES_FILE"} = $project{"RC_FILE"};
+ $project{"RES_FILE"} =~ s/\.rc$/.res/i;
+ Project('TARGETDEPS += $$RES_FILE');
+ }
+ if ( Project("RES_FILE") ) {
+ Project('TMAKE_LIBS *= $$RES_FILE');
+ }
+ StdInit();
+ $project{"DESTDIR"} = FixPath($project{"DESTDIR"});
+ if ( Project("VERSION") ) {
+ $project{"VER_MAJ"} = $project{"VERSION"};
+ $project{"VER_MAJ"} =~ s/\.\d+$//;
+ $project{"VER_MIN"} = $project{"VERSION"};
+ $project{"VER_MIN"} =~ s/^\d+\.//;
+ }
+ Project('debug:TMAKE_CLEAN += $$TARGET.pdb vc*.pdb $$TARGET.ilk');
+#$}
+#!
+# Makefile for building #$ Expand("TARGET")
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = #$ Expand("TMAKE_CC");
+CXX = #$ Expand("TMAKE_CXX");
+CFLAGS = #$ Expand("TMAKE_CFLAGS"); ExpandGlue("DEFINES","-D"," -D","");
+CXXFLAGS= #$ Expand("TMAKE_CXXFLAGS"); ExpandGlue("DEFINES","-D"," -D","");
+INCPATH = #$ ExpandGlue("INCPATH",'-I"','" -I"','"');
+#$ !Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LINK = #$ Expand("TMAKE_LINK");
+LFLAGS = #$ Expand("TMAKE_LFLAGS");
+LIBS = #$ Expand("TMAKE_LIBS");
+#$ !Project("TMAKE_APP_OR_DLL") && EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LIB = #$ Expand("TMAKE_LIB");
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+MOC = #$ Expand("TMAKE_MOC");
+
+ZIP = #$ Expand("TMAKE_ZIP");
+
+####### Files
+
+HEADERS = #$ ExpandList("HEADERS");
+SOURCES = #$ ExpandList("SOURCES");
+OBJECTS = #$ ExpandList("OBJECTS");
+SRCMOC = #$ ExpandList("SRCMOC");
+OBJMOC = #$ ExpandList("OBJMOC");
+DIST = #$ ExpandList("DISTFILES");
+TARGET = #$ ExpandGlue("TARGET",$project{"DESTDIR"},"",$project{"TARGET_EXT"});
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .c
+
+.cpp.obj:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.cxx.obj:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.cc.obj:
+ #$ Expand("TMAKE_RUN_CXX_IMP");
+
+.c.obj:
+ #$ Expand("TMAKE_RUN_CC_IMP");
+
+####### Build rules
+
+all: #$ ExpandGlue("ALL_DEPS",""," "," "); $text .= '$(TARGET)';
+
+$(TARGET): $(OBJECTS) $(OBJMOC) #$ Expand("TARGETDEPS");
+#$ Project("TMAKE_APP_OR_DLL") || DisableOutput();
+ $(LINK) $(LFLAGS) /OUT:$(TARGET) @<<
+ $(OBJECTS) $(OBJMOC) $(LIBS)
+#$ Project("TMAKE_APP_OR_DLL") || EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+ $(LIB) /OUT:$(TARGET) @<<
+ $(OBJECTS) $(OBJMOC)
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+<<
+#$ (Config("dll") && Project("DLLDESTDIR")) || DisableOutput();
+ -copy $(TARGET) #$ Expand("DLLDESTDIR");
+#$ (Config("dll") && Project("DLLDESTDIR")) || EnableOutput();
+#$ Project("RC_FILE") || DisableOutput();
+
+#$ Substitute("\$\$RES_FILE: \$\$RC_FILE\n\t\$\$TMAKE_RC \$\$RC_FILE");
+#$ Project("RC_FILE") || EnableOutput();
+
+moc: $(SRCMOC)
+
+#$ TmakeSelf();
+
+dist:
+ #$ Substitute('$(ZIP) $$PROJECT.zip $$PROJECT.pro $(SOURCES) $(HEADERS) $(DIST)');
+
+clean:
+ #$ ExpandGlue("OBJECTS","-del ","\n\t-del ","");
+ #$ ExpandGlue("SRCMOC" ,"-del ","\n\t-del ","");
+ #$ ExpandGlue("OBJMOC" ,"-del ","\n\t-del ","");
+ -del $(TARGET)
+ #$ ExpandGlue("TMAKE_CLEAN","-del ","\n\t-del ","");
+ #$ ExpandGlue("CLEAN_FILES","-del ","\n\t-del ","");
+
+####### Compile
+
+#$ BuildObj(Project("OBJECTS"),Project("SOURCES"));
+#$ BuildMocObj(Project("OBJMOC"),Project("SRCMOC"));
+#$ BuildMocSrc(Project("HEADERS"));
+#$ BuildMocSrc(Project("SOURCES"));
diff --git a/tmake/lib/win32-msvc/lib.t b/tmake/lib/win32-msvc/lib.t
new file mode 100755
index 0000000..d8ac6c7
--- /dev/null
+++ b/tmake/lib/win32-msvc/lib.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 libraries.
+#!
+#$ Project('TMAKE_LIB_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-msvc/subdirs.t b/tmake/lib/win32-msvc/subdirs.t
new file mode 100755
index 0000000..8b881ab
--- /dev/null
+++ b/tmake/lib/win32-msvc/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Win32 template
+#$ IncludeTemplate("../win32/subdirs.t");
diff --git a/tmake/lib/win32-msvc/tmake.conf b/tmake/lib/win32-msvc/tmake.conf
new file mode 100755
index 0000000..cb64ac9
--- /dev/null
+++ b/tmake/lib/win32-msvc/tmake.conf
@@ -0,0 +1,64 @@
+#
+# $Id$
+#
+# tmake configuration for Win32/Microsoft C++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = cl
+TMAKE_CFLAGS = -nologo
+TMAKE_CFLAGS_WARN_ON = -W3
+TMAKE_CFLAGS_WARN_OFF = -W0
+TMAKE_CFLAGS_RELEASE = -O2
+TMAKE_CFLAGS_DEBUG = -Zi
+TMAKE_CFLAGS_MT = -MT
+TMAKE_CFLAGS_MT_DBG = -MTd
+TMAKE_CFLAGS_MT_DLL = -MD
+TMAKE_CFLAGS_MT_DLLDBG = -MDd
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = $$TMAKE_CC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_MT = $$TMAKE_CFLAGS_MT
+TMAKE_CXXFLAGS_MT_DBG = $$TMAKE_CFLAGS_MT_DBG
+TMAKE_CXXFLAGS_MT_DLL = $$TMAKE_CFLAGS_MT_DLL
+TMAKE_CXXFLAGS_MT_DLLDBG= $$TMAKE_CFLAGS_MT_DLLDBG
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_INCDIR_QT = $(QTDIR)\include
+
+TMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$obj $src
+TMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $<
+TMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$obj $src
+TMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ $<
+
+TMAKE_LINK = link
+TMAKE_LFLAGS = /NOLOGO
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG = /DEBUG
+TMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:console
+TMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:windows
+TMAKE_LFLAGS_CONSOLE_DLL= /SUBSYSTEM:console /DLL
+TMAKE_LFLAGS_WINDOWS_DLL= /SUBSYSTEM:windows /DLL
+
+TMAKE_LIBS =
+TMAKE_LIBS_CONSOLE =
+TMAKE_LIBS_WINDOWS = user32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib wsock32.lib
+TMAKE_LIBS_QT = $(QTDIR)\lib\qt.lib
+TMAKE_LIBS_QT_DLL = $(QTDIR)\lib\qtmain.lib
+TMAKE_LIBS_QT_OPENGL = $(QTDIR)\lib\qgl.lib
+TMAKE_LIBS_OPENGL = opengl32.lib glu32.lib
+
+TMAKE_MOC = moc
+
+TMAKE_LIB = lib /NOLOGO
+TMAKE_RC = rc
+
+TMAKE_ZIP = zip -r -9
diff --git a/tmake/lib/win32-msvc/vcapp.t b/tmake/lib/win32-msvc/vcapp.t
new file mode 100755
index 0000000..02e15e4
--- /dev/null
+++ b/tmake/lib/win32-msvc/vcapp.t
@@ -0,0 +1,226 @@
+#!
+#! This TMAKE template - Microsoft Visual C++ 5.0 applications
+#!
+#${
+ if ( Config("qt") || Config("opengl") ) {
+ Project('CONFIG += windows');
+ }
+ if ( Config("qt") ) {
+ $moc_aware = 1;
+ AddIncludePath(Project('TMAKE_INCDIR_QT'));
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
+ }
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
+ }
+ Project('TMAKE_LIBS += $$LIBS');
+
+ if ( Config("windows") ) {
+ $project{"VC_PROJ_TYPE"} = 'Win32 (x86) Application';
+ $project{"VC_PROJ_CODE"} = '0x0101';
+ $vc_base_libs = 'kernel32.lib user32.lib gdi32.lib winspool.lib ' .
+ 'comdlg32.lib advapi32.lib shell32.lib ole32.lib ' .
+ 'oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ';
+ $vc_libs = $vc_base_libs . 'wsock32.lib ';
+ $vc_link_release = '/nologo /subsystem:windows /machine:I386';
+ $vc_link_debug = '/nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept';
+ $vc_cpp_def_release = '/D "NDEBUG" /D "WIN32" /D "_WINDOWS" ';
+ $vc_cpp_def_debug = '/D "_DEBUG" /D "WIN32" /D "_WINDOWS" ';
+ } else {
+ $project{"VC_PROJ_TYPE"} = 'Win32 (x86) Console Application';
+ $project{"VC_PROJ_CODE"} = '0x0103';
+ $vc_base_libs = 'kernel32.lib user32.lib gdi32.lib winspool.lib ' .
+ 'comdlg32.lib advapi32.lib shell32.lib ole32.lib ' .
+ 'oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ';
+ $vc_libs = $vc_base_libs;
+ $vc_link_release = '/nologo /subsystem:console /machine:I386';
+ $vc_link_debug = '/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept';
+ $vc_cpp_def_release = '/D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" ';
+ $vc_cpp_def_debug = '/D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" ';
+ }
+ $project{"VC_BASE_LINK_RELEASE"} = $vc_base_libs . $vc_link_release;
+ $project{"VC_BASE_LINK_DEBUG"} = $vc_base_libs . $vc_link_debug;
+ $tmake_libs = Project('TMAKE_LIBS') ? (Project('TMAKE_LIBS') . " ") : "";
+ $project{"VC_LINK_RELEASE"} = $vc_libs . $tmake_libs . $vc_link_release;
+ $project{"VC_LINK_DEBUG"} = $vc_libs . $tmake_libs . $vc_link_debug;
+
+ $vc_cpp_opt_release = '/nologo /W3 /GX /O2 ';
+ $vc_cpp_opt_debug = '/nologo /W3 /Gm /GX /Zi /Od ';
+ $vc_cpp_opt_common = '/YX /FD /c';
+ $project{"VC_BASE_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_cpp_def_release . $vc_cpp_opt_common;
+ $project{"VC_BASE_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_cpp_def_debug . $vc_cpp_opt_common;
+ ExpandGlue("INCPATH",'/I "','" /I "','"');
+ if ( $text ne "" ) { $vc_inc = $text . " "; $text = ""; } else { $vc_inc = ""; }
+ ExpandGlue("DEFINES",'/D "','" /D "','"');
+ if ( $text ne "" ) { $vc_def = $text . " "; $text = ""; } else { $vc_def = ""; }
+ $project{"VC_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_inc . $vc_cpp_def_release . $vc_def . $vc_cpp_opt_common;
+ $project{"VC_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_inc . $vc_cpp_def_debug . $vc_def . $vc_cpp_opt_common;
+
+ $project{"MAKEFILE"} = $project{"PROJECT"} . ".mak";
+ $project{"TARGETAPP"} = $project{"TARGET"} . ".exe";
+ Project('TMAKE_FILETAGS = HEADERS SOURCES TARGET DESTDIR $$FILETAGS');
+ foreach ( split(/\s/,Project('TMAKE_FILETAGS')) ) {
+ $project{$_} =~ s-/-\\-g;
+ }
+ StdInit();
+ if ( defined($project{"DESTDIR"}) ) {
+ $project{"TARGETAPP"} = $project{"DESTDIR"} . "\\" . $project{"TARGETAPP"};
+ $project{"TARGETAPP"} =~ s/\\+/\\/g;
+ }
+ %all_files = ();
+ @files = split(/\s+/,$project{"HEADERS"});
+ foreach ( @files ) { $all_files{$_} = "h" };
+ @files = split(/\s+/,$project{"SOURCES"});
+ foreach ( @files ) { $all_files{$_} = "s" };
+ if ( $moc_aware ) {
+ @files = split(/\s+/,$project{"_HDRMOC"});
+ foreach ( @files ) { $all_files{$_} = "m"; }
+ @files = split(/\s+/,$project{"_SRCMOC"});
+ foreach ( @files ) { $all_files{$_} = "i"; }
+ }
+ %file_names = ();
+ foreach $f ( %all_files ) {
+ $n = $f;
+ $n =~ s/^.*\\//;
+ $file_names{$n} = $f;
+ $file_path{$n} = ".\\" . $f;
+ $file_path2{$n} = (($f =~ /^\./) ? "" : ".\\") . $f;
+ }
+#$}
+# Microsoft Developer Studio Project File - #$ Substitute('Name="$$TARGET" - Package Owner=<4>');
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE #$ Substitute('"$$VC_PROJ_TYPE" $$VC_PROJ_CODE');
+
+CFG=#$ Substitute('$$TARGET - Win32 Debug');
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "#$ ExpandGlue('MAKEFILE','','','".');
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f #$ Substitute('"$$MAKEFILE" CFG="$$TARGET - Win32 Debug"');
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE #$ Substitute('"$$TARGET - Win32 Release" (based on "$$VC_PROJ_TYPE")');
+!MESSAGE #$ Substitute('"$$TARGET - Win32 Debug" (based on "$$VC_PROJ_TYPE")');
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+#$ Config("windows") && ($text='MTL=midl.exe');
+RSC=rc.exe
+
+!IF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Release"');
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+#$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
+# PROP Target_Dir ""
+# ADD BASE CPP #$ Expand("VC_BASE_CPP_RELEASE");
+# ADD CPP #$ Expand("VC_CPP_RELEASE");
+#$ Config("windows") || DisableOutput();
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+#$ Config("windows") || EnableOutput();
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 #$ Expand("VC_BASE_LINK_RELEASE");
+# ADD LINK32 #$ Expand("VC_LINK_RELEASE");
+
+!ELSEIF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Debug"');
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+#$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
+# PROP Target_Dir ""
+# ADD BASE CPP #$ Expand("VC_BASE_CPP_DEBUG");
+# ADD CPP #$ Expand("VC_CPP_DEBUG");
+#$ Config("windows") || DisableOutput();
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+#$ Config("windows") || EnableOutput();
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 #$ Expand("VC_BASE_LINK_DEBUG");
+# ADD LINK32 #$ Expand("VC_LINK_DEBUG");
+
+!ENDIF
+
+# Begin Target
+
+# Name #$Substitute('"$$TARGET - Win32 Release"');
+# Name #$Substitute('"$$TARGET - Win32 Debug"');
+#${
+ foreach $n ( sort keys %file_names ) {
+ $f = $file_names{$n};
+ $p = $file_path{$n};
+ $p2 = $file_path2{$n};
+ $t = $all_files{$f};
+ if ( ($t eq "h") && $moc_output{$f} ) {
+ my($build);
+ $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
+ . '"' . $moc_output{$f} . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
+ . "\n\tmoc $p2 -o " . $moc_output{$f} . "\n\n"
+ . "# End Custom Build\n\n";
+ $text .= ("# Begin Source File\n\nSOURCE=$p\n\n"
+ . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
+ . $build);
+ $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
+ . $build
+ . "!ENDIF \n\n# End Source File\n");
+ } elsif ( $t eq "i" ) {
+ my($build,$dn);
+ $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
+ . '"' . $f . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
+ . "\n\tmoc ". $moc_input{$f} . " -o $f\n\n"
+ . "# End Custom Build\n\n";
+ $dn = $n;
+ $dn =~ s/\..*//;
+ $dn =~ tr/a-z/A-Z/;
+ $text .= ("# Begin Source File\n\nSOURCE=$p\n"
+ . "USERDEP__$dn=" . '"' . $moc_input{$f} . '"' . "\n\n"
+ . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
+ . $build);
+ $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
+ . $build
+ . "!ENDIF \n\n# End Source File\n");
+ } elsif ( $t eq "s" || $t eq "m" || $t eq "h" ) {
+ $text .= "# Begin Source File\n\nSOURCE=$p\n# End Source File\n";
+ }
+ }
+ chop $text;
+#$}
+# End Target
+# End Project
diff --git a/tmake/lib/win32-msvc/vclib.t b/tmake/lib/win32-msvc/vclib.t
new file mode 100755
index 0000000..e56409e
--- /dev/null
+++ b/tmake/lib/win32-msvc/vclib.t
@@ -0,0 +1,178 @@
+#!
+#! This TMAKE template - Microsoft Visual C++ 5.0 libraries
+#!
+#${
+ if ( Config("qt") || Config("opengl") ) {
+ Project('CONFIG += windows');
+ }
+ if ( Config("qt") ) {
+ $moc_aware = 1;
+ AddIncludePath(Project('TMAKE_INCDIR_QT'));
+ }
+
+ $project{"VC_PROJ_TYPE"} = 'Win32 (x86) Static Library';
+ $project{"VC_PROJ_CODE"} = '0x0104';
+
+ $vc_cpp_def_release = '/D "NDEBUG" /D "WIN32" /D "_WINDOWS" ';
+ $vc_cpp_def_debug = '/D "_DEBUG" /D "WIN32" /D "_WINDOWS" ';
+ $vc_cpp_opt_release = '/nologo /W3 /GX /O2 ';
+ $vc_cpp_opt_debug = '/nologo /W3 /Gm /GX /Zi /Od ';
+ $vc_cpp_opt_common = '/YX /FD /c';
+ $project{"VC_BASE_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_cpp_def_release . $vc_cpp_opt_common;
+ $project{"VC_BASE_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_cpp_def_debug . $vc_cpp_opt_common;
+ ExpandGlue("INCPATH",'/I "','" /I "','"');
+ if ( $text ne "" ) { $vc_inc = $text . " "; $text = ""; } else { $vc_inc = ""; }
+ ExpandGlue("DEFINES",'/D "','" /D "','"');
+ if ( $text ne "" ) { $vc_def = $text . " "; $text = ""; } else { $vc_def = ""; }
+ $project{"VC_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_inc . $vc_cpp_def_release . $vc_def . $vc_cpp_opt_common;
+ $project{"VC_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_inc . $vc_cpp_def_debug . $vc_def . $vc_cpp_opt_common;
+
+ $project{"MAKEFILE"} = $project{"PROJECT"} . ".mak";
+ $project{"TARGETLIB"} = $project{"TARGET"} . ".lib";
+ Project('TMAKE_FILETAGS = HEADERS SOURCES TARGET DESTDIR $$FILETAGS');
+ foreach ( split(/\s/,Project('TMAKE_FILETAGS')) ) {
+ $project{$_} =~ s-/-\\-g;
+ }
+ StdInit();
+ if ( defined($project{"DESTDIR"}) ) {
+ $project{"TARGETLIB"} = $project{"DESTDIR"} . "\\" . $project{"TARGETLIB"};
+ $project{"TARGETLIB"} =~ s/\\+/\\/g;
+ }
+ %all_files = ();
+ @files = split(/\s+/,$project{"HEADERS"});
+ foreach ( @files ) { $all_files{$_} = "h" };
+ @files = split(/\s+/,$project{"SOURCES"});
+ foreach ( @files ) { $all_files{$_} = "s" };
+ if ( $moc_aware ) {
+ @files = split(/\s+/,$project{"_HDRMOC"});
+ foreach ( @files ) { $all_files{$_} = "m"; }
+ @files = split(/\s+/,$project{"_SRCMOC"});
+ foreach ( @files ) { $all_files{$_} = "i"; }
+ }
+ %file_names = ();
+ foreach $f ( %all_files ) {
+ $n = $f;
+ $n =~ s/^.*\\//;
+ $file_names{$n} = $f;
+ $file_path{$n} = ".\\" . $f;
+ $file_path2{$n} = (($f =~ /^\./) ? "" : ".\\") . $f;
+ }
+#$}
+# Microsoft Developer Studio Project File - #$ Substitute('Name="$$TARGET" - Package Owner=<4>');
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE #$ Substitute('"$$VC_PROJ_TYPE" $$VC_PROJ_CODE');
+
+CFG=#$ Substitute('$$TARGET - Win32 Debug');
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "#$ ExpandGlue('MAKEFILE','','','".');
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f #$ Substitute('"$$MAKEFILE" CFG="$$TARGET - Win32 Debug"');
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE #$ Substitute('"$$TARGET - Win32 Release" (based on "$$VC_PROJ_TYPE")');
+!MESSAGE #$ Substitute('"$$TARGET - Win32 Debug" (based on "$$VC_PROJ_TYPE")');
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+
+!IF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Release"');
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP #$ Expand("VC_BASE_CPP_RELEASE");
+# ADD CPP #$ Expand("VC_CPP_RELEASE");
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo #$ Project("TARGETLIB") && Substitute('/out:"$$TARGETLIB"');
+
+!ELSEIF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Debug"');
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP #$ Expand("VC_BASE_CPP_DEBUG");
+# ADD CPP #$ Expand("VC_CPP_DEBUG");
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo #$ Project("TARGETLIB") && Substitute('/out:"$$TARGETLIB"');
+
+!ENDIF
+
+# Begin Target
+
+# Name #$Substitute('"$$TARGET - Win32 Release"');
+# Name #$Substitute('"$$TARGET - Win32 Debug"');
+#${
+ foreach $n ( sort keys %file_names ) {
+ $f = $file_names{$n};
+ $p = $file_path{$n};
+ $p2 = $file_path2{$n};
+ $t = $all_files{$f};
+ if ( ($t eq "h") && $moc_output{$f} ) {
+ my($build);
+ $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
+ . '"' . $moc_output{$f} . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
+ . "\n\tmoc $p2 -o " . $moc_output{$f} . "\n\n"
+ . "# End Custom Build\n\n";
+ $text .= ("# Begin Source File\n\nSOURCE=$p\n\n"
+ . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
+ . $build);
+ $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
+ . $build
+ . "!ENDIF \n\n# End Source File\n");
+ } elsif ( $t eq "i" ) {
+ my($build,$dn);
+ $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
+ . '"' . $f . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
+ . "\n\tmoc ". $moc_input{$f} . " -o $f\n\n"
+ . "# End Custom Build\n\n";
+ $dn = $n;
+ $dn =~ s/\..*//;
+ $dn =~ tr/a-z/A-Z/;
+ $text .= ("# Begin Source File\n\nSOURCE=$p\n"
+ . "USERDEP__$dn=" . '"' . $moc_input{$f} . '"' . "\n\n"
+ . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
+ . $build);
+ $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
+ . $build
+ . "!ENDIF \n\n# End Source File\n");
+ } elsif ( $t eq "s" || $t eq "m" || $t eq "h" ) {
+ $text .= "# Begin Source File\n\nSOURCE=$p\n# End Source File\n";
+ }
+ }
+ chop $text;
+#$}
+# End Target
+# End Project
diff --git a/tmake/lib/win32-symantec/app.t b/tmake/lib/win32-symantec/app.t
new file mode 100755
index 0000000..fc4dc2c
--- /dev/null
+++ b/tmake/lib/win32-symantec/app.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 applications.
+#!
+#$ Project('TMAKE_APP_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-symantec/generic.t b/tmake/lib/win32-symantec/generic.t
new file mode 100755
index 0000000..e22d9c1
--- /dev/null
+++ b/tmake/lib/win32-symantec/generic.t
@@ -0,0 +1,212 @@
+#!
+#! This is a tmake template for building Win32 applications or libraries.
+#!
+#${
+ if ( Config("qt") ) {
+ if ( $ENV{"QT_DLL"} && !$ENV{"QT_NODLL"} ) {
+ Project('TMAKE_QT_DLL = 1');
+ if ( Project("TARGET") eq "qt" ) {
+ Project('CONFIG += dll');
+ }
+ }
+ }
+ if ( Config("dll") || Project("TMAKE_APP_FLAG") ) {
+ Project('CONFIG -= staticlib');
+ Project('TMAKE_APP_OR_DLL = 1');
+ } else {
+ Project('CONFIG += staticlib');
+ }
+ if ( Config("warn_off") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_OFF');
+ } elsif ( Config("warn_on") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_ON');
+ }
+ if ( Config("debug") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_DEBUG');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_DEBUG');
+ } elsif ( Config("release") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_RELEASE');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_RELEASE');
+ }
+ if ( Config("qt") || Config("opengl") ) {
+ Project('CONFIG += windows' );
+ }
+ if ( Config("qt") ) {
+ $moc_aware = 1;
+ AddIncludePath(Project('TMAKE_INCDIR_QT'));
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
+ }
+ if ( Project("TARGET") eq "qt" ) {
+ if ( Project("TMAKE_QT_DLL") && !(Project("DEFINES") =~ /QT_NODLL/) ) {
+ Project('DEFINES *= QT_MAKEDLL');
+ }
+ } else {
+ if ( Project("TMAKE_QT_DLL") && !(Project("DEFINES") =~ /QT_NODLL/) ) {
+ Project('DEFINES *= QT_DLL');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
+ if ( (Project("DEFINES") =~ /QT_DLL/) ) {
+ my $qtver =FindHighestLibVersion($ENV{"QTDIR"} . "/lib", "qt");
+ Project("TMAKE_LIBS /= s/qt.lib/qt${qtver}.lib/");
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_DLL');
+ }
+ }
+ }
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
+ }
+ if ( Config("dll") ) {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE_DLL');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS_DLL');
+ if ( Project("TMAKE_LIB_FLAG") ) {
+ my $ver = Project("VERSION");
+ $ver =~ s/\.//g;
+ $project{"TARGET_EXT"} = "${ver}.dll";
+ } else {
+ $project{"TARGET_EXT"} = ".dll";
+ }
+ } else {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS');
+ if ( Project('TMAKE_APP_FLAG') ) {
+ $project{"TARGET_EXT"} = ".exe";
+ } else {
+ $project{"TARGET_EXT"} = ".lib";
+ }
+ }
+ if ( Config("windows") ) {
+ if ( Config("console") ) {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_WINDOWS_ANY');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_WINDOWS');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ }
+ Project('TMAKE_LIBS += $$LIBS');
+ Project('TMAKE_FILETAGS = HEADERS SOURCES DEF_FILE RC_FILE TARGET TMAKE_LIBS DESTDIR DLLDESTDIR $$FILETAGS');
+ foreach ( split(/\s/,Project('TMAKE_FILETAGS')) ) {
+ $project{$_} =~ s-[/\\]+-\\-g;
+ }
+ if ( Project('DEF_FILE') ) {
+ Project('TMAKE_LFLAGS *= /DEF:$$DEF_FILE');
+ }
+ if ( Project('RC_FILE') ) {
+ if ( Project('RES_FILE') ) {
+ tmake_error("Both .rc and .res file specified.\n" .
+ "Please specify one of them, not both.");
+ }
+ $project{"RES_FILE"} = $project{"RC_FILE"};
+ $project{"RES_FILE"} =~ s/\.rc$/.res/i;
+ Project('TARGETDEPS += $$RES_FILE');
+ }
+ if ( Project('RES_FILE') ) {
+ Project('TMAKE_LIBS *= $$RES_FILE');
+ }
+ StdInit();
+ $project{"DESTDIR"} = FixPath($project{"DESTDIR"});
+ if ( Project("VERSION") ) {
+ $project{"VER_MAJ"} = $project{"VERSION"};
+ $project{"VER_MAJ"} =~ s/\.\d+$//;
+ $project{"VER_MIN"} = $project{"VERSION"};
+ $project{"VER_MIN"} =~ s/^\d+\.//;
+ }
+#$}
+#!
+# Makefile for building #$ Expand("TARGET")
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = #$ Expand("TMAKE_CC");
+CFLAGS = #$ Expand("TMAKE_CFLAGS"); ExpandGlue("DEFINES","-D"," -D","");
+INCPATH = #$ ExpandGlue("INCPATH",'-I"','" -I"','"');
+#$ !Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LINK = #$ Expand("TMAKE_LINK");
+LFLAGS = #$ Expand("TMAKE_LFLAGS");
+LIBS = #$ Expand("TMAKE_LIBS");
+#$ !Project("TMAKE_APP_OR_DLL") && EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LIB = #$ Expand("TMAKE_LIB");
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+MOC = #$ Expand("TMAKE_MOC");
+
+ZIP = #$ Expand("TMAKE_ZIP");
+
+####### Files
+
+HEADERS = #$ ExpandList("HEADERS");
+SOURCES = #$ ExpandList("SOURCES");
+OBJECTS = #$ ExpandList("OBJECTS");
+SRCMOC = #$ ExpandList("SRCMOC");
+OBJMOC = #$ ExpandList("OBJMOC");
+DIST = #$ ExpandList("DISTFILES");
+TARGET = #$ ExpandGlue("TARGET",$project{"DESTDIR"},"",$project{"TARGET_EXT"});
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .c
+
+.cpp.obj:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+.cxx.obj:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+.cc.obj:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+.c.obj:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+####### Build rules
+
+all: #$ ExpandGlue("ALL_DEPS",""," "," "); $text .= '$(TARGET)';
+
+$(TARGET): $(OBJECTS) $(OBJMOC) #$ Expand("TARGETDEPS");
+#$ Project("TMAKE_APP_OR_DLL") || DisableOutput();
+ $(LINK) $(LFLAGS) $(OBJECTS) $(OBJMOC), $(TARGET),, $(LIBS)
+#$ Project("TMAKE_APP_OR_DLL") || EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+ -del $(TARGET)
+#${
+# $text = "\t\$(LIB) \$(TARGET) "
+# . join(" \\\n+",split(/\s+/,$project{"OBJECTS"})) . " \\\n+"
+# . join(" \\\n+",split(/\s+/,$project{"OBJMOC"})) . ",;";
+#$}
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+#$ (Config("dll") && Project("DLLDESTDIR")) || DisableOutput();
+ -copy $(TARGET) #$ Expand("DLLDESTDIR");
+#$ (Config("dll") && Project("DLLDESTDIR")) || EnableOutput();
+#$ Project('RC_FILE') || DisableOutput();
+
+#$ Substitute("\$\$RES_FILE: \$\$RC_FILE\n\t\$\$TMAKE_RC \$\$RC_FILE");
+#$ Project('RC_FILE') || EnableOutput();
+
+moc: $(SRCMOC)
+
+#$ TmakeSelf();
+
+dist:
+ #$ Substitute('$(ZIP) $$PROJECT.zip $$PROJECT.pro $(SOURCES) $(HEADERS) $(DIST)');
+
+clean:
+ #$ ExpandGlue("OBJECTS","-del ","\n\t-del ","");
+ #$ ExpandGlue("SRCMOC" ,"-del ","\n\t-del ","");
+ #$ ExpandGlue("OBJMOC" ,"-del ","\n\t-del ","");
+ -del $(TARGET)
+ #$ ExpandGlue("CLEAN_FILES","-del ","\n\t-del ","");
+
+####### Compile
+
+#$ BuildObj(Project("OBJECTS"),Project("SOURCES"));
+#$ BuildMocObj(Project("OBJMOC"),Project("SRCMOC"));
+#$ BuildMocSrc(Project("HEADERS"));
+#$ BuildMocSrc(Project("SOURCES"));
diff --git a/tmake/lib/win32-symantec/lib.t b/tmake/lib/win32-symantec/lib.t
new file mode 100755
index 0000000..d8ac6c7
--- /dev/null
+++ b/tmake/lib/win32-symantec/lib.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 libraries.
+#!
+#$ Project('TMAKE_LIB_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-symantec/subdirs.t b/tmake/lib/win32-symantec/subdirs.t
new file mode 100755
index 0000000..8b881ab
--- /dev/null
+++ b/tmake/lib/win32-symantec/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Win32 template
+#$ IncludeTemplate("../win32/subdirs.t");
diff --git a/tmake/lib/win32-symantec/tmake.conf b/tmake/lib/win32-symantec/tmake.conf
new file mode 100755
index 0000000..c2b7e68
--- /dev/null
+++ b/tmake/lib/win32-symantec/tmake.conf
@@ -0,0 +1,56 @@
+#
+# $Id$
+#
+# tmake configuration for Win32/Symantec C++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = sc
+TMAKE_CFLAGS = -mn -w2
+TMAKE_CFLAGS_WARN_ON =
+TMAKE_CFLAGS_WARN_OFF = -w
+TMAKE_CFLAGS_RELEASE = -o
+TMAKE_CFLAGS_DEBUG = -g
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = $$TMAKE_CC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_INCDIR_QT = $(QTDIR)\include
+
+TMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o$obj $src
+TMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o$@ $<
+TMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o$obj $src
+TMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o$@ $<
+
+TMAKE_LINK = link
+TMAKE_LFLAGS = /NOLOGO /NOI
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG = /DEBUG
+TMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:console
+TMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:windows
+TMAKE_LFLAGS_CONSOLE_DLL= /SUBSYSTEM:console /DLL
+TMAKE_LFLAGS_WINDOWS_DLL= /SUBSYSTEM:windows /DLL
+
+TMAKE_LIBS =
+TMAKE_LIBS_CONSOLE =
+TMAKE_LIBS_WINDOWS = user32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib wsock32.lib
+TMAKE_LIBS_QT = $(QTDIR)\lib\qt.lib
+TMAKE_LIBS_QT_DLL = $(QTDIR)\lib\qtmain.lib
+TMAKE_LIBS_QT_OPENGL = $(QTDIR)\lib\qgl.lib
+TMAKE_LIBS_OPENGL = opengl32.lib
+
+TMAKE_MOC = moc
+
+TMAKE_LIB = lib /C /N /NOI /P:32
+TMAKE_RC = rc
+
+TMAKE_ZIP = zip -r -9
diff --git a/tmake/lib/win32-visage/app.t b/tmake/lib/win32-visage/app.t
new file mode 100755
index 0000000..fc4dc2c
--- /dev/null
+++ b/tmake/lib/win32-visage/app.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 applications.
+#!
+#$ Project('TMAKE_APP_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-visage/generic.t b/tmake/lib/win32-visage/generic.t
new file mode 100755
index 0000000..fd928ad
--- /dev/null
+++ b/tmake/lib/win32-visage/generic.t
@@ -0,0 +1,208 @@
+#!
+#! This is a tmake template for building Win32 applications or libraries.
+#!
+#${
+ if ( Config("qt") ) {
+ if ( $ENV{"QT_DLL"} && !$ENV{"QT_NODLL"} ) {
+ Project('TMAKE_QT_DLL = 1');
+ if ( Project("TARGET") eq "qt" ) {
+ Project('CONFIG += dll');
+ }
+ }
+ }
+ if ( Config("dll") || Project("TMAKE_APP_FLAG") ) {
+ Project('CONFIG -= staticlib');
+ Project('TMAKE_APP_OR_DLL = 1');
+ } else {
+ Project('CONFIG += staticlib');
+ }
+ if ( Config("warn_off") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_OFF');
+ } elsif ( Config("warn_on") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_ON');
+ }
+ if ( Config("debug") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_DEBUG');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_DEBUG');
+ } elsif ( Config("release") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_RELEASE');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_RELEASE');
+ }
+ if ( Config("qt") || Config("opengl") ) {
+ Project('CONFIG += windows' );
+ }
+ if ( Config("qt") ) {
+ $moc_aware = 1;
+ AddIncludePath(Project('TMAKE_INCDIR_QT'));
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
+ }
+ if ( Project("TARGET") eq "qt" ) {
+ if ( Project("TMAKE_QT_DLL") && !(Project("DEFINES") =~ /QT_NODLL/) ) {
+ Project('DEFINES *= QT_MAKEDLL');
+ }
+ } else {
+ if ( Project("TMAKE_QT_DLL") && !(Project("DEFINES") =~ /QT_NODLL/) ) {
+ Project('DEFINES *= QT_DLL');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
+ if ( (Project("DEFINES") =~ /QT_DLL/) ) {
+ my $qtver =FindHighestLibVersion($ENV{"QTDIR"} . "/lib", "qt");
+ Project("TMAKE_LIBS /= s/qt.lib/qt${qtver}.lib/");
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_DLL');
+ }
+ }
+ }
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
+ }
+ if ( Config("dll") ) {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE_DLL');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS_DLL');
+ if ( Project("TMAKE_LIB_FLAG") ) {
+ my $ver = Project("VERSION");
+ $ver =~ s/\.//g;
+ $project{"TARGET_EXT"} = "${ver}.dll";
+ } else {
+ $project{"TARGET_EXT"} = ".dll";
+ }
+ } else {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS');
+ if ( Project('TMAKE_APP_FLAG') ) {
+ $project{"TARGET_EXT"} = ".exe";
+ } else {
+ $project{"TARGET_EXT"} = ".lib";
+ }
+ }
+ if ( Config("windows") ) {
+ if ( Config("console") ) {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_WINDOWS_ANY');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_WINDOWS');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ }
+ Project('TMAKE_LIBS += $$LIBS');
+ Project('TMAKE_FILETAGS = HEADERS SOURCES DEF_FILE RC_FILE TARGET TMAKE_LIBS DESTDIR DLLDESTDIR $$FILETAGS');
+ foreach ( split(/\s/,Project('TMAKE_FILETAGS')) ) {
+ $project{$_} =~ s-[/\\]+-\\-g;
+ }
+ if ( Project('DEF_FILE') ) {
+ Project('TMAKE_LFLAGS *= /DEF:$$DEF_FILE');
+ }
+ if ( Project('RC_FILE') ) {
+ if ( Project('RES_FILE') ) {
+ tmake_error("Both .rc and .res file specified.\n" .
+ "Please specify one of them, not both.");
+ }
+ $project{"RES_FILE"} = $project{"RC_FILE"};
+ $project{"RES_FILE"} =~ s/\.rc$/.res/i;
+ Project('TARGETDEPS += $$RES_FILE');
+ }
+ if ( Project('RES_FILE') ) {
+ Project('TMAKE_LIBS *= $$RES_FILE');
+ }
+ StdInit();
+ $project{"DESTDIR"} = FixPath($project{"DESTDIR"});
+ if ( Project("VERSION") ) {
+ $project{"VER_MAJ"} = $project{"VERSION"};
+ $project{"VER_MAJ"} =~ s/\.\d+$//;
+ $project{"VER_MIN"} = $project{"VERSION"};
+ $project{"VER_MIN"} =~ s/^\d+\.//;
+ }
+#$}
+#!
+# Makefile for building #$ Expand("TARGET")
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+####### Compiler, tools and options
+
+CC = #$ Expand("TMAKE_CC");
+CFLAGS = #$ Expand("TMAKE_CFLAGS"); ExpandGlue("DEFINES","-D"," -D","");
+INCPATH = #$ ExpandGlue("INCPATH",'-I"','" -I"','"');
+#$ !Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LINK = #$ Expand("TMAKE_LINK");
+LFLAGS = #$ Expand("TMAKE_LFLAGS");
+LIBS = #$ Expand("TMAKE_LIBS");
+#$ !Project("TMAKE_APP_OR_DLL") && EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LIB = #$ Expand("TMAKE_LIB");
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+MOC = #$ Expand("TMAKE_MOC");
+
+ZIP = #$ Expand("TMAKE_ZIP");
+
+####### Files
+
+HEADERS = #$ ExpandList("HEADERS");
+SOURCES = #$ ExpandList("SOURCES");
+OBJECTS = #$ ExpandList("OBJECTS");
+SRCMOC = #$ ExpandList("SRCMOC");
+OBJMOC = #$ ExpandList("OBJMOC");
+DIST = #$ ExpandList("DISTFILES");
+TARGET = #$ ExpandGlue("TARGET",$project{"DESTDIR"},"",$project{"TARGET_EXT"});
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .c
+
+.cpp.obj:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+.cxx.obj:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+.cc.obj:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+.c.obj:
+ #$ Expand("TMAKE_COMPILE_IMP");
+
+####### Build rules
+
+all: #$ ExpandGlue("ALL_DEPS",""," "," "); $text .= '$(TARGET)';
+
+$(TARGET): $(OBJECTS) $(OBJMOC) #$ Expand("TARGETDEPS");
+#$ Project("TMAKE_APP_OR_DLL") || DisableOutput();
+$(TARGET): $(OBJECTS) $(LIBS) #$ Expand("TARGETDEPS");
+ $(LINK) -B"$(LFLAGS)" $(OBJECTS) $(LIBS) -Fe$(TARGET)
+#$ Project("TMAKE_APP_OR_DLL") || EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+ $(LIB) /OUT:$(TARGET) $(OBJECTS) $(OBJMOC)
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+#$ (Config("dll") && Project("DLLDESTDIR")) || DisableOutput();
+ -copy $(TARGET) #$ Expand("DLLDESTDIR");
+#$ (Config("dll") && Project("DLLDESTDIR")) || EnableOutput();
+#$ Project('RC_FILE') || DisableOutput();
+
+#$ Substitute("\$\$RES_FILE: \$\$RC_FILE\n\t\$\$TMAKE_RC \$\$RC_FILE");
+#$ Project('RC_FILE') || EnableOutput();
+
+moc: $(SRCMOC)
+
+#$ TmakeSelf();
+
+dist:
+ #$ Substitute('$(ZIP) $$PROJECT.zip $$PROJECT.pro $(SOURCES) $(HEADERS) $(DIST)');
+
+clean:
+ #$ ExpandGlue("OBJECTS","-del ","\n\t-del ","");
+ #$ ExpandGlue("SRCMOC" ,"-del ","\n\t-del ","");
+ #$ ExpandGlue("OBJMOC" ,"-del ","\n\t-del ","");
+ -del $(TARGET)
+ #$ ExpandGlue("CLEAN_FILES","-del ","\n\t-del ","");
+
+####### Compile
+
+#$ BuildObj(Project("OBJECTS"),Project("SOURCES"));
+#$ BuildMocObj(Project("OBJMOC"),Project("SRCMOC"));
+#$ BuildMocSrc(Project("HEADERS"));
+#$ BuildMocSrc(Project("SOURCES"));
diff --git a/tmake/lib/win32-visage/lib.t b/tmake/lib/win32-visage/lib.t
new file mode 100755
index 0000000..d8ac6c7
--- /dev/null
+++ b/tmake/lib/win32-visage/lib.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 libraries.
+#!
+#$ Project('TMAKE_LIB_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-visage/subdirs.t b/tmake/lib/win32-visage/subdirs.t
new file mode 100755
index 0000000..8b881ab
--- /dev/null
+++ b/tmake/lib/win32-visage/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Win32 template
+#$ IncludeTemplate("../win32/subdirs.t");
diff --git a/tmake/lib/win32-visage/tmake.conf b/tmake/lib/win32-visage/tmake.conf
new file mode 100755
index 0000000..3e20294
--- /dev/null
+++ b/tmake/lib/win32-visage/tmake.conf
@@ -0,0 +1,56 @@
+#
+# $Id$
+#
+# tmake configuration for Win32/IBM Visual Age
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = icc -C
+TMAKE_CFLAGS = -Q -Ft -Gd -Gm+ -qrtti=all
+TMAKE_CFLAGS_WARN_ON = -W3
+TMAKE_CFLAGS_WARN_OFF = -W0
+TMAKE_CFLAGS_RELEASE = -Gl+ -O -Oc+
+TMAKE_CFLAGS_DEBUG = -Fb* -Ti -Tm
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = $$TMAKE_CC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_INCDIR_QT = $(QTDIR)\include
+
+TMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo"$obj" $src
+TMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo"$@" $<
+TMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo"$obj" $src
+TMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo"$@" $<
+
+TMAKE_LINK = icc -Tdp $(CFLAGS)
+TMAKE_LFLAGS = -nologo -code:RX -data:RW -def -noe
+TMAKE_LFLAGS_RELEASE = -OPTF
+TMAKE_LFLAGS_DEBUG = -de -br
+TMAKE_LFLAGS_CONSOLE = -pmtype:vio
+TMAKE_LFLAGS_WINDOWS = -pmtype:pm
+TMAKE_LFLAGS_CONSOLE_DLL= -DLL
+TMAKE_LFLAGS_WINDOWS_DLL= -DLL
+
+TMAKE_LIBS =
+TMAKE_LIBS_CONSOLE =
+TMAKE_LIBS_WINDOWS = user32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib wsock32.lib
+TMAKE_LIBS_QT = $(QTDIR)\lib\qt.lib
+TMAKE_LIBS_QT_DLL = $(QTDIR)\lib\qtmain.lib
+TMAKE_LIBS_QT_OPENGL = $(QTDIR)\lib\qgl.lib
+TMAKE_LIBS_OPENGL = opengl32.lib glu32.lib
+
+TMAKE_MOC = moc
+
+TMAKE_LIB = ilib
+TMAKE_RC = rc
+
+TMAKE_ZIP = zip -r -9
diff --git a/tmake/lib/win32-watcom/app.t b/tmake/lib/win32-watcom/app.t
new file mode 100755
index 0000000..fc4dc2c
--- /dev/null
+++ b/tmake/lib/win32-watcom/app.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 applications.
+#!
+#$ Project('TMAKE_APP_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-watcom/generic.t b/tmake/lib/win32-watcom/generic.t
new file mode 100755
index 0000000..a8c3990
--- /dev/null
+++ b/tmake/lib/win32-watcom/generic.t
@@ -0,0 +1,202 @@
+#!
+#! This is a tmake template for building Win32 applications or libraries.
+#!
+#${
+ if ( Config("qt") ) {
+ if ( $ENV{"QT_DLL"} && !$ENV{"QT_NODLL"} ) {
+ Project('TMAKE_QT_DLL = 1');
+ if ( Project("TARGET") eq "qt" ) {
+ Project('CONFIG += dll');
+ }
+ }
+ }
+ if ( Config("dll") || Project("TMAKE_APP_FLAG") ) {
+ Project('CONFIG -= staticlib');
+ Project('TMAKE_APP_OR_DLL = 1');
+ } else {
+ Project('CONFIG += staticlib');
+ }
+ if ( Config("warn_off") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_OFF');
+ } elsif ( Config("warn_on") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_WARN_ON');
+ }
+ if ( Config("debug") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_DEBUG');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_DEBUG');
+ } elsif ( Config("release") ) {
+ Project('TMAKE_CFLAGS += $$TMAKE_CFLAGS_RELEASE');
+ Project('TMAKE_LFLAGS += $$TMAKE_LFLAGS_RELEASE');
+ }
+ if ( Config("qt") || Config("opengl") ) {
+ Project('CONFIG += windows' );
+ }
+ if ( Config("qt") ) {
+ $moc_aware = 1;
+ AddIncludePath(Project('TMAKE_INCDIR_QT'));
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
+ }
+ if ( Project("TARGET") eq "qt" ) {
+ if ( Project("TMAKE_QT_DLL") && !(Project("DEFINES") =~ /QT_NODLL/) ) {
+ Project('DEFINES *= QT_MAKEDLL');
+ }
+ } else {
+ if ( Project("TMAKE_QT_DLL") && !(Project("DEFINES") =~ /QT_NODLL/) ) {
+ Project('DEFINES *= QT_DLL');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
+ if ( (Project("DEFINES") =~ /QT_DLL/) ) {
+ my $qtver =FindHighestLibVersion($ENV{"QTDIR"} . "/lib", "qt");
+ Project("TMAKE_LIBS /= s/qt.lib/qt${qtver}.lib/");
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_DLL');
+ }
+ }
+ }
+ if ( Config("opengl") ) {
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
+ }
+ if ( Config("dll") ) {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE_DLL');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS_DLL');
+ if ( Project("TMAKE_LIB_FLAG") ) {
+ my $ver = Project("VERSION");
+ $ver =~ s/\.//g;
+ $project{"TARGET_EXT"} = "${ver}.dll";
+ } else {
+ $project{"TARGET_EXT"} = ".dll";
+ }
+ } else {
+ Project('TMAKE_LFLAGS_CONSOLE_ANY = $$TMAKE_LFLAGS_CONSOLE');
+ Project('TMAKE_LFLAGS_WINDOWS_ANY = $$TMAKE_LFLAGS_WINDOWS');
+ if ( Project('TMAKE_APP_FLAG') ) {
+ $project{"TARGET_EXT"} = ".exe";
+ } else {
+ $project{"TARGET_EXT"} = ".lib";
+ }
+ }
+ if ( Config("windows") ) {
+ if ( Config("console") ) {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_WINDOWS_ANY');
+ }
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_WINDOWS');
+ } else {
+ Project('TMAKE_LFLAGS *= $$TMAKE_LFLAGS_CONSOLE_ANY');
+ Project('TMAKE_LIBS *= $$TMAKE_LIBS_CONSOLE');
+ }
+ Project('TMAKE_LIBS += $$LIBS');
+ Project('TMAKE_FILETAGS = HEADERS SOURCES DEF_FILE RC_FILE TARGET TMAKE_LIBS DESTDIR DLLDESTDIR $$FILETAGS');
+ foreach ( split(/\s/,Project('TMAKE_FILETAGS')) ) {
+ $project{$_} =~ s-[/\\]+-\\-g;
+ }
+ if ( Project('DEF_FILE') ) {
+ Project('TMAKE_LFLAGS *= /DEF:$$DEF_FILE');
+ }
+ if ( Project('RC_FILE') ) {
+ if ( Project('RES_FILE') ) {
+ tmake_error("Both .rc and .res file specified.\n" .
+ "Please specify one of them, not both.");
+ }
+ $project{"RES_FILE"} = $project{"RC_FILE"};
+ $project{"RES_FILE"} =~ s/\.rc$/.res/i;
+ Project('TARGETDEPS += $$RES_FILE');
+ }
+ if ( Project('RES_FILE') ) {
+ Project('TMAKE_LIBS *= $$RES_FILE');
+ }
+ $linebreak = '&';
+ StdInit();
+ $project{"DESTDIR"} = FixPath($project{"DESTDIR"});
+ if ( Project("VERSION") ) {
+ $project{"VER_MAJ"} = $project{"VERSION"};
+ $project{"VER_MAJ"} =~ s/\.\d+$//;
+ $project{"VER_MIN"} = $project{"VERSION"};
+ $project{"VER_MIN"} =~ s/^\d+\.//;
+ }
+#$}
+#!
+# Makefile for building #$ Expand("TARGET")
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+####### Compiler, tools and options
+
+#$ Config("qt") || DisableOutput();
+QTDIR = #$ $text = $ENV{"QTDIR"};
+#$ Config("qt") || EnableOutput();
+CC = #$ Expand("TMAKE_CC");
+CFLAGS = #$ Expand("TMAKE_CFLAGS"); ExpandGlue("DEFINES","-d="," -d=","");
+INCPATH = #$ ExpandGlue("INCPATH","-i="," -i=","");
+#$ !Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LINK = #$ Expand("TMAKE_LINK");
+LFLAGS = #$ Expand("TMAKE_LFLAGS");
+LIBS = #$ Expand("TMAKE_LIBS");
+#$ !Project("TMAKE_APP_OR_DLL") && EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+LIB = #$ Expand("TMAKE_LIB");
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+MOC = #$ Expand("TMAKE_MOC");
+
+ZIP = #$ Expand("TMAKE_ZIP");
+
+####### Files
+
+HEADERS = #$ ExpandList("HEADERS");
+SOURCES = #$ ExpandList("SOURCES");
+OBJECTS = #$ ExpandList("OBJECTS");
+SRCMOC = #$ ExpandList("SRCMOC");
+OBJMOC = #$ ExpandList("OBJMOC");
+DIST = #$ ExpandList("DISTFILES");
+TARGET = #$ ExpandGlue("TARGET",$project{"DESTDIR"},"",$project{"TARGET_EXT"});
+TMPLIST = #$ ExpandGlue("TARGET","","",".lst");
+####### Build rules
+
+all: #$ ExpandGlue("ALL_DEPS",""," "," "); $text .= '$(TARGET)';
+
+$(TARGET): $(OBJECTS) $(OBJMOC) #$ Expand("TARGETDEPS");
+ @%create $(TMPLIST)
+#$ Project("TMAKE_APP_OR_DLL") || DisableOutput();
+ @%append $(TMPLIST) NAME #$ Expand("TARGET");
+ #$ ExpandGlue("OBJECTS",'@%append $(TMPLIST) FIL ',",","");
+ #$ ExpandGlue("OBJMOC" ,'@%append $(TMPLIST) FIL ',",","");
+ #$ ExpandGlue("TMAKE_LIBS" ,'@%append $(TMPLIST) LIBR ',",","");
+ $(LINK) $(LFLAGS) @$(TMPLIST)
+#$ Project("TMAKE_APP_OR_DLL") || EnableOutput();
+#$ Project("TMAKE_APP_OR_DLL") && DisableOutput();
+ @for %i in ( $(OBJECTS) $(OBJMOC) ) do @%append $(TMPLIST) +'%i'
+ $(LIB) $(TARGET) @$(TMPLIST)
+#$ Project("TMAKE_APP_OR_DLL") && EnableOutput();
+ del $(TMPLIST)
+#$ (Config("dll") && Project("DLLDESTDIR")) || DisableOutput();
+ -copy $(TARGET) #$ Expand("DLLDESTDIR");
+#$ (Config("dll") && Project("DLLDESTDIR")) || EnableOutput();
+#$ Project('RC_FILE') || DisableOutput();
+
+#$ Substitute("\$\$RES_FILE: \$\$RC_FILE\n\t\$\$TMAKE_RC \$\$RC_FILE");
+#$ Project('RC_FILE') || EnableOutput();
+
+moc: $(SRCMOC)
+
+#$ TmakeSelf();
+
+dist:
+ #$ Substitute('$(ZIP) $$PROJECT.zip $$PROJECT.pro $(SOURCES) $(HEADERS) $(DIST)');
+
+clean:
+ #$ ExpandGlue("OBJECTS","-del ","\n\t-del ","");
+ #$ ExpandGlue("SRCMOC" ,"-del ","\n\t-del ","");
+ #$ ExpandGlue("OBJMOC" ,"-del ","\n\t-del ","");
+ -del $(TARGET)
+ #$ ExpandGlue("CLEAN_FILES","-del ","\n\t-del ","");
+
+####### Compile
+
+#$ BuildObj(Project("OBJECTS"),Project("SOURCES"));
+#$ BuildMocObj(Project("OBJMOC"),Project("SRCMOC"));
+#$ BuildMocSrc(Project("HEADERS"));
+#$ BuildMocSrc(Project("SOURCES"));
diff --git a/tmake/lib/win32-watcom/lib.t b/tmake/lib/win32-watcom/lib.t
new file mode 100755
index 0000000..d8ac6c7
--- /dev/null
+++ b/tmake/lib/win32-watcom/lib.t
@@ -0,0 +1,6 @@
+#############################################################################
+#!
+#! This is a tmake template for building Win32 libraries.
+#!
+#$ Project('TMAKE_LIB_FLAG = 1');
+#$ IncludeTemplate("generic.t");
diff --git a/tmake/lib/win32-watcom/subdirs.t b/tmake/lib/win32-watcom/subdirs.t
new file mode 100755
index 0000000..8b881ab
--- /dev/null
+++ b/tmake/lib/win32-watcom/subdirs.t
@@ -0,0 +1,2 @@
+#! Use the common Win32 template
+#$ IncludeTemplate("../win32/subdirs.t");
diff --git a/tmake/lib/win32-watcom/tmake.conf b/tmake/lib/win32-watcom/tmake.conf
new file mode 100755
index 0000000..3a3e0bf
--- /dev/null
+++ b/tmake/lib/win32-watcom/tmake.conf
@@ -0,0 +1,54 @@
+#
+# $Id$
+#
+# tmake configuration for Win32/Watcom C++
+#
+
+TEMPLATE = app
+CONFIG = qt warn_on release
+
+TMAKE_CC = wcl386
+TMAKE_CFLAGS = -zq
+TMAKE_CFLAGS_WARN_ON = -w2
+TMAKE_CFLAGS_WARN_OFF = -w0
+TMAKE_CFLAGS_RELEASE = -ox
+TMAKE_CFLAGS_DEBUG = -d2
+TMAKE_CFLAGS_YACC =
+
+TMAKE_CXX = $$TMAKE_CC
+TMAKE_CXXFLAGS = $$TMAKE_CFLAGS
+TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON
+TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF
+TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE
+TMAKE_CXXFLAGS_DEBUG = $$TMAKE_CFLAGS_DEBUG
+TMAKE_CXXFLAGS_YACC = $$TMAKE_CFLAGS_YACC
+
+TMAKE_INCDIR =
+TMAKE_INCDIR_QT = $(QTDIR)\include
+
+TMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -fo=$obj $src
+TMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -fo=$obj $src
+
+TMAKE_LINK = wlink
+TMAKE_LFLAGS = op quiet op c
+TMAKE_LFLAGS_RELEASE =
+TMAKE_LFLAGS_DEBUG = d all
+TMAKE_LFLAGS_CONSOLE = sys nt
+TMAKE_LFLAGS_WINDOWS = sys nt_win
+TMAKE_LFLAGS_CONSOLE_DLL= sys nt
+TMAKE_LFLAGS_WINDOWS_DLL= sys nt_win
+
+TMAKE_LIBS =
+TMAKE_LIBS_CONSOLE =
+TMAKE_LIBS_WINDOWS =
+TMAKE_LIBS_QT = %QTDIR%\lib\qt.lib
+TMAKE_LIBS_QT_DLL = %QTDIR%\lib\qtmain.lib
+TMAKE_LIBS_QT_OPENGL = %QTDIR%\lib\qgl.lib
+TMAKE_LIBS_OPENGL = opengl32.lib
+
+TMAKE_MOC = moc
+
+TMAKE_LIB = wlib -b -c -n -q -p=512
+TMAKE_RC = rc
+
+TMAKE_ZIP = zip -r -9
diff --git a/tmake/lib/win32/subdirs.t b/tmake/lib/win32/subdirs.t
new file mode 100755
index 0000000..57464c6
--- /dev/null
+++ b/tmake/lib/win32/subdirs.t
@@ -0,0 +1,35 @@
+#############################################################################
+#!
+#! This is a tmake template for creating a makefile that invokes make in
+#! sub directories - for Win32.
+#!
+#${
+ StdInit();
+ $m = "";
+ foreach ( split(/\s+/,$project{"SUBDIRS"}) ) {
+ $m = $m . "\tcd $_\n\tDOMAKE\n\t\@cd ..\n";
+ }
+ $project{"SUBMAKE"} = $m;
+#$}
+#!
+# Makefile for building targets in sub directories.
+# Generated by tmake at #$ Now();
+# Project: #$ Expand("PROJECT");
+# Template: #$ Expand("TEMPLATE");
+#############################################################################
+
+SUBDIRS = #$ ExpandList("SUBDIRS");
+
+all: $(SUBDIRS)
+
+#${
+ foreach ( split(/\s+/,$project{"SUBDIRS"}) ) {
+ $text = $text . $_ . ": FORCE\n\t" .
+ "cd $_\n\t\$(MAKE\)\n\t\@cd ..\n\n";
+ }
+#$}
+
+clean:
+#$ $text = $project{"SUBMAKE"}; $text =~ s/DOMAKE/\$(MAKE\) clean/g;
+
+FORCE: