From: Michael D. Lowis Date: Sun, 20 Jul 2014 16:25:54 +0000 (-0400) Subject: Build library files with the main project X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=6e53b8af04f187ab13951c03f703d1a433ab81a3;p=archive%2Fafm.git Build library files with the main project --- diff --git a/Rakefile b/Rakefile index 82271cb..e7260f5 100644 --- a/Rakefile +++ b/Rakefile @@ -9,11 +9,19 @@ rescue Bundler::BundlerError => e end require 'rscons' +#------------------------------------------------------------------------------ +# Checkout Git Submodules +#------------------------------------------------------------------------------ +if Dir['modules/**/.git'].length == 0 + sh 'git submodule update --init' +end + #------------------------------------------------------------------------------ # Build Environment #------------------------------------------------------------------------------ Env = Rscons::Environment.new do |env| - env['CFLAGS'] += ['-Wall', '-Werror'] + env['CPPPATH'] += Dir['modules/data-structures/source/**/'] + #env['CFLAGS'] += ['-Wall', '-Werror'] env['LIBS'] = ['ncurses'] end at_exit { Env.process } @@ -24,9 +32,14 @@ at_exit { Env.process } task :default => [:build] desc "Build the AFM release binary" -task :build do - Env.Program('build/afm', Dir['source/**/*.c']) +task :build => ['modules/data-structures/source'] do + Env.Program('build/afm', Dir['source/**/*.c', 'modules/data-structures/source/**/*.c']) end desc "Remove all generate artifacts and directories" task(:clean) { Rscons.clean } + +desc "Remove all generated artifacts and directories as well as any git submodules" +task :clobber => [:clean] do + sh 'git submodule deinit -f .' +end