forked from holgerschurig/md380
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.ninja
134 lines (122 loc) · 4.26 KB
/
build.ninja
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
builddir = obj
# @compile: make clean all
cross = arm-none-eabi
rtos_arch = ARM_CM4F
cc = ${cross}-gcc
cxx = ${cross}-g++
ld = ${cross}-ld
ar = ${cross}-ar
as = ${cross}-as
objcopy = ${cross}-objcopy
cc_std = -std=c11
c_defines = -D${rtos_arch}
c_warn = -Wall
#-Wextra
c_cpu = -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard
c_opt = -O3 -fomit-frame-pointer
cflags = $c_warn $c_defines $c_cpu $c_opt $cc_std
cxxflags = $c_warn $c_defines $c_cpu $c_opt
ldscript_rtos = -Tmd380.lds
includes_rtos = $
-I. $
-Istm $
-Ifreertos/FreeRTOS/Source/include $
-Ifreertos/FreeRTOS/Source/portable/GCC/${rtos_arch}
includes_ucos = $
-Iucos/uC-LIB $
-Iucos/uC-CPU/ARM-Cortex-M4/GNU $
-Iucos/uC-CPU $
-Iucos/uCOS-CONFIG $
-Iucos/UCOS-BSP $
-Iucos/uCOS-III/Source $
-Iucos/uCOS-III/Ports/ARM-Cortex-M4/Generic/GNU $
-Iucos/stm
ldscript_ucos = -Tucos/stm/stm32f4xx_flash.ld
rule ccf
deps = gcc
depfile = $out.d
command = $cc -MMD -MF $out.d $cflags $includes_rtos -c $in -o $out
description = CC $in
rule as
# deps = gcc
# depfile = $out.d
command = $as $c_cpu -o $out $in
description = AS $in
rule cxx
deps = gcc
depfile = $out.d
command = $cxx -MMD -MF $out.d $cxxflags $includes -c $in -o $out
description = CXX $in
rule ar
command = $ar rcs $out $in
description = AR $out
rule ldu
command = $cc $c_cpu $c_opt -nostartfiles -Xlinker -o$out ${ldscript_ucos} -specs=nosys.specs -gc-sections $in
description = LINK $out
rule ldr
command = $cc $c_cpu $c_opt $in -nostartfiles -Xlinker -o$out ${ldscript_rtos} -lc -specs=nosys.specs -gc-sections
description = LINK $out
rule objcopy
command = $objcopy -O binary $in $out
description = OBJ $out
# FreeRTOS sources
#CCF: freertos/FreeRTOS/Source/queue.c
#CCF: freertos/FreeRTOS/Source/list.c
#CCF: freertos/FreeRTOS/Source/tasks.c
#CCF: freertos/FreeRTOS/Source/portable/MemMang/heap_1.c
#CCF: freertos/FreeRTOS/Source/portable/GCC/${rtos_arch}/port.c
#AR: freertos.a
# The following entries have been auto-generated by ninja-refresh:
build obj/heap_1.o: ccf freertos/FreeRTOS/Source/portable/MemMang/heap_1.c
build obj/list.o: ccf freertos/FreeRTOS/Source/list.c
build obj/port.o: ccf freertos/FreeRTOS/Source/portable/GCC/${rtos_arch}/port.c
build obj/queue.o: ccf freertos/FreeRTOS/Source/queue.c
build obj/tasks.o: ccf freertos/FreeRTOS/Source/tasks.c
build obj/freertos.a: ar obj/heap_1.o obj/list.o obj/port.o obj/queue.o obj/tasks.o
# Hardware library
#CCF: stm/fault.c
#CCF: stm/gpio.c
#CCF: stm/interrupt.c
#CCF: stm/led.c
#CCF: stm/rcc.c
#CCF: stm/stm32f4xx.c
#AR: stm.a
# The following entries have been auto-generated by ninja-refresh:
build obj/fault.o: ccf stm/fault.c
build obj/gpio.o: ccf stm/gpio.c
build obj/interrupt.o: ccf stm/interrupt.c
build obj/led.o: ccf stm/led.c
build obj/rcc.o: ccf stm/rcc.c
build obj/stm32f4xx.o: ccf stm/stm32f4xx.c
build obj/stm.a: ar obj/fault.o obj/gpio.o obj/interrupt.o obj/led.o obj/rcc.o obj/stm32f4xx.o
# USB library
#CCF: stm/usb_cdc.c
#CCF: stm/usb/usb_bsp.c
#CCF: stm/usb/usb_core.c
#CCF: stm/usb/usb_dcd.c
#CCF: stm/usb/usb_dcd_int.c
#CCF: stm/usb/usbd_cdc_core.c
#CCF: stm/usb/usbd_cdc_vcp.c
#CCF: stm/usb/usbd_core.c
#CCF: stm/usb/usbd_desc.c
#CCF: stm/usb/usbd_ioreq.c
#CCF: stm/usb/usbd_req.c
#CCF: stm/usb/usbd_usr.c
#AR: usb.a
# The following entries have been auto-generated by ninja-refresh:
build obj/usb_bsp.o: ccf stm/usb/usb_bsp.c
build obj/usb_cdc.o: ccf stm/usb_cdc.c
build obj/usb_core.o: ccf stm/usb/usb_core.c
build obj/usb_dcd.o: ccf stm/usb/usb_dcd.c
build obj/usb_dcd_int.o: ccf stm/usb/usb_dcd_int.c
build obj/usbd_cdc_core.o: ccf stm/usb/usbd_cdc_core.c
build obj/usbd_cdc_vcp.o: ccf stm/usb/usbd_cdc_vcp.c
build obj/usbd_core.o: ccf stm/usb/usbd_core.c
build obj/usbd_desc.o: ccf stm/usb/usbd_desc.c
build obj/usbd_ioreq.o: ccf stm/usb/usbd_ioreq.c
build obj/usbd_req.o: ccf stm/usb/usbd_req.c
build obj/usbd_usr.o: ccf stm/usb/usbd_usr.c
build obj/usb.a: ar obj/usb_bsp.o obj/usb_cdc.o obj/usb_core.o obj/usb_dcd.o obj/usb_dcd_int.o obj/usbd_cdc_core.o obj/usbd_cdc_vcp.o obj/usbd_core.o obj/usbd_desc.o obj/usbd_ioreq.o obj/usbd_req.o obj/usbd_usr.o
build obj/main_rtos.o: ccf main_rtos.c
build obj/rtos.elf: ldr obj/main_rtos.o obj/usb.a obj/stm.a obj/freertos.a
default obj/rtos.elf