Browse Source

add CMake build tool

Signed-off-by: surenyi <surenyi82@qq.com>
bfsk
surenyi 3 years ago
parent
commit
95a640d942
  1. 2
      .gitignore
  2. 39
      CMakeLists.txt
  3. 58
      cmake/c6400-toolchain.cmake
  4. 0
      include/csl/csl.h
  5. 0
      include/csl/csl_atl.h
  6. 0
      include/csl/csl_atlhal.h
  7. 0
      include/csl/csl_cache.h
  8. 0
      include/csl/csl_cachehal.h
  9. 0
      include/csl/csl_chip.h
  10. 0
      include/csl/csl_chiphal.h
  11. 0
      include/csl/csl_dat.h
  12. 0
      include/csl/csl_dma.h
  13. 0
      include/csl/csl_dmahal.h
  14. 0
      include/csl/csl_edma.h
  15. 0
      include/csl/csl_edmahal.h
  16. 0
      include/csl/csl_emac.h
  17. 0
      include/csl/csl_emachal.h
  18. 0
      include/csl/csl_emif.h
  19. 0
      include/csl/csl_emifa.h
  20. 0
      include/csl/csl_emifahal.h
  21. 0
      include/csl/csl_emifb.h
  22. 0
      include/csl/csl_emifbhal.h
  23. 0
      include/csl/csl_emifhal.h
  24. 0
      include/csl/csl_emu.h
  25. 0
      include/csl/csl_emuhal.h
  26. 0
      include/csl/csl_gpio.h
  27. 0
      include/csl/csl_gpiohal.h
  28. 0
      include/csl/csl_gpioleg.h
  29. 0
      include/csl/csl_hpi.h
  30. 0
      include/csl/csl_hpihal.h
  31. 0
      include/csl/csl_i2c.h
  32. 0
      include/csl/csl_i2chal.h
  33. 0
      include/csl/csl_irq.h
  34. 0
      include/csl/csl_irqhal.h
  35. 0
      include/csl/csl_legacy.h
  36. 0
      include/csl/csl_legacyhal.h
  37. 0
      include/csl/csl_mcasp.h
  38. 0
      include/csl/csl_mcasphal.h
  39. 0
      include/csl/csl_mcbsp.h
  40. 0
      include/csl/csl_mcbsphal.h
  41. 0
      include/csl/csl_mdio.h
  42. 0
      include/csl/csl_mdiohal.h
  43. 0
      include/csl/csl_pci.h
  44. 0
      include/csl/csl_pcihal.h
  45. 0
      include/csl/csl_pll.h
  46. 0
      include/csl/csl_pllhal.h
  47. 0
      include/csl/csl_pwr.h
  48. 0
      include/csl/csl_pwrhal.h
  49. 0
      include/csl/csl_stdinc.h
  50. 0
      include/csl/csl_stdinchal.h
  51. 0
      include/csl/csl_tcp.h
  52. 0
      include/csl/csl_tcphal.h
  53. 0
      include/csl/csl_timer.h
  54. 0
      include/csl/csl_timerhal.h
  55. 0
      include/csl/csl_utop.h
  56. 0
      include/csl/csl_utophal.h
  57. 0
      include/csl/csl_vcp.h
  58. 0
      include/csl/csl_vcphal.h
  59. 0
      include/csl/csl_version.h
  60. 0
      include/csl/csl_vic.h
  61. 0
      include/csl/csl_vichal.h
  62. 0
      include/csl/csl_vp.h
  63. 0
      include/csl/csl_vphal.h
  64. 0
      include/csl/csl_xbus.h
  65. 0
      include/csl/csl_xbushal.h
  66. 0
      include/csl/tistdtypes.h
  67. 0
      src/_csl_irq.c
  68. 0
      src/csl.c
  69. 0
      src/csl_atl.c
  70. 0
      src/csl_cache.c
  71. 0
      src/csl_chip.c
  72. 0
      src/csl_chiphal.inc
  73. 0
      src/csl_dat.c
  74. 0
      src/csl_dat_.sa
  75. 0
      src/csl_dma.c
  76. 0
      src/csl_edma.c
  77. 0
      src/csl_edmadsptr.c
  78. 0
      src/csl_emac.c
  79. 0
      src/csl_emif.c
  80. 0
      src/csl_emifa.c
  81. 0
      src/csl_emifb.c
  82. 0
      src/csl_emu.c
  83. 0
      src/csl_gpio.c
  84. 0
      src/csl_hpi.c
  85. 0
      src/csl_i2c.c
  86. 0
      src/csl_irq.c
  87. 0
      src/csl_legacy.c
  88. 0
      src/csl_mcasp.c
  89. 0
      src/csl_mcbsp.c
  90. 0
      src/csl_mdio.c
  91. 0
      src/csl_pci.c
  92. 0
      src/csl_pll.c
  93. 0
      src/csl_pwr.c
  94. 0
      src/csl_tcp.c
  95. 0
      src/csl_timer.c
  96. 0
      src/csl_utop.c
  97. 0
      src/csl_vcp.c
  98. 0
      src/csl_vers.c
  99. 0
      src/csl_vic.c
  100. 0
      src/csl_vp.c

