diff --git a/AVRsack/BuildProject b/AVRsack/BuildProject index af3a71c..f77ec79 100755 --- a/AVRsack/BuildProject +++ b/AVRsack/BuildProject @@ -56,6 +56,7 @@ end LIBRARIES = Rake::FileList[] CORES = Rake::FileList[] +SKETCHES = Rake::FileList[] def parseInoFiles CORES.add(BUILD['core_path']) @@ -66,6 +67,10 @@ def parseInoFiles inName = ARGV[arg] inName = inName.pathmap("../../%p") unless inName =~ %r|^/| if inName =~ /\.ino$/ + inDir = inName.pathmap("%d") + if !SKETCHES.include?(inDir) + SKETCHES.add(inDir) + end outName = inName.pathmap("sketch/%n.cpp") outFile = File.open(outName, 'w') File.open(inName, 'r') do |ino| @@ -125,13 +130,13 @@ parseInoFiles File.open("Rakefile", 'w') do |rakeFile| SOURCES = Rake::FileList.new(ARGV).select {|f| f =~ /\.(c|cpp|cp|cxx|S)$/} - INCLUDES= (CORES+LIBRARIES).map {|l| " +\n \" -I'#{l}'\""}.join('') + INCLUDES= (SKETCHES+CORES+LIBRARIES).map {|l| " +\n \" -I'#{l}'\""}.join('') rakeFile.print <