root/branches/libffado-2.0/SConstruct

Revision 1661, 19.5 kB (checked in by arnonym, 14 years ago)

There seems to be something wrong with build_dir and multiple SConstruct files. No need to have some probably broken developer tool in the mostly stable branch...

Line 
1 #! /usr/bin/python
2 #
3 # Copyright (C) 2007-2008 Arnold Krille
4 # Copyright (C) 2007-2008 Pieter Palmers
5 # Copyright (C) 2008 Jonathan Woithe
6 #
7 # This file is part of FFADO
8 # FFADO = Free Firewire (pro-)audio drivers for linux
9 #
10 # FFADO is based upon FreeBoB.
11 #
12 # This program is free software: you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 2 of the License, or
15 # (at your option) version 3 of the License.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
24 #
25
26 FFADO_API_VERSION = "8"
27 FFADO_VERSION = "1.999.43"
28
29 import os
30 import re
31 from string import Template
32 import imp
33
34 if not os.path.isdir( "cache" ):
35         os.makedirs( "cache" )
36
37 opts = Options( "cache/options.cache" )
38
39 opts.AddOptions(
40         BoolOption( "DEBUG", """\
41 Toggle debug-build. DEBUG means \"-g -Wall\" and more, otherwise we will use
42   \"-O2\" to optimize.""", False ),
43         BoolOption( "PROFILE", "Build with symbols and other profiling info", False ),
44         PathOption( "PREFIX", "The prefix where ffado will be installed to.", "/usr/local", PathOption.PathAccept ),
45         PathOption( "BINDIR", "Overwrite the directory where apps are installed to.", "$PREFIX/bin", PathOption.PathAccept ),
46         PathOption( "LIBDIR", "Overwrite the directory where libs are installed to.", "$PREFIX/lib", PathOption.PathAccept ),
47         PathOption( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathOption.PathAccept ),
48         PathOption( "SHAREDIR", "Overwrite the directory where misc shared files are installed to.", "$PREFIX/share/libffado", PathOption.PathAccept ),
49         BoolOption( "ENABLE_BEBOB", "Enable/Disable the bebob part.", True ),
50         BoolOption( "ENABLE_FIREWORKS", "Enable/Disable the ECHO Audio FireWorks AV/C part.", True ),
51         BoolOption( "ENABLE_MOTU", "Enable/Disable the MOTU part.", True ),
52         BoolOption( "ENABLE_GENERICAVC", """\
53 Enable/Disable the the generic avc part (mainly used by apple).
54   Note that disabling this option might be overwritten by other devices needing
55   this code.""", False ),
56         BoolOption( "ENABLE_ALL", "Enable/Disable support for all devices.", False ),
57         BoolOption( "SERIALIZE_USE_EXPAT", "Use libexpat for XML serialization.", False ),
58         BoolOption( "BUILD_TESTS", """\
59 Build the tests in their directory. As some contain quite some functionality,
60   this is on by default.
61   If you just want to use ffado with jack without the tools, you can disable this.\
62 """, True ),
63     BoolOption( "BUILD_STATIC_TOOLS", "Build a statically linked version of the FFADO tools.", False ),
64     EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'powerpc64', 'none' ), ignorecase=2),
65     BoolOption( "ENABLE_OPTIMIZATIONS", "Enable optimizations and the use of processor specific extentions (MMX/SSE/...).", False ),
66
67         )
68
69 ## Load the builders in config
70 buildenv=os.environ
71 vars_to_check = [
72         'PATH',
73         'PKG_CONFIG_PATH',
74         'LD_LIBRARY_PATH',
75         'XDG_CONFIG_DIRS',
76         'XDG_DATA_DIRS',
77         'HOME',
78         'CC',
79         'CFLAGS',
80         'CXX',
81         'CXXFLAGS',
82         'CPPFLAGS',
83 ]
84 for var in vars_to_check:
85         if os.environ.has_key(var):
86                 buildenv[var]=os.environ[var]
87         else:
88                 buildenv[var]=''
89
90 env = Environment( tools=['default','scanreplace','pyuic','pyuic4','dbus','doxygen','pkgconfig'], toolpath=['admin'], ENV = buildenv, options=opts )
91
92 if os.environ.has_key('LDFLAGS'):
93         env['LINKFLAGS'] = os.environ['LDFLAGS']
94
95 # grab OS CFLAGS / CCFLAGS
96 env['OS_CFLAGS']=[]
97 if os.environ.has_key('CFLAGS'):
98         env['OS_CFLAGS'] = os.environ['CFLAGS']
99 env['OS_CCFLAGS']=[]
100 if os.environ.has_key('CCFLAGS'):
101         env['OS_CCFLAGS'] = os.environ['CCFLAGS']
102
103 Help( """
104 For building ffado you can set different options as listed below. You have to
105 specify them only once, scons will save the last value you used and re-use
106 that.
107 To really undo your settings and return to the factory defaults, remove the
108 "cache"-folder and the file ".sconsign.dblite" from this directory.
109 For example with: "rm -Rf .sconsign.dblite cache"
110
111 Note that this is a development version! Don't complain if its not working!
112 See www.ffado.org for stable releases.
113 """ )
114 Help( opts.GenerateHelpText( env ) )
115
116 # make sure the necessary dirs exist
117 if not os.path.isdir( "cache" ):
118         os.makedirs( "cache" )
119 if not os.path.isdir( 'cache/objects' ):
120         os.makedirs( 'cache/objects' )
121
122 CacheDir( 'cache/objects' )
123
124 opts.Save( 'cache/options.cache', env )
125
126 def ConfigGuess( context ):
127         context.Message( "Trying to find the system triple: " )
128         ret = os.popen( "admin/config.guess" ).read()[:-1]
129         context.Result( ret )
130         return ret
131
132 def CheckForApp( context, app ):
133         context.Message( "Checking whether '" + app + "' executes " )
134         ret = context.TryAction( app )
135         context.Result( ret[0] )
136         return ret[0]
137
138 def CheckForPyModule( context, module ):
139         context.Message( "Checking for the python module '" + module + "' " )
140         ret = context.TryAction( "python $SOURCE", "import %s" % module, ".py" )
141         context.Result( ret[0] )
142         return ret[0]
143
144 def CompilerCheck( context ):
145         context.Message( "Checking for a working C-compiler " )
146         ret = context.TryRun( """
147 #include <stdlib.h>
148
149 int main() {
150         printf( "Hello World!" );
151         return 0;
152 }""", '.c' )[0]
153         context.Result( ret )
154         if ret == 0:
155                 return False;
156         context.Message( "Checking for a working C++-compiler " )
157         ret = context.TryRun( """
158 #include <iostream>
159
160 int main() {
161         std::cout << "Hello World!" << std::endl;
162         return 0;
163 }""", ".cpp" )[0]
164         context.Result( ret )
165         return ret
166
167 tests = {
168         "ConfigGuess" : ConfigGuess,
169         "CheckForApp" : CheckForApp,
170         "CheckForPyModule": CheckForPyModule,
171         "CompilerCheck" : CompilerCheck,
172 }
173 tests.update( env['PKGCONFIG_TESTS'] )
174 tests.update( env['PYUIC_TESTS'] )
175 tests.update( env['PYUIC4_TESTS'] )
176
177 conf = Configure( env,
178         custom_tests = tests,
179         conf_dir = "cache/",
180         log_file = 'cache/config.log' )
181
182 if env['SERIALIZE_USE_EXPAT']:
183         env['SERIALIZE_USE_EXPAT']=1
184 else:
185         env['SERIALIZE_USE_EXPAT']=0
186
187 if not env.GetOption('clean'):
188         #
189         # Check for working gcc and g++ compilers and their environment.
190         #
191         if not conf.CompilerCheck():
192                 print "\nIt seems as if your system isn't even able to compile any C-/C++-programs. Probably you don't have gcc and g++ installed. Compiling a package from source without a working compiler is very hard to do, please install the needed packages.\nHint: on *ubuntu you need both gcc- and g++-packages installed, easiest solution is to install build-essential which depends on gcc and g++."
193                 Exit( 1 )
194
195         # Check for pkg-config before using pkg-config to check for other dependencies.
196         if not conf.CheckForPKGConfig():
197                 print "\nThe program 'pkg-config' could not be found.\nEither you have to install the corresponding package first or make sure that PATH points to the right directions."
198                 Exit( 1 )
199
200         #
201         # The following checks are for headers and libs and packages we need.
202         #
203         allpresent = 1;
204         # for DBUS C++ bindings
205         allpresent &= conf.CheckHeader( "expat.h" )
206         allpresent &= conf.CheckLib( 'expat', 'XML_ExpatVersion', '#include <expat.h>' )
207        
208         pkgs = {
209                 'libraw1394' : '1.3.0',
210                 'libiec61883' : '1.1.0',
211                 'dbus-1' : '1.0',
212                 }
213         if not env['SERIALIZE_USE_EXPAT']:
214                 pkgs['libxml++-2.6'] = '2.13.0'
215
216         for pkg in pkgs:
217                 name2 = pkg.replace("+","").replace(".","").replace("-","").upper()
218                 env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] )
219                 if env['%s_FLAGS'%name2] == 0:
220                         allpresent &= 0
221
222         if not allpresent:
223                 print """
224 (At least) One of the dependencies is missing. I can't go on without it, please
225 install the needed packages for each of the lines saying "no".
226 (Remember to also install the *-devel packages!)
227
228 And remember to remove the cache with "rm -Rf .sconsign.dblite cache" so the
229 results above get rechecked.
230 """
231                 Exit( 1 )
232
233         # Check for C99 lrint() and lrintf() functions used to convert from
234         # float to integer more efficiently via float_cast.h.  If not
235         # present the standard slower methods will be used instead.  This
236         # might not be the best way of testing for these but it's the only
237         # way which seems to work properly.  CheckFunc() fails due to
238         # argument count problems.
239         if env.has_key( 'CFLAGS' ):
240                 oldcf = env['CFLAGS']
241         else:
242                 oldcf = ""
243         oldcf = env.Append(CFLAGS = '-std=c99')
244         if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);" ):
245                 HAVE_LRINT = 1
246         else:
247                 HAVE_LRINT = 0
248         if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);" ):
249                 HAVE_LRINTF = 1
250         else:
251                 HAVE_LRINTF = 0
252         env['HAVE_LRINT'] = HAVE_LRINT;
253         env['HAVE_LRINTF'] = HAVE_LRINTF;
254         env.Replace(CFLAGS=oldcf)
255
256 #
257 # Optional checks follow:
258 #
259
260 # PyQT checks
261 build_mixer = False
262 if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ):
263         env['PYUIC4'] = True
264         build_mixer = True
265
266 if conf.CheckForApp( 'which pyuic' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'qt' ):
267         env['PYUIC'] = True
268         build_mixer = True
269
270 if conf.CheckForApp( 'xdg-desktop-menu --help' ):
271         env['XDG_TOOLS'] = True
272 else:
273         print """
274 I couldn't find the program 'xdg-desktop-menu'. Together with xdg-icon-resource
275 this is needed to add the fancy entry to your menu. But the mixer will be installed, you can start it by executing "ffado-mixer".
276 """
277
278 if not build_mixer and not env.GetOption('clean'):
279         print """
280 I couldn't find all the prerequisites ('pyuic' / 'pyuic4' and the python-modules 'dbus' and
281 'qt' / 'PyQt4', the packages could be named like dbus-python and PyQt) to build the mixer.
282 Therefor neither the qt3 nor the qt4 mixer will get installed.
283 """
284
285 config_guess = conf.ConfigGuess()
286
287 env = conf.Finish()
288
289 if env['DEBUG']:
290         print "Doing a DEBUG build"
291         env.MergeFlags( "-DDEBUG -Wall -g" )
292 else:
293         env.MergeFlags( "-O2 -DNDEBUG" )
294
295 if env['PROFILE']:
296         print "Doing a PROFILE build"
297         env.MergeFlags( "-Wall -g" )
298
299
300 # this is required to indicate that the DBUS version we use has support
301 # for platform dependent threading init functions
302 # this is true for DBUS >= 0.96 or so. Since we require >= 1.0 it is
303 # always true
304 env.MergeFlags( "-DDBUS_HAS_THREADS_INIT_DEFAULT" )
305
306 if env['ENABLE_ALL']:
307         env['ENABLE_BEBOB'] = True
308         env['ENABLE_FIREWORKS'] = True
309         env['ENABLE_MOTU'] = True
310
311 if env['ENABLE_BEBOB'] or env['ENABLE_FIREWORKS']:
312         env['ENABLE_GENERICAVC'] = True
313
314 env['BUILD_STATIC_LIB'] = False
315 if env['BUILD_STATIC_TOOLS']:
316     print "Building static versions of the tools..."
317     env['BUILD_STATIC_LIB'] = True
318
319 env['build_base']="#/"
320
321 #
322 # Get the DESTDIR (if wanted) from the commandline
323 #
324 env.destdir = ARGUMENTS.get( 'DESTDIR', "" )
325
326 #
327 # Uppercase variables are for usage in code, lowercase versions for usage in
328 # scons-files for installing.
329 #
330 env['BINDIR'] = Template( env['BINDIR'] ).safe_substitute( env )
331 env['LIBDIR'] = Template( env['LIBDIR'] ).safe_substitute( env )
332 env['INCLUDEDIR'] = Template( env['INCLUDEDIR'] ).safe_substitute( env )
333 env['SHAREDIR'] = Template( env['SHAREDIR'] ).safe_substitute( env )
334 env['bindir'] = Template( env.destdir + env['BINDIR'] ).safe_substitute( env )
335 env['libdir'] = Template( env.destdir + env['LIBDIR'] ).safe_substitute( env )
336 env['includedir'] = Template( env.destdir + env['INCLUDEDIR'] ).safe_substitute( env )
337 env['sharedir'] = Template( env.destdir + env['SHAREDIR'] ).safe_substitute( env )
338
339 env.Command( target=env['sharedir'], source="", action=Mkdir( env['sharedir'] ) )
340
341 env.Alias( "install", env['libdir'] )
342 env.Alias( "install", env['includedir'] )
343 env.Alias( "install", env['sharedir'] )
344 env.Alias( "install", env['bindir'] )
345
346 #
347 # shamelessly copied from the Ardour scons file
348 #
349
350 opt_flags = []
351 env['USE_SSE'] = 0
352
353 # guess at the platform, used to define compiler flags
354
355 config_cpu = 0
356 config_arch = 1
357 config_kernel = 2
358 config_os = 3
359 config = config_guess.split ("-")
360
361 needs_fPIC = False
362
363 # Autodetect
364 if env['DIST_TARGET'] == 'auto':
365     if re.search ("x86_64", config[config_cpu]) != None:
366         env['DIST_TARGET'] = 'x86_64'
367     elif re.search("i[0-5]86", config[config_cpu]) != None:
368         env['DIST_TARGET'] = 'i386'
369     elif re.search("powerpc64", config[config_cpu]) != None:
370         env['DIST_TARGET'] = 'powerpc64'
371     elif re.search("powerpc", config[config_cpu]) != None:
372         env['DIST_TARGET'] = 'powerpc'
373     else:
374         env['DIST_TARGET'] = 'i686'
375     print "Detected DIST_TARGET = " + env['DIST_TARGET']
376
377 if ((re.search ("i[0-9]86", config[config_cpu]) != None) or (re.search ("x86_64", config[config_cpu]) != None) or (re.search ("powerpc", config[config_cpu]) != None)):
378    
379     build_host_supports_sse = 0
380     build_host_supports_sse2 = 0
381     build_host_supports_sse3 = 0
382
383     if config[config_kernel] == 'linux' :
384        
385         if (env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64'):
386            
387             flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
388             x86_flags = flag_line.split (": ")[1:][0].split ()
389            
390             if "mmx" in x86_flags:
391                 opt_flags.append ("-mmmx")
392             if "sse" in x86_flags:
393                 build_host_supports_sse = 1
394             if "sse2" in x86_flags:
395                 build_host_supports_sse2 = 1
396             #if "sse3" in x86_flags:
397                 #build_host_supports_sse3 = 1
398             if "3dnow" in x86_flags:
399                 opt_flags.append ("-m3dnow")
400            
401             if config[config_cpu] == "i586":
402                 opt_flags.append ("-march=i586")
403             elif config[config_cpu] == "i686":
404                 opt_flags.append ("-march=i686")
405
406         elif (env['DIST_TARGET'] == 'powerpc') or (env['DIST_TARGET'] == 'powerpc64'):
407
408             cpu_line = os.popen ("cat /proc/cpuinfo | grep '^cpu'").read()[:-1]
409
410             ppc_type = cpu_line.split (": ")[1]
411             if re.search ("altivec", ppc_type) != None:
412                 opt_flags.append ("-maltivec")
413                 opt_flags.append ("-mabi=altivec")
414
415             ppc_type = ppc_type.split (", ")[0]
416             if re.match ("74[0145][0578]A?", ppc_type) != None:
417                 opt_flags.append ("-mcpu=7400")
418                 opt_flags.append ("-mtune=7400")
419             elif re.match ("750", ppc_type) != None:
420                 opt_flags.append ("-mcpu=750")
421                 opt_flags.append ("-mtune=750")
422             elif re.match ("PPC970", ppc_type) != None:
423                 opt_flags.append ("-mcpu=970")
424                 opt_flags.append ("-mtune=970")
425             elif re.match ("Cell Broadband Engine", ppc_type) != None:
426                 opt_flags.append ("-mcpu=cell")
427                 opt_flags.append ("-mtune=cell")
428
429     if ((env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64')) \
430        and build_host_supports_sse and env['ENABLE_OPTIMIZATIONS']:
431         opt_flags.extend (["-msse", "-mfpmath=sse"])
432         env['USE_SSE'] = 1
433
434     if ((env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64')) \
435        and build_host_supports_sse2 and env['ENABLE_OPTIMIZATIONS']:
436         opt_flags.extend (["-msse2"])
437         env['USE_SSE2'] = 1
438
439     #if ((env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64')) \
440        #and build_host_supports_sse2 and env['ENABLE_OPTIMIZATIONS']:
441         #opt_flags.extend (["-msse3"])
442         #env['USE_SSE3'] = 1
443
444     # build for 64-bit userland?
445     if env['DIST_TARGET'] == "powerpc64":
446         print "Doing a 64-bit PowerPC build"
447         env.MergeFlags( "-m64" )
448     elif env['DIST_TARGET'] == "x86_64":
449         print "Doing a 64-bit x86 build"
450         env.MergeFlags( "-m64" )
451         needs_fPIC = True
452     else:
453         print "Doing a 32-bit build"
454         env.MergeFlags( "-m32" )
455
456 if needs_fPIC or '-fPIC' in env['OS_CFLAGS'] or "-fPIC" in env['OS_CCFLAGS']:
457     env.MergeFlags( "-fPIC" )
458
459 # end of processor-specific section
460 if env['ENABLE_OPTIMIZATIONS']:
461     opt_flags.extend (["-fomit-frame-pointer","-ffast-math","-funroll-loops"])
462     env.MergeFlags( opt_flags )
463     print "Doing an optimized build..."
464
465 env['REVISION'] = os.popen('svnversion .').read()[:-1]
466 # This may be as simple as '89' or as complex as '4123:4184M'.
467 # We'll just use the last bit.
468 env['REVISION'] = env['REVISION'].split(':')[-1]
469
470 # try to circumvent localized versions
471 if len(env['REVISION']) >= 5 and env['REVISION'][0:6] == 'export':
472         env['REVISION'] = ''
473
474 # avoid the 1.999.41- type of version for exported versions
475 if env['REVISION'] != '':
476         env['REVISIONSTRING'] = '-' + env['REVISION']
477 else:
478         env['REVISIONSTRING'] = ''
479
480 env['FFADO_API_VERSION'] = FFADO_API_VERSION
481
482 env['PACKAGE'] = "libffado"
483 env['VERSION'] = FFADO_VERSION
484 env['LIBVERSION'] = "1.0.0"
485
486 env['CONFIGDIR'] = "~/.ffado"
487 env['CACHEDIR'] = "~/.ffado"
488
489 env['USER_CONFIG_FILE'] = env['CONFIGDIR'] + "/configuration"
490 env['SYSTEM_CONFIG_FILE'] = env['SHAREDIR'] + "/configuration"
491
492 env['REGISTRATION_URL'] = "http://ffado.org/deviceregistration/register.php?action=register"
493
494 #
495 # To have the top_srcdir as the doxygen-script is used from auto*
496 #
497 env['top_srcdir'] = env.Dir( "." ).abspath
498
499 #
500 # Start building
501 #
502 env.ScanReplace( "config.h.in" )
503 # ensure that the config.h is updated with the version
504
505 env.Depends( "config.h", "SConstruct" )
506 env.Depends( "config.h", 'cache/options.cache' )
507
508 # update config.h whenever the SVN revision changes
509 env.Depends( "config.h", env.Value(env['REVISION']))
510
511 env.Depends( "libffado.pc", "SConstruct" )
512 pkgconfig = env.ScanReplace( "libffado.pc.in" )
513 env.Install( env['libdir'] + '/pkgconfig', pkgconfig )
514
515 env.Install( env['sharedir'], 'configuration' )
516
517 subdirs=['external','src','libffado','support','doc']
518 if env['BUILD_TESTS']:
519         subdirs.append('tests')
520
521 env.SConscript( dirs=subdirs, exports="env" )
522
523 # By default only src is built but all is cleaned
524 if not env.GetOption('clean'):
525     Default( 'src' )
526     Default( 'support' )
527     if env['BUILD_TESTS']:
528         Default( 'tests' )
529
530 #
531 # Deal with the DESTDIR vs. xdg-tools conflict (which is basicely that the
532 # xdg-tools can't deal with DESTDIR, so the packagers have to deal with this
533 # their own :-/
534 #
535 if len(env.destdir) > 0:
536         if not len( ARGUMENTS.get( "WILL_DEAL_WITH_XDG_MYSELF", "" ) ) > 0:
537                 print """
538 WARNING!
539 You are using the (packagers) option DESTDIR to install this package to a
540 different place than the real prefix. As the xdg-tools can't cope with
541 that, the .desktop-files are not installed by this build, you have to
542 deal with them your own.
543 (And you have to look into the SConstruct to learn how to disable this
544 message.)
545 """
546 else:
547
548         def CleanAction( action ):
549                 if env.GetOption( "clean" ):
550                         env.Execute( action )
551
552         if env.has_key( 'XDG_TOOLS' ) and env.has_key( 'PYUIC4' ):
553                 if not env.GetOption("clean"):
554                         action = "install"
555                 else:
556                         action = "uninstall"
557                 mixerdesktopaction = env.Action( "xdg-desktop-menu %s support/xdg/ffado.org-ffadomixer.desktop" % action )
558                 mixericonaction = env.Action( "xdg-icon-resource %s --size 64 --novendor --context apps support/xdg/hi64-apps-ffado.png ffado" % action )
559                 env.Command( "__xdgstuff1", None, mixerdesktopaction )
560                 env.Command( "__xdgstuff2", None, mixericonaction )
561                 env.Alias( "install", ["__xdgstuff1", "__xdgstuff2" ] )
562                 CleanAction( mixerdesktopaction )
563                 CleanAction( mixericonaction )
564
565 #
566 # Create a tags-file for easier emacs/vim-source-browsing
567 #  I don't know if the dependency is right...
568 #
569 findcommand = "find . \( -path \"*.h\" -o -path \"*.cpp\" -o -path \"*.c\" \) \! -path \"*.svn*\" \! -path \"./doc*\" \! -path \"./cache*\""
570 env.Command( "tags", "", findcommand + " |xargs ctags" )
571 env.Command( "TAGS", "", findcommand + " |xargs etags" )
572 env.AlwaysBuild( "tags", "TAGS" )
573 if 'NoCache' in dir(env):
574     env.NoCache( "tags", "TAGS" )
575
576 # Another convinience target
577 if env.GetOption( "clean" ):
578         env.Execute( "rm cache/objects -Rf" )
579
Note: See TracBrowser for help on using the browser.