subdirs.t 1.4 KB
Newer Older
Dimitri van Heesch's avatar
Dimitri van Heesch committed
1 2 3 4 5 6 7 8 9 10 11 12
#############################################################################
#!
#! 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;
13 14
    Project('MAKEFILE') || Project('MAKEFILE = Makefile');
    Project('TMAKE') || Project('TMAKE = tmake');
Dimitri van Heesch's avatar
Dimitri van Heesch committed
15 16 17 18 19 20 21 22
#$}
#!
# Makefile for building targets in sub directories.
# Generated by tmake at #$ Now();
#     Project: #$ Expand("PROJECT");
#    Template: #$ Expand("TEMPLATE");
#############################################################################

23 24 25
MAKEFILE=	#$ Expand("MAKEFILE");
TMAKE	=	#$ Expand("TMAKE");

Dimitri van Heesch's avatar
Dimitri van Heesch committed
26 27 28 29 30 31
SUBDIRS =	#$ ExpandList("SUBDIRS");

all: $(SUBDIRS)

#${
    foreach ( split(/\s+/,$project{"SUBDIRS"}) ) {
32 33 34 35 36
	if ( Project("TMAKE_NOFORCE") ) {
	    $text = $text . $_ . ":\n\t" .
		"cd $_\n\t\$(MAKE\)\n\t\@cd ..\n\n";
	} else {
	    $text = $text . $_ . ": FORCE\n\t" .
Dimitri van Heesch's avatar
Dimitri van Heesch committed
37
		"cd $_\n\t\$(MAKE\)\n\t\@cd ..\n\n";
38 39 40 41 42 43 44 45 46
	}
    }
#$}
#$ TmakeSelf();

tmake_all:
#${
    foreach ( split(/\s+/,$project{"SUBDIRS"}) ) {
	$text .= "\tcd $_\n\t\$(TMAKE\) $_.pro -o \$(MAKEFILE)\n\t\@cd ..\n";
Dimitri van Heesch's avatar
Dimitri van Heesch committed
47 48 49 50 51
    }
#$}

clean:
#$ $text = $project{"SUBMAKE"}; $text =~ s/DOMAKE/\$(MAKE\) clean/g;
52
#$ Project("TMAKE_NOFORCE") && DisableOutput();
Dimitri van Heesch's avatar
Dimitri van Heesch committed
53
FORCE:
54
#$ Project("TMAKE_NOFORCE") && EnableOutput();