Merge pull request #1289 from wolfmanjm/feature/add-xy-maxspeed
[clinton/Smoothieware.git] / Rakefile
index 060147d..1e7536c 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -97,8 +97,6 @@ unless defined? NONETWORK
 end
 
 # list of modules to exclude, include directory it is in
-EXCLUDE_MODULES= %w(tools/touchprobe) unless defined? EXCLUDE_MODULES
-
 # e.g for a CNC machine
 #EXCLUDE_MODULES = %w(tools/touchprobe tools/laser tools/temperaturecontrol tools/extruder)
 
@@ -114,13 +112,26 @@ else
   nonetwork= false
 end
 
+# see if CNC build
+if ENV['CNC'] || CNC
+  cnc= true
+  excludes << 'panel\/screens\/3dprinter'
+  puts "CNC build"
+else
+  excludes << 'panel\/screens\/cnc'
+  cnc= false
+end
+
 if TESTING
   # add modules to be tested here
   TESTMODULES= %w(tools/temperatureswitch) unless defined? EXCLUDE_MODULES
   puts "Modules under test: #{TESTMODULES}"
   excludes << %w(Kernel.cpp main.cpp) # we replace these with mock versions in testframework
-  testmodules= FileList['src/testframework/*.{c,cpp}', 'src/testframework/easyunit/*.{c,cpp}', 'src/modules/communication/SerialConsole.cpp', 'src/modules/communication/utils/Gcode.cpp'].include(TESTMODULES.collect { |e| "src/modules/#{e}/**/*.{c,cpp}"}).include(TESTMODULES.collect { |e| "src/testframework/unittests/#{e}/*.{c,cpp}"})
-  SRC = FileList['src/libs/**/*.{c,cpp}'].exclude(/#{excludes.join('|')}/) + testmodules
+
+  frameworkfiles= FileList['src/testframework/*.{c,cpp}', 'src/testframework/easyunit/*.{c,cpp}']
+  extrafiles= FileList['src/modules/communication/SerialConsole.cpp', 'src/modules/communication/utils/Gcode.cpp', 'src/modules/robot/Conveyor.cpp', 'src/modules/robot/Block.cpp']
+  testmodules= FileList['src/libs/**/*.{c,cpp}'].include(TESTMODULES.collect { |e| "src/modules/#{e}/**/*.{c,cpp}"}).include(TESTMODULES.collect { |e| "src/testframework/unittests/#{e}/*.{c,cpp}"}).exclude(/#{excludes.join('|')}/)
+  SRC =  frameworkfiles + extrafiles + testmodules
 else
   excludes << %w(testframework)
   SRC = FileList['src/**/*.{c,cpp}'].exclude(/#{excludes.join('|')}/)
@@ -190,6 +201,7 @@ defines += MRI_DEFINES
 defines << "-DDEFAULT_SERIAL_BAUD_RATE=#{DEFAULT_SERIAL_BAUD_RATE}"
 defines << '-DDEBUG' if OPTIMIZATION == 0
 defines << '-DNONETWORK' if nonetwork
+defines << '-DCNC' if cnc
 
 DEFINES= defines.join(' ')
 
@@ -283,7 +295,7 @@ file "#{PROG}.bin" => ["#{PROG}.elf"] do
 end
 
 file "#{PROG}.elf" => OBJ do |t|
-  puts "Linking #{t.source}"
+  puts "Linking"
   sh "#{LD} #{LDFLAGS} #{OBJ} #{LIBS}  -o #{OBJDIR}/#{t.name}"
 end