# Get IDE version
if os.path.exists(arduino_home + '/lib/version.txt'):
vf = open(arduino_home + '/lib/version.txt', 'r')
- version = vf.readline().replace('.', '')
+ version = vf.readline().replace('.', '').strip()
else:
print '''
************************************* Error ***********************************
env.AppendUnique(LIBS = 'm')
env.Replace(ARCOM = '$AR ' + platform_info.get('compiler.ar.flags') + ' $TARGET $SOURCES')
+# Make sure the .d files are removed when clean the build
+if env.GetOption('clean'):
+ dfs = __search_files(env.get('BUILD_DIR'), '*.d')
+ for df in dfs:
+ Execute(Delete(df))
+
env.AddMethod(__import_lib, "ImportLib") #import arduino library
env.AddMethod(__build_core, "BuildCore") #build arduino core
env.AddMethod(__create_bin, "CreateBin") #create binary files(.eep and .hex)
arduino_simplecs = arduino_simplecs_env.Program('SimpleClientServer', 'ocserver.cpp')
env.CreateBin('SimpleClientServer')
+#The map file is intermediate file, make sure it's removed when clean build
+arduino_simplecs_env.Clean(arduino_simplecs, 'SimpleClientServer.map')
+
Alias('arduino_simplecs', arduino_simplecs)
env.AppendTarget('arduino_simplecs')