forked from xyzz/sn32f260-keyboard-bootloader
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
48 lines (37 loc) · 1.07 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.2.0)
project(jumploader LANGUAGES C ASM)
function(add_bootloader device)
string(TOUPPER ${device} device_upper)
add_executable(${device}.elf
src/main.c
src/proxy.s
)
target_compile_options(${device}.elf PUBLIC
-mthumb
-mcpu=cortex-m0
-flto
${OPT}
-Wall
-Wextra
)
target_include_directories(${device}.elf PUBLIC
CMSIS
)
target_compile_definitions(${device}.elf PUBLIC
TARGET_${device_upper}
)
target_link_libraries(${device}.elf PUBLIC
-nostartfiles
-nostdlib
"-T ${PROJECT_SOURCE_DIR}/linker.x"
)
add_custom_target(jumploader-${device}.bin ALL
COMMAND arm-none-eabi-objcopy -j .text -j .data -O binary $<TARGET_FILE:${device}.elf> ${CMAKE_BINARY_DIR}/jumploader-${device}.bin
DEPENDS ${device}.elf
BYPRODUCTS jumploader-${device}.bin
)
endfunction(add_bootloader)
add_bootloader(generic)
add_bootloader(womier_k66)
add_bootloader(ganss_gk87pro)
add_bootloader(kemove_dk63)