summaryrefslogtreecommitdiff
path: root/examples/vf6xx_colibri_m4/demo_apps/rpmsg/str_echo/armgcc/CMakeLists.txt
blob: bc9926647dcb346ad14dc2234c0a6576bc0c2fb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
INCLUDE(CMakeForceCompiler)

# CROSS COMPILER SETTING
SET(CMAKE_SYSTEM_NAME Generic)
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)

# THE VERSION NUMBER
SET (Tutorial_VERSION_MAJOR 1)
SET (Tutorial_VERSION_MINOR 0)

# ENABLE ASM
ENABLE_LANGUAGE(ASM)

SET(CMAKE_STATIC_LIBRARY_PREFIX)
SET(CMAKE_STATIC_LIBRARY_SUFFIX)

SET(CMAKE_EXECUTABLE_LIBRARY_PREFIX)
SET(CMAKE_EXECUTABLE_LIBRARY_SUFFIX)

# CURRENT DIRECTORY
SET(ProjDirPath ${CMAKE_CURRENT_SOURCE_DIR})

# DEBUG LINK FILE
#set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -T${ProjDirPath}/../../../../../../platform/devices/VF6XX/linker/gcc/vf6xx_tcm.ld  -static")

# RELEASE LINK FILE
#set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -T${ProjDirPath}/../../../../../../platform/devices/VF6XX/linker/gcc/vf6xx_tcm.ld  -static")

# DEBUG LINK FILE
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -T${ProjDirPath}/../../../../../../platform/devices/VF6XX/linker/gcc/vf6xx_sysram-sram.ld  -static")

# RELEASE LINK FILE
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -T${ProjDirPath}/../../../../../../platform/devices/VF6XX/linker/gcc/vf6xx_sysram-sram.ld  -static")

# DEBUG ASM FLAGS
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -g  -mcpu=cortex-m4  -mfloat-abi=hard  -mfpu=fpv4-sp-d16  -mthumb  -Wall  -fno-common  -ffunction-sections  -fdata-sections  -ffreestanding  -fno-builtin  -Os  -mapcs  -std=gnu99")

# DEBUG C FLAGS
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g  -mcpu=cortex-m4  -mfloat-abi=hard  -mfpu=fpv4-sp-d16  -mthumb  -MMD  -MP  -Wall  -fno-common  -ffunction-sections  -fdata-sections  -ffreestanding  -fno-builtin  -Os  -mapcs  -std=gnu99")

# DEBUG LD FLAGS
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g  -mcpu=cortex-m4  -mfloat-abi=hard  -mfpu=fpv4-sp-d16  --specs=nano.specs  -lm  -Wall  -fno-common  -ffunction-sections  -fdata-sections  -ffreestanding  -fno-builtin  -Os  -mthumb  -mapcs  -Xlinker --gc-sections  -Xlinker -static  -Xlinker -z  -Xlinker muldefs  -Xlinker --defsym=__stack_size__=0x400  -Xlinker --defsym=__heap_size__=0x200")

# RELEASE ASM FLAGS
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mcpu=cortex-m4  -mfloat-abi=hard  -mfpu=fpv4-sp-d16  -mthumb  -Wall  -fno-common  -ffunction-sections  -fdata-sections  -ffreestanding  -fno-builtin  -Os  -mapcs  -std=gnu99")

# RELEASE C FLAGS
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mcpu=cortex-m4  -mfloat-abi=hard  -mfpu=fpv4-sp-d16  -mthumb  -MMD  -MP  -Wall  -fno-common  -ffunction-sections  -fdata-sections  -ffreestanding  -fno-builtin  -Os  -mapcs  -std=gnu99")

# RELEASE LD FLAGS
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mcpu=cortex-m4  -mfloat-abi=hard  -mfpu=fpv4-sp-d16  --specs=nano.specs  -lm  -Wall  -fno-common  -ffunction-sections  -fdata-sections  -ffreestanding  -fno-builtin  -Os  -mthumb  -mapcs  -Xlinker --gc-sections  -Xlinker -static  -Xlinker -z  -Xlinker muldefs  -Xlinker --defsym=__stack_size__=0x400  -Xlinker --defsym=__heap_size__=0x200")

# ASM MACRO
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG}  -D__DEBUG")

# C MACRO
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}  -D__DEBUG")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}  -DCPU_VF6XX_M4")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}  -D__NDEBUG")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}  -DCPU_VF6XX_M4")

# CXX MACRO

# INCLUDE_DIRECTORIES
IF(CMAKE_BUILD_TYPE MATCHES Debug)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../..)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/CMSIS/Include)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/devices)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/devices/VF6XX/include)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/devices/VF6XX/startup)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/drivers/inc)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/vf6xx_m4)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/utilities/inc)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../..)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../middleware/multicore/open-amp)
ELSEIF(CMAKE_BUILD_TYPE MATCHES Release)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../..)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/CMSIS/Include)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/devices)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/devices/VF6XX/include)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/devices/VF6XX/startup)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/drivers/inc)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/vf6xx_m4)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../platform/utilities/inc)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../..)
    INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../middleware/multicore/open-amp)
ENDIF()

# ADD_EXECUTABLE
ADD_EXECUTABLE(rpmsg_str_echo_example
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h"
    "${ProjDirPath}/../../../../../../platform/devices/VF6XX/startup/gcc/startup_VF6XX_M4.S"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/portable/MemMang/heap_2.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/vf6xx_m4/platform.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/vf6xx_m4/plat_porting.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/rpmsg/rpmsg.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/common/hil/hil.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/common/llist/llist.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/common/shm/sh_mem.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/config/config.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/env/env.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/rpmsg/rpmsg_core.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/virtio/virtio.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/virtio/virtio_ring.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/virtio/virtqueue.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/croutine.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/event_groups.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/FreeRTOS.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/list.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/mpu_wrappers.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/portable.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/projdefs.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/queue.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/semphr.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/StackMacros.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/task.h"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/include/timers.h"
    "${ProjDirPath}/../../../../../../platform/drivers/inc/ccm_vf6xx.h"
    "${ProjDirPath}/../../../../../../platform/drivers/inc/lpuart_vf6xx.h"
    "${ProjDirPath}/../../../../../../platform/drivers/inc/sema4.h"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/vf6xx_m4/platform.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/vf6xx_m4/platform_info.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/common/hil/hil.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/common/llist/llist.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/common/shm/sh_mem.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/config/config.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/porting/env/freertos_env.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/rpmsg/remote_device.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/rpmsg/rpmsg.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/rpmsg/rpmsg_core.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/virtio/virtio.c"
    "${ProjDirPath}/../../../../../../middleware/multicore/open-amp/virtio/virtqueue.c"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/croutine.c"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/event_groups.c"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/list.c"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/queue.c"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/tasks.c"
    "${ProjDirPath}/../../../../../../rtos/FreeRTOS/Source/timers.c"
    "${ProjDirPath}/../../../../../../platform/drivers/src/ccm_vf6xx.c"
    "${ProjDirPath}/../../../../../../platform/drivers/src/lpuart_vf6xx.c"
    "${ProjDirPath}/../../../../../../platform/drivers/src/sema4.c"
    "${ProjDirPath}/../../../../../../platform/utilities/src/debug_console_vf6xx.c"
    "${ProjDirPath}/../../../../../../platform/utilities/inc/debug_console_vf6xx.h"
    "${ProjDirPath}/../../../../../../platform/utilities/src/debug_console.c"
    "${ProjDirPath}/../../../../../../platform/utilities/inc/debug_console.h"
    "${ProjDirPath}/../../../../../../platform/utilities/src/print_scan.c"
    "${ProjDirPath}/../../../../../../platform/utilities/src/print_scan.h"
    "${ProjDirPath}/../../../../../../platform/devices/VF6XX/startup/system_VF6XX_M4.c"
    "${ProjDirPath}/../../../../../../platform/devices/VF6XX/startup/system_VF6XX_M4.h"
    "${ProjDirPath}/../rpmsg_str_echo.c"
    "${ProjDirPath}/../../../../pin_mux.c"
    "${ProjDirPath}/../../../../pin_mux.h"
)
SET_TARGET_PROPERTIES(rpmsg_str_echo_example PROPERTIES OUTPUT_NAME "rpmsg_str_echo_example.elf")

TARGET_LINK_LIBRARIES(rpmsg_str_echo_example -Wl,--start-group)
# LIBRARIES
IF(CMAKE_BUILD_TYPE MATCHES Debug)
ELSEIF(CMAKE_BUILD_TYPE MATCHES Release)
ENDIF()

# SYSTEM LIBRARIES
TARGET_LINK_LIBRARIES(rpmsg_str_echo_example m)
TARGET_LINK_LIBRARIES(rpmsg_str_echo_example c)
TARGET_LINK_LIBRARIES(rpmsg_str_echo_example gcc)
TARGET_LINK_LIBRARIES(rpmsg_str_echo_example nosys)
TARGET_LINK_LIBRARIES(rpmsg_str_echo_example -Wl,--end-group)

# MAP FILE
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}  -Xlinker -Map=debug/rpmsg_str_echo_example.map")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}  -Xlinker -Map=release/rpmsg_str_echo_example.map")

# BIN AND HEX
ADD_CUSTOM_COMMAND(TARGET rpmsg_str_echo_example POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Oihex ${EXECUTABLE_OUTPUT_PATH}/rpmsg_str_echo_example.elf ${EXECUTABLE_OUTPUT_PATH}/rpmsg_str_echo_example.hex)
ADD_CUSTOM_COMMAND(TARGET rpmsg_str_echo_example POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Obinary ${EXECUTABLE_OUTPUT_PATH}/rpmsg_str_echo_example.elf ${EXECUTABLE_OUTPUT_PATH}/rpmsg_str_echo_example.bin)