Adding CMake build support for the KLL compiler
- Automatically downloads the kll compiler if not found - Added capability files to each of the module that currently have them - Split modules.cmake so kll.cmake could influence build targets (also needs info from modules.cmake) - Updated .gitignore for kll compiler directory - Added documentation on how to manipulate layouts using CMakeLists.txt - Cleanup of old layout files
This commit is contained in:
parent
cb37c82330
commit
e0a2a4806b
11 changed files with 357 additions and 563 deletions
81
Lib/CMake/build.cmake
Normal file
81
Lib/CMake/build.cmake
Normal file
|
@ -0,0 +1,81 @@
|
|||
###| CMAKE Kiibohd Controller Source Configurator |###
|
||||
#
|
||||
# Written by Jacob Alexander in 2011-2014 for the Kiibohd Controller
|
||||
#
|
||||
# Released into the Public Domain
|
||||
#
|
||||
###
|
||||
|
||||
|
||||
|
||||
###
|
||||
# Build Targets
|
||||
#
|
||||
|
||||
#| Create the .ELF file
|
||||
set( TARGET_ELF ${TARGET}.elf )
|
||||
add_executable( ${TARGET_ELF} ${SRCS} generatedKeymap.h )
|
||||
|
||||
|
||||
#| .ELF Properties
|
||||
set_target_properties( ${TARGET_ELF} PROPERTIES
|
||||
LINK_FLAGS ${LINKER_FLAGS}
|
||||
SUFFIX "" # XXX Force Windows to keep the .exe off
|
||||
)
|
||||
|
||||
|
||||
#| Convert the .ELF into a .bin to load onto the McHCK
|
||||
if( DEFINED DFU )
|
||||
set( TARGET_BIN ${TARGET}.dfu.bin )
|
||||
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
|
||||
COMMAND ${CMAKE_OBJCOPY} ${BIN_FLAGS} ${TARGET_ELF} ${TARGET_BIN}
|
||||
COMMENT "Creating dfu binary file: ${TARGET_BIN}"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
#| Convert the .ELF into a .HEX to load onto the Teensy
|
||||
if ( DEFINED TEENSY )
|
||||
set( TARGET_HEX ${TARGET}.teensy.hex )
|
||||
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
|
||||
COMMAND ${CMAKE_OBJCOPY} ${HEX_FLAGS} ${TARGET_ELF} ${TARGET_HEX}
|
||||
COMMENT "Creating iHex file to load: ${TARGET_HEX}"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
#| Generate the Extended .LSS
|
||||
set( TARGET_LSS ${TARGET}.lss )
|
||||
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
|
||||
COMMAND ${CMAKE_OBJDUMP} ${LSS_FLAGS} ${TARGET_ELF} > ${TARGET_LSS}
|
||||
COMMENT "Creating Extended Listing: ${TARGET_LSS}"
|
||||
)
|
||||
|
||||
|
||||
#| Generate the Symbol Table .SYM
|
||||
set( TARGET_SYM ${TARGET}.sym )
|
||||
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
|
||||
COMMAND ${CMAKE_NM} -n ${TARGET_ELF} > ${TARGET_SYM}
|
||||
COMMENT "Creating Symbol Table: ${TARGET_SYM}"
|
||||
)
|
||||
|
||||
|
||||
#| Compiler Selection Record
|
||||
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/writer compiler ${COMPILER_FAMILY}
|
||||
)
|
||||
|
||||
|
||||
|
||||
###
|
||||
# Size Information
|
||||
#
|
||||
|
||||
#| After Changes Size Information
|
||||
add_custom_target( SizeAfter ALL
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} ram ${TARGET_ELF} ${SIZE_RAM} " SRAM"
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} flash ${TARGET_ELF} ${SIZE_FLASH} "Flash"
|
||||
DEPENDS ${TARGET_ELF}
|
||||
COMMENT "Chip usage for ${CHIP}"
|
||||
)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue