File: compile_tree.fal

package info (click to toggle)
falconpl 0.9.6.9-git20120606-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 46,176 kB
  • sloc: cpp: 181,389; ansic: 109,025; yacc: 2,310; xml: 1,218; sh: 403; objc: 245; makefile: 82; sql: 20
file content (50 lines) | stat: -rw-r--r-- 1,140 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
   FALCON - DevTools

   FILE: compile_tree.fal

   Compiles all the scripts in a tree.

   This script can be called after temporary or complete installation
   on systems with hand-made distributions to generate .fam modules
   out of the installed hierarcy of scripts.
   
   -------------------------------------------------------------------
   Author: Giancarlo Niccolai
   Begin: Sun, 13 Apr 2008 23:26:44 +0200

   -------------------------------------------------------------------
   (C) Copyright 2010: the FALCON developers (see list in AUTHORS file)

   See LICENSE file for licensing details.
*/

load process

if args.len() != 1
	> "Usage: compile_tree.fal <path_name>"
end

try
	dir = Directory( args[0] )
	dir.descend( nil, compileFal )
	dir.close()
	> "Done."
	return 0
catch IoError in e
	> "Can't open required directory: ", args[0]
	return 1
end

function compileFal( fname )
	if fname.endsWith( ".fal" ) or fname.endsWith( ".ftd" )
		> "Making ", fname
		try
			famname = fname[0:-4]+".fam"
			system( @"falcon -o \"$famname\" -c \"$fname\"")
		catch in e
			> "Error while compiling ", fname
			> e
		end
	end
end