Created
September 19, 2011 23:12
-
-
Save DavidMikeSimon/1227871 to your computer and use it in GitHub Desktop.
SCons for Efene Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dave@Molly-Ubuntu:~/carwave$ scons -Q --tree=all | |
| scons: `.' is up to date. | |
| +-. | |
| +-SConstruct | |
| +-ebin | |
| | +-ebin/carwave_app.beam | |
| | | +-src/carwave_app.ifn | |
| | | +-src/carwave_server.ifn | |
| | | +-src/carwave_sup.ifn | |
| | +-ebin/carwave_server.beam | |
| | | +-src/carwave_app.ifn | |
| | | +-src/carwave_server.ifn | |
| | | +-src/carwave_sup.ifn | |
| | +-ebin/carwave_sup.beam | |
| | +-src/carwave_app.ifn | |
| | +-src/carwave_server.ifn | |
| | +-src/carwave_sup.ifn | |
| +-src | |
| +-src/carwave_app | |
| +-src/carwave_app.ifn | |
| +-src/carwave_server.ifn | |
| +-src/carwave_sup.ifn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| def efene_build(target, source, env): | |
| if len(target) == 0: | |
| raise StandardError('No targets!') | |
| if len(target) != len(source): | |
| raise StandardError('Source list and target list different lengths!') | |
| for t in target: | |
| target_dir, target_base = os.path.split(str(t)) | |
| target_name, target_ext = os.path.splitext(target_base) | |
| if target_dir != "ebin": | |
| raise StandardError("Invalid target directory for %s" % str(t)) | |
| if target_ext != ".beam": | |
| raise StandardError("Invalid target extension for %s" % str(t)) | |
| found_source = False | |
| for s in source: | |
| if os.path.splitext(os.path.basename(str(s)))[0] == target_name: | |
| found_source = True | |
| break | |
| if not found_source: | |
| raise StandardError("Couldn't find matching source for target %s" % str(t)) | |
| return env.Execute("fnc %s -o ebin" % " ".join([str(s) for s in source])) | |
| def efene_emitter(target, source, env): | |
| new_target = [] | |
| for s in source: | |
| tgt_name = os.path.join("ebin", os.path.splitext(os.path.basename(str(s)))[0] + ".beam") | |
| new_target.append(tgt_name) | |
| return new_target, source | |
| env = Environment(ENV = os.environ) | |
| env['BUILDERS']['Efene'] = Builder(action = efene_build, emitter = efene_emitter, suffix = '.beam') | |
| env.Efene(Glob('src/*')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment