forked from SonixQMK/sonix-keyboard-bootloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (58 loc) · 1.78 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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(glorious_gmmk_full_tkl)
add_bootloader(glorious_gmmk_compact_rev2)
add_bootloader(glorious_gmmk_compact_rev3)
add_bootloader(kemove_dk63)
add_bootloader(royal_kludge_rk68)
add_bootloader(keychron_k1v4)
add_bootloader(tecware_phantom_tkl)
add_bootloader(akko_3084)
add_bootloader(keychron_k6_rgb)
add_bootloader(redragon_k530)
add_bootloader(redragon_k556)
add_bootloader(keychron_c1_white)
add_bootloader(keychron_c2_white)
add_bootloader(keychron_k6_white)
add_bootloader(keychron_k4_white)
add_bootloader(keychron_k3_white_optical)
add_bootloader(keychron_k12_white)
add_bootloader(keychron_k7_rgb_optical)
add_bootloader(keychron_k7_white_optical)
add_bootloader(sharkoon_sgk50s4)
add_bootloader(dareu_em908)
add_bootloader(havit_kb435l)