Rob T wrote: > On Tuesday, 30 October 2012 at 09:42:50 UTC, Russel Winder wrote: >> I would suggest you haven't given SCons long enough to get into the >> SCons idioms, but you have to go with the route that is most comfortable >> for you. > > You are right, I'll shut up and keep at it. I get frustrated sometimes, > but that's no reason to vent in here. Sorry. > >> I do not see why you need to scan subfolders recursively. This is a >> traditional Make approach. SCons does things differently even for highly >> hierarchical systems. In particular use of SConscript files handles >> everything. So I do not think this is a SCons problem. > > The only reason is to automate the construction of a list of source > files for building. I'm used to using automated build scripts, which > require only a minimal of manual input. For example, if I add a new > source file to the mix, then I am expecting to not have to modify a > SConstruct file to include it. > > I see mention of placing a SConsript file in each subdir, but that's a > fair amount of manual overhead to bother with. so there must be another > way? >
The following SConstruct will scan all subfolders of the current
folder for d sources and compile them into a "foo" program.
==============================8<------------------------------
import os
sources = []
for dirpath, dirnames, filenames in os.walk ("."):
sources += [ os.path.join (dirpath, f)
for f in filenames
if f.endswith (".d") ]
Program ("foo", sources)
------------------------------>8==============================
Jerome
--
mailto:[email protected]
http://jeberger.free.fr
Jabber: [email protected]
signature.asc
Description: OpenPGP digital signature
