summaryrefslogtreecommitdiffstats
path: root/carl9170fw/extra/sh-elf-linux.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 08:09:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 08:09:22 +0000
commit6b4d032d4964caaa85be4ba8f3a7874afbf958cc (patch)
treea9846103274b39705a7e8be9fc28c006c18094b1 /carl9170fw/extra/sh-elf-linux.cmake
parentInitial commit. (diff)
downloadfirmware-nonfree-6b4d032d4964caaa85be4ba8f3a7874afbf958cc.tar.xz
firmware-nonfree-6b4d032d4964caaa85be4ba8f3a7874afbf958cc.zip
Adding upstream version 20230625.upstream/20230625upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'carl9170fw/extra/sh-elf-linux.cmake')
-rw-r--r--carl9170fw/extra/sh-elf-linux.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/carl9170fw/extra/sh-elf-linux.cmake b/carl9170fw/extra/sh-elf-linux.cmake
new file mode 100644
index 0000000..8be6d36
--- /dev/null
+++ b/carl9170fw/extra/sh-elf-linux.cmake
@@ -0,0 +1,21 @@
+set(CMAKE_SYSTEM_NAME "Generic")
+set(CMAKE_SYSTEM_PROCESSOR "sh2")
+
+set_property(DIRECTORY PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+
+set(CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR}/toolchain/inst/)
+
+set(CMAKE_C_FLAGS "-m2 -ml -Os -ffreestanding -nostartfiles")
+set(CMAKE_C_LINK_FLAGS "-static -EL -x --gc-sections")
+
+set(OBJCOPY ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-objcopy)
+set(CMAKE_C_COMPILER "${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-gcc")
+set(CMAKE_AR ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ar)
+set(CMAKE_ASM_COMPILER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-as)
+set(CMAKE_ASM-ATT_COMPILER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-as)
+set(CMAKE_LINKER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ld)
+set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ld <OBJECTS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -o <TARGET>")
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)