From eb621b54f97f9f50d117fc5ce8c8715b8f157337 Mon Sep 17 00:00:00 2001 From: Joshua Phillips Date: Wed, 7 Jan 2009 12:42:27 +0000 Subject: [PATCH] Moved modules to their own directory. --- SConscript | 29 ++++++++++++++--------------- SConstruct | 2 +- graph.c | 2 +- main.c | 2 +- modules/SConscript | 6 ++++++ convert.c => modules/convert.c | 0 mixer.c => modules/mixer.c | 0 modules.h => modules/modules.h | 0 playsink.c => modules/playsink.c | 0 ringmod.c => modules/ringmod.c | 0 wavesource.c => modules/wavesource.c | 0 11 files changed, 23 insertions(+), 18 deletions(-) rewrite SConscript (93%) create mode 100644 modules/SConscript rename convert.c => modules/convert.c (100%) rename mixer.c => modules/mixer.c (100%) rename modules.h => modules/modules.h (100%) rename playsink.c => modules/playsink.c (100%) rename ringmod.c => modules/ringmod.c (100%) rename wavesource.c => modules/wavesource.c (100%) diff --git a/SConscript b/SConscript dissimilarity index 93% index ff9b427..fb9fa4b 100644 --- a/SConscript +++ b/SConscript @@ -1,15 +1,14 @@ -import os.path -Import(['env']) - -programs = { - 'main': [ 'main.c', 'wavefile.c', 'soundout.c', 'aformat.c', 'sound-ioctl.c', - 'graph.c', 'errors.c', 'wavesource.c', 'playsink.c', 'buffer.c', - 'ringmod.c', 'convert.c', 'mixer.c'], -} - -objects = {} -for program in programs: - for source in programs[program]: - if source not in objects: - objects[source] = env.Object(source) - env.Program(program, [objects[i] for i in programs[program]]) +import os.path +Import(['env']) + +program = env.Program('main', +['main.c', 'wavefile.c', 'soundout.c', 'aformat.c', 'sound-ioctl.c', +'graph.c', 'errors.c', 'buffer.c'], +LIBS = env['LIBS'] + ['modules'], +LIBPATH = ['modules']) + +env.SConscript('modules/SConscript', + exports = ['env']) + +#env.Command('#aftubes', program, +# Copy('$TARGET', '$SOURCE')) diff --git a/SConstruct b/SConstruct index 11e04c9..f70870e 100644 --- a/SConstruct +++ b/SConstruct @@ -4,7 +4,6 @@ opts.AddOptions( PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'), PathOption('DESTDIR', 'Set the installation root', '/'), ('BUILDDIR', 'Set the sub-directory to put object files in', 'build'), - ('INCLUDE_DIRS', 'Set the default include directories to build into the compiler', '/include:/usr/include:/usr/local/include:/opt/include'), ('CC', 'Set the C compiler to use'), ('LINK', 'Set the linker to use'), ('CFLAGS', 'Change the flags for the compiler', '-Wall -std=c99 -pedantic -O3 -g -ffunction-sections'), @@ -17,6 +16,7 @@ Help(opts.GenerateHelpText(env)) opts.Save('scache.conf', env) env['LIBS'] = ['m'] +env['CPPPATH'] = ['#'] env['CPPDEFINES'] = {'_POSIX_SOURCE': None, '_GNU_SOURCE': None} # Pretty coloured output diff --git a/graph.c b/graph.c index 4bdbdb5..4bfdd7b 100644 --- a/graph.c +++ b/graph.c @@ -2,7 +2,7 @@ #include "errors.h" #include "stdlib.h" #include "string.h" -#include "modules.h" +#include "modules/modules.h" #include "assert.h" static struct graphpin *get_last_pin(struct graphnode *node) diff --git a/main.c b/main.c index 15665bc..17d7f59 100644 --- a/main.c +++ b/main.c @@ -1,7 +1,7 @@ #include "stdio.h" #include "soundout.h" #include "wavefile.h" -#include "modules.h" +#include "modules/modules.h" #include "graph.h" #include "errors.h" #include "assert.h" diff --git a/modules/SConscript b/modules/SConscript new file mode 100644 index 0000000..f556721 --- /dev/null +++ b/modules/SConscript @@ -0,0 +1,6 @@ +import os.path +Import(['env']) + +env.StaticLibrary('modules', +['playsink.c', 'wavesource.c', 'mixer.c', 'ringmod.c', +'convert.c']) diff --git a/convert.c b/modules/convert.c similarity index 100% rename from convert.c rename to modules/convert.c diff --git a/mixer.c b/modules/mixer.c similarity index 100% rename from mixer.c rename to modules/mixer.c diff --git a/modules.h b/modules/modules.h similarity index 100% rename from modules.h rename to modules/modules.h diff --git a/playsink.c b/modules/playsink.c similarity index 100% rename from playsink.c rename to modules/playsink.c diff --git a/ringmod.c b/modules/ringmod.c similarity index 100% rename from ringmod.c rename to modules/ringmod.c diff --git a/wavesource.c b/modules/wavesource.c similarity index 100% rename from wavesource.c rename to modules/wavesource.c -- 2.11.4.GIT