Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. # Copyright 2014-present PlatformIO <contact@platformio.org>
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14.  
  15. """
  16. Arduino
  17.  
  18. Arduino Wiring-based Framework allows writing cross-platform software to
  19. control devices attached to a wide range of Arduino boards to create all
  20. kinds of creative coding, interactive objects, spaces or physical experiences.
  21.  
  22. http://arduino.cc/en/Reference/HomePage
  23. """
  24.  
  25. from os.path import isdir, join
  26.  
  27. from SCons.Script import DefaultEnvironment
  28.  
  29. env = DefaultEnvironment()
  30. platform = env.PioPlatform()
  31.  
  32. FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif")
  33. FRAMEWORK_VERSION = platform.get_package_version("framework-arduinoespressif")
  34. assert isdir(FRAMEWORK_DIR)
  35.  
  36. env.Prepend(
  37. CPPDEFINES=[
  38. "ARDUINO=%s" % FRAMEWORK_VERSION.split(".")[1],
  39. "LWIP_OPEN_SRC"
  40. ],
  41. CPPPATH=[
  42. join(FRAMEWORK_DIR, "tools", "sdk", "include"),
  43. join(FRAMEWORK_DIR, "tools", "sdk", "lwip", "include"),
  44. join("$BUILD_DIR", "FrameworkArduino")
  45. ],
  46. LIBPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lib"),
  47. join(FRAMEWORK_DIR, "tools", "sdk", "libc", "xtensa-lx106-elf","lib" )],
  48. LIBS=[
  49. "hal", "phy", "pp", "net80211","lwip_gcc", "wpa", "crypto", "main","wps", "axtls",
  50. "espnow","smartconfig", "mesh", "wpa2", "stdc++", "m","c" , "gcc" ]
  51. )
  52.  
  53. env.Append(
  54. LIBSOURCE_DIRS=[
  55. join(FRAMEWORK_DIR, "libraries")
  56. ]
  57. )
  58.  
  59. env.VariantDirWrap(
  60. join("$BUILD_DIR", "generic"),
  61. join(FRAMEWORK_DIR, "variants", "generic")
  62. )
  63.  
  64. #
  65. # Target: Build Core Library
  66. #
  67.  
  68. libs = []
  69.  
  70. if "build.variant" in env.BoardConfig():
  71. env.Append(
  72. CPPPATH=[
  73. join("$BUILD_DIR", "FrameworkArduinoVariant")
  74. ]
  75. )
  76. libs.append(env.BuildLibrary(
  77. join("$BUILD_DIR", "FrameworkArduinoVariant"),
  78. join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant"))
  79. ))
  80.  
  81. envsafe = env.Clone()
  82.  
  83. libs.append(envsafe.BuildLibrary(
  84. join("$BUILD_DIR", "FrameworkArduino"),
  85. join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core"))
  86. ))
  87.  
  88. env.Prepend(LIBS=libs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement