Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / resource / csdk / stack / samples / arduino / SimpleClientServer / ocserver / SConscript
index f5a4222..6f03453 100644 (file)
@@ -1,3 +1,23 @@
+#******************************************************************
+#
+# Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
+#
+#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
 Import('env')
 
 arduino_simplecs_env = env.Clone()
@@ -5,14 +25,15 @@ arduino_simplecs_env = env.Clone()
 # Build flags
 ######################################################################
 arduino_simplecs_env.PrependUnique(CPPPATH = [
-               '../../../../../ocsocket/include',
                '../../../../../logger/include',
                '../../../../../stack/include',
                '../../../../../../oc_logger/include'
                ])
 
 arduino_simplecs_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-arduino_simplecs_env.PrependUnique(LIBS = ['octbstack', 'coap'])
+arduino_simplecs_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+
+arduino_simplecs_env.PrependUnique(LIBS = ['octbstack', 'connectivity_abstraction','coap'])
 
 arduino_simplecs = arduino_simplecs_env.Program('SimpleClientServer', 'ocserver.cpp')
 env.CreateBin('SimpleClientServer')
@@ -20,4 +41,11 @@ env.CreateBin('SimpleClientServer')
 i_arduino_simplecs = arduino_simplecs_env.Install(env.get('BUILD_DIR'), arduino_simplecs)
 
 Alias('arduino_simplecs', i_arduino_simplecs)
-env.AppendTarget('arduino_simplecs')
\ No newline at end of file
+env.AppendTarget('arduino_simplecs')
+
+if(arduino_simplecs_env['UPLOAD'] == True):
+       from sys import platform as _platform
+       if _platform == "linux" or _platform == "linux2":
+               arduino_simplecs_env.Upload(env.get('BUILD_DIR') + '/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/SimpleClientServer.hex')
+       else:
+               print 'Please use appropriate install method for your developing machine. Linux is the only supported platform right now.'