SConscript 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import os
  2. import rtconfig
  3. import subprocess
  4. from building import *
  5. Import('RTT_ROOT')
  6. group = []
  7. cwd = GetCurrentDir()
  8. CPPPATH = [cwd, cwd + "/kernel"]
  9. if not GetDepend(['RT_USING_VDSO']):
  10. Return('group')
  11. if rtconfig.ARCH != "aarch64":
  12. src = Glob('*.c')
  13. group = DefineGroup('VDSO', src, depend = ['RT_USING_SMART','RT_USING_VDSO'], CPPPATH = CPPPATH)
  14. Return('group')
  15. list = os.listdir(cwd)
  16. src = Glob('kernel/*.c')
  17. src +=Glob('kernel/*.S')
  18. if not os.path.exists(cwd + "/user/vdso.lds"):
  19. Preprocessing("user/vdso.lds.S", ".lds", CPPPATH=[cwd])
  20. #aarch64 vdso xmake
  21. # vdso_file = os.path.join(cwd, 'usr', 'xmake.lua')
  22. # command = ["xmake", "-F", vdso_file]
  23. # clean = ["xmake", "clean"]
  24. vdso_file = os.path.join(cwd, 'user', 'SConstruct')
  25. command = ["scons", "-f", vdso_file]
  26. clean = ["scons", "-f", vdso_file, "--clean"]
  27. if not GetOption('clean'):
  28. result = subprocess.run(command)
  29. else:
  30. result = subprocess.run(clean)
  31. if result.returncode == 0:
  32. print("Command executed successfully")
  33. else:
  34. print("Command failed with exit code:", result.returncode)
  35. exit(1)
  36. group = DefineGroup('VDSO', src, depend = ['RT_USING_SMART','RT_USING_VDSO'], CPPPATH = CPPPATH)
  37. Return('group')