summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorgkostka <kostka.grzegorz@gmail.com>2014-05-20 23:41:24 +0000
committergkostka <kostka.grzegorz@gmail.com>2014-05-20 23:41:24 +0000
commit6f2630560d50340611b372d58c1f450106df5467 (patch)
treea19de50f04e51c8a86ca98d2f3cdf237e06f6ffa /toolchain
parentb6a7544b8c5b52b1d13f3b9c7c94cdabb6bf5ed1 (diff)
Build system refactoring.
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/bf518.cmake6
-rw-r--r--toolchain/cortex-m3.cmake4
-rw-r--r--toolchain/cortex-m4.cmake7
-rw-r--r--toolchain/generic.cmake25
4 files changed, 33 insertions, 9 deletions
diff --git a/toolchain/bf518.cmake b/toolchain/bf518.cmake
index d471ac5..523919b 100644
--- a/toolchain/bf518.cmake
+++ b/toolchain/bf518.cmake
@@ -1,5 +1,5 @@
# Name of the target
-SET(CMAKE_SYSTEM_NAME Generic)
+set(CMAKE_SYSTEM_NAME bfin-elf)
set(CMAKE_SYSTEM_PROCESSOR bf518)
# Toolchain settings
@@ -12,9 +12,9 @@ set(OBJDUMP bfin-elf-objdump)
set(SIZE bfin-elf-size)
set(CMAKE_C_FLAGS "-mcpu=bf518 -Wall -std=gnu99 -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags")
-set(CMAKE_CXX_FLAGS "-mcpu=bf518 -fno-builtin -Wall -fdata-sections -ffunction-sections" CACHE INTERNAL "cxx compiler flags")
+set(CMAKE_CXX_FLAGS "-mcpu=bf518 -Wall -fdata-sections -ffunction-sections" CACHE INTERNAL "cxx compiler flags")
set(CMAKE_ASM_FLAGS "-mcpu=bf518 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
-set(CMAKE_EXE_LINKER_FLAGS "-nostartfiles -Wl,--gc-sections -mcpu=bf592" CACHE INTERNAL "exe link flags")
+set(CMAKE_EXE_LINKER_FLAGS "-mcpu=bf592 -nostartfiles -Wl,--gc-sections" CACHE INTERNAL "exe link flags")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -ggdb3" CACHE INTERNAL "c debug compiler flags")
diff --git a/toolchain/cortex-m3.cmake b/toolchain/cortex-m3.cmake
index 873ed1f..3ad9e07 100644
--- a/toolchain/cortex-m3.cmake
+++ b/toolchain/cortex-m3.cmake
@@ -1,5 +1,5 @@
# Name of the target
-SET(CMAKE_SYSTEM_NAME Generic)
+set(CMAKE_SYSTEM_NAME arm-none-eabi)
set(CMAKE_SYSTEM_PROCESSOR cortex-m3)
# Toolchain settings
@@ -14,7 +14,7 @@ set(SIZE arm-none-eabi-size)
set(CMAKE_C_FLAGS "-mthumb -mcpu=cortex-m3 -fno-builtin -Wall -std=gnu99 -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags")
set(CMAKE_CXX_FLAGS "-mthumb -mcpu=cortex-m3 -fno-builtin -Wall -fdata-sections -ffunction-sections" CACHE INTERNAL "cxx compiler flags")
set(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m3" CACHE INTERNAL "asm compiler flags")
-set(CMAKE_EXE_LINKER_FLAGS "-nostartfiles -Wl,--gc-sections -mthumb -mcpu=cortex-m3" CACHE INTERNAL "exe link flags")
+set(CMAKE_EXE_LINKER_FLAGS "-mthumb -mcpu=cortex-m3 -nostartfiles -Wl,--gc-sections" CACHE INTERNAL "exe link flags")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -ggdb3" CACHE INTERNAL "c debug compiler flags")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb3" CACHE INTERNAL "cxx debug compiler flags")
diff --git a/toolchain/cortex-m4.cmake b/toolchain/cortex-m4.cmake
index c4b097a..659018a 100644
--- a/toolchain/cortex-m4.cmake
+++ b/toolchain/cortex-m4.cmake
@@ -1,5 +1,5 @@
# Name of the target
-SET(CMAKE_SYSTEM_NAME Generic)
+set(CMAKE_SYSTEM_NAME arm-none-eabi)
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
# Toolchain settings
@@ -14,7 +14,7 @@ set(SIZE arm-none-eabi-size)
set(CMAKE_C_FLAGS "-mthumb -mcpu=cortex-m4 -fno-builtin -Wall -std=gnu99 -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags")
set(CMAKE_CXX_FLAGS "-mthumb -mcpu=cortex-m4 -fno-builtin -Wall -fdata-sections -ffunction-sections" CACHE INTERNAL "cxx compiler flags")
set(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m4" CACHE INTERNAL "asm compiler flags")
-set(CMAKE_EXE_LINKER_FLAGS "-nostartfiles -Wl,--gc-sections -mthumb -mcpu=cortex-m4" CACHE INTERNAL "exe link flags")
+set(CMAKE_EXE_LINKER_FLAGS " -mthumb -mcpu=cortex-m4 -nostartfiles -Wl,--gc-sections" CACHE INTERNAL "exe link flags")
@@ -24,5 +24,4 @@ SET(CMAKE_ASM_FLAGS_DEBUG "-g -ggdb3" CACHE INTERNAL "asm debug compiler flags")
SET(CMAKE_C_FLAGS_RELEASE "-Os" CACHE INTERNAL "c release compiler flags")
SET(CMAKE_CXX_FLAGS_RELEASE "-Os" CACHE INTERNAL "cxx release compiler flags")
-SET(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm release compiler flags")
-
+SET(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm release compiler flags") \ No newline at end of file
diff --git a/toolchain/generic.cmake b/toolchain/generic.cmake
new file mode 100644
index 0000000..d9f5ef6
--- /dev/null
+++ b/toolchain/generic.cmake
@@ -0,0 +1,25 @@
+# Name of the target
+set(CMAKE_SYSTEM_PROCESSOR generic)
+
+# Toolchain settings
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_CXX_COMPILER g++)
+set(AS as)
+set(AR ar)
+set(OBJCOPY objcopy)
+set(OBJDUMP objdump)
+set(SIZE size)
+
+set(CMAKE_C_FLAGS "-std=gnu99 -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags")
+set(CMAKE_CXX_FLAGS "-fdata-sections -ffunction-sections" CACHE INTERNAL "cxx compiler flags")
+set(CMAKE_ASM_FLAGS "" CACHE INTERNAL "asm compiler flags")
+set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections" CACHE INTERNAL "exe link flags")
+
+
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -ggdb3" CACHE INTERNAL "c debug compiler flags")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb3" CACHE INTERNAL "cxx debug compiler flags")
+SET(CMAKE_ASM_FLAGS_DEBUG "-g -ggdb3" CACHE INTERNAL "asm debug compiler flags")
+
+SET(CMAKE_C_FLAGS_RELEASE "-O2" CACHE INTERNAL "c release compiler flags")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE INTERNAL "cxx release compiler flags")
+SET(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm release compiler flags") \ No newline at end of file