2
.gitignore

@ -0,0 +1,2 @@
*.obj
build

39
CMakeLists.txt

@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 3.13)
# set a default build type if none was specified
set(default_build_type "Release")
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Defaulting build type to '${default_build_type}' since not specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build, options are: 'Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo'." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Default")
error("Default build type is NOT supported")
endif()
# add cmake to module path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/c6400-toolchain.cmake)
endif()
message("${CMAKE_TOOLCHAIN_FILE}")
project(csl_sdk C ASM)
set(CMAKE_EXECUTABLE_SUFFIX .elf)
set(CMAKE_STATIC_LIBRARY_SUFFIX .lib)
set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_C_STANDARD 11)
file(GLOB csl_sdk_srcs src/*.c)
add_library(csl6416 STATIC ${csl_sdk_srcs})
target_include_directories(csl6416 PUBLIC
${CMAKE_CURRENT_LIST_DIR}/include/csl)

58
cmake/c6400-toolchain.cmake

@ -0,0 +1,58 @@
function(c6x_find_compiler compiler_path compiler_exe)
# Search user provided path first.
find_program(
${compiler_path} ${compiler_exe}
PATHS "d:/ti/ccsv5/tools/compiler/c6000_7.4.4" "d:/ti/ccsv5/tools/compiler/c6000_7.4.1" "c:/ti/ccsv5/tools/compiler/c6000_7.4.4" "c:/ti/ccsv5/tools/compiler/c6000_7.4.1"
PATH_SUFFIXES bin
NO_DEFAULT_PATH
)
# If not then search system paths.
if ("${${compiler_path}}" STREQUAL "${compiler_path}-NOTFOUND")
if (DEFINED ENV{C6X_TOOLCHAIN_PATH})
message(WARNING "C6X_TOOLCHAIN_PATH specified ($ENV{C6X_TOOLCHAIN_PATH}), but ${compiler_exe} not found there")
endif()
find_program(${compiler_path} ${compiler_exe})
endif ()
if ("${${compiler_path}}" STREQUAL "${compiler_path}-NOTFOUND")
set(C6X_TOOLCHAIN_PATH "" CACHE PATH "Path to search for compiler.")
message(FATAL_ERROR "Compiler '${compiler_exe}' not found, you can specify search path with\
\"C6X_TOOLCHAIN_PATH\".")
endif ()
endfunction()
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR c6416)
c6x_find_compiler(C6X_COMPILER_CC cl6x.exe)
# Specify the cross compiler.
set(CMAKE_C_COMPILER ${C6X_COMPILER_CC} CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER ${C6X_COMPILER_CC} CACHE FILEPATH "C++ compiler")
set(CMAKE_C_OUTPUT_EXTENSION .o)
# todo should we be including CMakeASMInformation anyway - i guess that is host side
set(CMAKE_ASM_COMPILER ${C6X_COMPILER_CC} CACHE FILEPATH "ASM compiler")
# Look for includes and libraries only in the target system prefix.
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# on DSP flags
set(C6X_COMMON_FLAGS "--define=CHIP_6416 --define=c6416 --relaxed_ansi")
foreach(LANG IN ITEMS C CXX ASM)
set(CMAKE_${LANG}_FLAGS_INIT "${C6X_COMMON_FLAGS}")
if (CSL_DEOPTIMIZED_DEBUG)
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O0")
else()
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-Og")
endif()
set(CMAKE_${LANG}_LINK_FLAGS "--rom_model")
endforeach()

0
csl.h → include/csl/csl.h

0
csl_atl.h → include/csl/csl_atl.h

0
csl_atlhal.h → include/csl/csl_atlhal.h

0
csl_cache.h → include/csl/csl_cache.h

0
csl_cachehal.h → include/csl/csl_cachehal.h

0
csl_chip.h → include/csl/csl_chip.h

0
csl_chiphal.h → include/csl/csl_chiphal.h

0
csl_dat.h → include/csl/csl_dat.h

0
csl_dma.h → include/csl/csl_dma.h

0
csl_dmahal.h → include/csl/csl_dmahal.h

0
csl_edma.h → include/csl/csl_edma.h

0
csl_edmahal.h → include/csl/csl_edmahal.h

0
csl_emac.h → include/csl/csl_emac.h

0
csl_emachal.h → include/csl/csl_emachal.h

0
csl_emif.h → include/csl/csl_emif.h

0
csl_emifa.h → include/csl/csl_emifa.h

0
csl_emifahal.h → include/csl/csl_emifahal.h

0
csl_emifb.h → include/csl/csl_emifb.h

0
csl_emifbhal.h → include/csl/csl_emifbhal.h

0
csl_emifhal.h → include/csl/csl_emifhal.h

0
csl_emu.h → include/csl/csl_emu.h

0
csl_emuhal.h → include/csl/csl_emuhal.h

0
csl_gpio.h → include/csl/csl_gpio.h

0
csl_gpiohal.h → include/csl/csl_gpiohal.h

0
csl_gpioleg.h → include/csl/csl_gpioleg.h

0
csl_hpi.h → include/csl/csl_hpi.h

0
csl_hpihal.h → include/csl/csl_hpihal.h

0
csl_i2c.h → include/csl/csl_i2c.h

0
csl_i2chal.h → include/csl/csl_i2chal.h

0
csl_irq.h → include/csl/csl_irq.h

0
csl_irqhal.h → include/csl/csl_irqhal.h

0
csl_legacy.h → include/csl/csl_legacy.h

0
csl_legacyhal.h → include/csl/csl_legacyhal.h

0
csl_mcasp.h → include/csl/csl_mcasp.h

0
csl_mcasphal.h → include/csl/csl_mcasphal.h

0
csl_mcbsp.h → include/csl/csl_mcbsp.h

0
csl_mcbsphal.h → include/csl/csl_mcbsphal.h

0
csl_mdio.h → include/csl/csl_mdio.h

0
csl_mdiohal.h → include/csl/csl_mdiohal.h

0
csl_pci.h → include/csl/csl_pci.h

0
csl_pcihal.h → include/csl/csl_pcihal.h

0
csl_pll.h → include/csl/csl_pll.h

0
csl_pllhal.h → include/csl/csl_pllhal.h

0
csl_pwr.h → include/csl/csl_pwr.h

0
csl_pwrhal.h → include/csl/csl_pwrhal.h

0
csl_stdinc.h → include/csl/csl_stdinc.h

0
csl_stdinchal.h → include/csl/csl_stdinchal.h

0
csl_tcp.h → include/csl/csl_tcp.h

0
csl_tcphal.h → include/csl/csl_tcphal.h

0
csl_timer.h → include/csl/csl_timer.h

0
csl_timerhal.h → include/csl/csl_timerhal.h

0
csl_utop.h → include/csl/csl_utop.h

0
csl_utophal.h → include/csl/csl_utophal.h

0
csl_vcp.h → include/csl/csl_vcp.h

0
csl_vcphal.h → include/csl/csl_vcphal.h

0
csl_version.h → include/csl/csl_version.h

0
csl_vic.h → include/csl/csl_vic.h

0
csl_vichal.h → include/csl/csl_vichal.h

0
csl_vp.h → include/csl/csl_vp.h

0
csl_vphal.h → include/csl/csl_vphal.h

0
csl_xbus.h → include/csl/csl_xbus.h

0
csl_xbushal.h → include/csl/csl_xbushal.h

0
tistdtypes.h → include/csl/tistdtypes.h

0
_csl_irq.c → src/_csl_irq.c

0
csl.c → src/csl.c

0
csl_atl.c → src/csl_atl.c

0
csl_cache.c → src/csl_cache.c

0
csl_chip.c → src/csl_chip.c

0
csl_chiphal.inc → src/csl_chiphal.inc

0
csl_dat.c → src/csl_dat.c

0
csl_dat_.sa → src/csl_dat_.sa

0
csl_dma.c → src/csl_dma.c

0
csl_edma.c → src/csl_edma.c

0
csl_edmadsptr.c → src/csl_edmadsptr.c

0
csl_emac.c → src/csl_emac.c

0
csl_emif.c → src/csl_emif.c

0
csl_emifa.c → src/csl_emifa.c

0
csl_emifb.c → src/csl_emifb.c

0
csl_emu.c → src/csl_emu.c

0
csl_gpio.c → src/csl_gpio.c

0
csl_hpi.c → src/csl_hpi.c

0
csl_i2c.c → src/csl_i2c.c

0
csl_irq.c → src/csl_irq.c

0
csl_legacy.c → src/csl_legacy.c

0
csl_mcasp.c → src/csl_mcasp.c

0
csl_mcbsp.c → src/csl_mcbsp.c

0
csl_mdio.c → src/csl_mdio.c

0
csl_pci.c → src/csl_pci.c

0
csl_pll.c → src/csl_pll.c

0
csl_pwr.c → src/csl_pwr.c

0
csl_tcp.c → src/csl_tcp.c

0
csl_timer.c → src/csl_timer.c

0
csl_utop.c → src/csl_utop.c

0
csl_vcp.c → src/csl_vcp.c

0
csl_vers.c → src/csl_vers.c

0
csl_vic.c → src/csl_vic.c

0
csl_vp.c → src/csl_vp.c

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save