-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMakefile
More file actions
600 lines (484 loc) · 17.2 KB
/
Makefile
File metadata and controls
600 lines (484 loc) · 17.2 KB
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
###############################################################################
# SPDX-License-Identifier: GPL-3.0-or-later #
# SPDX-FileCopyrightText: 2025 Drona Aviation #
# ------------------------------------------------------------------------- #
# Copyright (c) 2025 Drona Aviation #
# All rights reserved. #
# ------------------------------------------------------------------------- #
# Author: Ashish Jaiswal (MechAsh) <AJ> #
# Project: MagisV2-MechAsh-Dev #
# File: \Makefile #
# Created Date: Mon, 28th Apr 2025 #
# Brief: #
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# Last Modified: Tue, 29th Apr 2025 #
# Modified By: AJ #
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# HISTORY: #
# Date By Comments #
# ---------- --- --------------------------------------------------------- #
###############################################################################
#
# Makefile for building the cleanflight firmware.
#
# Invoke this with 'make help' to see the list of supported targets.
#
###############################################################################
# User-configurable options
FORKNAME = MAGIS
TARGET ?= PRIMUSX
BUILD_TYPE ?= BIN
LIB_MAJOR_VERSION = 0
LIB_MINOR_VERSION = 3
FW_Version = 2.0.1
API_Version = 1.0.1
# Flash size (KB). Some low-end chips actually have more flash than advertised, use this to override.
FLASH_SIZE ?=
# Debugger optons, must be empty or GDB
DEBUG ?=
# Serial port/Device for flashing
SERIAL_DEVICE ?= $(firstword $(wildcard /dev/ttyUSB*) no-port-found)
# Compile-time options
OPTIONS ?= '__FORKNAME__="$(FORKNAME)"' \
'__TARGET__="$(TARGET)"' \
'__FW_VER__="$(FW_Version)"' \
'__API_VER__="$(API_Version)"' \
'__BUILD_DATE__="$(shell date +%Y-%m-%d)"' \
'__BUILD_TIME__="$(shell date +%H:%M:%S)"' \
# Configure default flash sizes for the targets
ifeq ($(FLASH_SIZE),)
ifeq ($(TARGET),PRIMUSV3R)
FLASH_SIZE = 128
else ifeq ($(TARGET),PRIMUSX)
FLASH_SIZE = 256
else
$(error FLASH_SIZE not configured for target)
endif
endif
VALID_TARGETS = PRIMUSV3R PRIMUSX
###############################################################################
# Directorie
ROOT := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
SRC_DIR = $(ROOT)/src/main
BUILD_DIR = $(ROOT)/Build
CMSIS_DIR = $(ROOT)/lib/main/CMSIS
INCLUDE_DIRS = $(SRC_DIR)
LINKER_DIR = $(ROOT)/src/main/target
# Search path for sources
VPATH := $(SRC_DIR) \
$(SRC_DIR)/startup
USBFS_DIR = $(ROOT)/lib/main/STM32_USB-FS-Device_Driver
USBPERIPH_SRC = $(notdir $(wildcard $(USBFS_DIR)/src/*.c))
# Ranging sensor VL53L0X libraries
RANGING_DIR = $(ROOT)/lib/main/VL53L0X_API
RANGING_SRC = $(notdir $(wildcard $(RANGING_DIR)/core/src/*.c \
$(RANGING_DIR)/platform/src/*.c\
$(RANGING_DIR)/core/src/*.cpp \
$(RANGING_DIR)/platform/src/*.cpp))
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(RANGING_DIR)/core/inc \
$(RANGING_DIR)/platform/inc
VPATH := $(VPATH) \
$(RANGING_DIR)/core/src \
$(RANGING_DIR)/platform/src
CSOURCES := $(shell find $(SRC_DIR) -name '*.c')
# MCU and Peripheral settings for PRIMUSX
ifeq ($(TARGET),PRIMUSX)
STDPERIPH_DIR = $(ROOT)/lib/main/STM32F30x_StdPeriph_Driver
STDPERIPH_SRC = $(notdir $(wildcard $(STDPERIPH_DIR)/src/*.c))
EXCLUDES = stm32f30x_crc.c \
stm32f30x_can.c
STDPERIPH_SRC := $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC))
DEVICE_STDPERIPH_SRC = $(STDPERIPH_SRC)
VPATH := $(VPATH) \
$(CMSIS_DIR)/CM1/CoreSupport \
$(CMSIS_DIR)/CM1/DeviceSupport/ST/STM32F30x
CMSIS_SRC = $(notdir $(wildcard $(CMSIS_DIR)/CM1/CoreSupport/*.c \
$(CMSIS_DIR)/CM1/DeviceSupport/ST/STM32F30x/*.c))
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(STDPERIPH_DIR)/inc \
$(CMSIS_DIR)/CM1/CoreSupport \
$(CMSIS_DIR)/CM1/DeviceSupport/ST/STM32F30x \
$(USBFS_DIR)/inc \
$(ROOT)/src/main/vcp
VPATH := $(VPATH) \
$(USBFS_DIR)/src
DEVICE_STDPERIPH_SRC := $(DEVICE_STDPERIPH_SRC) \
$(USBPERIPH_SRC)
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f303_$(FLASH_SIZE)k.ld
ARCH_FLAGS = -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wdouble-promotion
DEVICE_FLAGS = -DSTM32F303xC -DSTM32F303
TARGET_FLAGS = -D$(TARGET)
else
STDPERIPH_DIR = $(ROOT)/lib/main/STM32F10x_StdPeriph_Driver
STDPERIPH_SRC = $(notdir $(wildcard $(STDPERIPH_DIR)/src/*.c))
EXCLUDES = stm32f10x_crc.c \
stm32f10x_cec.c \
stm32f10x_can.c
STDPERIPH_SRC := $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC))
DEVICE_STDPERIPH_SRC = $(STDPERIPH_SRC)
VPATH := $(VPATH) \
$(CMSIS_DIR)/CM3/CoreSupport \
$(CMSIS_DIR)/CM3/DeviceSupport/ST/STM32F10x
CMSIS_SRC = $(notdir $(wildcard $(CMSIS_DIR)/CM3/CoreSupport/*.c \
$(CMSIS_DIR)/CM3/DeviceSupport/ST/STM32F10x/*.c))
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(STDPERIPH_DIR)/inc \
$(CMSIS_DIR)/CM3/CoreSupport \
$(CMSIS_DIR)/CM3/DeviceSupport/ST/STM32F10x \
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f103_$(FLASH_SIZE)k.ld
ARCH_FLAGS = -mthumb -mcpu=cortex-m3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wdouble-promotion
DEVICE_FLAGS = -DSTM32F10X_MD -DSTM32F10X
TARGET_FLAGS = -D$(TARGET) -pedantic
endif
ifneq ($(FLASH_SIZE),)
DEVICE_FLAGS := $(DEVICE_FLAGS) -DFLASH_SIZE=$(FLASH_SIZE)
endif
TARGET_DIR = $(ROOT)/src/main/target/$(TARGET)
TARGET_SRC = $(notdir $(wildcard $(TARGET_DIR)/*.c))
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(TARGET_DIR)
VPATH := $(VPATH) \
$(TARGET_DIR)
MAIN_COMMON = common/maths.cpp \
common/printf.cpp \
common/typeconversion.cpp \
common/encoding.cpp \
MAIN_FLIGHT = flight/altitudehold.cpp \
flight/failsafe.cpp \
flight/pid.cpp \
flight/imu.cpp \
flight/mixer.cpp \
flight/lowpass.cpp \
flight/filter.cpp \
flight/navigation.cpp \
flight/gps_conversion.c \
MAIN_CONFIG = config/config.cpp \
config/runtime_config.cpp
MAIN_DRIVERS = drivers/bus_i2c_soft.cpp \
drivers/serial.cpp\
drivers/sound_beeper.c \
drivers/system.c \
MAIN_IO = io/beeper.cpp \
io/oled_display.c \
io/rc_controls.cpp \
io/rc_curves.cpp \
io/serial.cpp \
io/serial_1wire.cpp \
io/serial_cli.cpp \
io/serial_msp.cpp \
io/statusindicator.cpp \
io/flashfs.cpp \
io/gps.cpp \
MAIN_RX = rx/rx.cpp \
rx/pwm.c \
rx/msp.c \
rx/sbus.c \
rx/sumd.c \
rx/sumh.c \
rx/spektrum.c \
rx/xbus.cpp \
MAIN_SENSOR = sensors/acceleration.cpp \
sensors/battery.cpp \
sensors/boardalignment.cpp \
sensors/compass.cpp \
sensors/gyro.cpp \
sensors/initialisation.cpp \
MAIN_BLACKBOX = blackbox/blackbox.cpp \
blackbox/blackbox_io.cpp \
COMMON_SRC = build_config.cpp \
debug.cpp \
version.cpp \
main.cpp \
mw.cpp \
$(TARGET_SRC) \
$(MAIN_CONFIG) \
$(MAIN_COMMON) \
$(MAIN_FLIGHT) \
$(MAIN_DRIVERS) \
$(MAIN_IO) \
$(MAIN_RX) \
$(MAIN_SENSOR) \
$(MAIN_BLACKBOX) \
$(CMSIS_SRC) \
$(DEVICE_STDPERIPH_SRC) \
HIGHEND_SRC = \
flight/gtune.c \
flight/navigation.c \
flight/gps_conversion.c \
common/colorconversion.c \
io/gps.c \
io/ledstrip.c \
io/display.c \
telemetry/telemetry.c \
telemetry/frsky.c \
telemetry/hott.c \
telemetry/msp.c \
telemetry/smartport.c \
sensors/sonar.c \
sensors/barometer.c \
blackbox/blackbox.c \
blackbox/blackbox_io.c
VCP_SRC = \
vcp/hw_config.c \
vcp/stm32_it.c \
vcp/usb_desc.c \
vcp/usb_endp.c \
vcp/usb_istr.c \
vcp/usb_prop.c \
vcp/usb_pwr.c \
drivers/serial_usb_vcp.c
DRONA_FLIGHT = flight/acrobats.cpp \
flight/posControl.cpp \
flight/posEstimate.cpp \
flight/opticflow.cpp \
DRONA_DRIVERS = drivers/opticflow_paw3903.cpp \
drivers/display_ug2864hsweg01 \
drivers/ranging_vl53l0x.cpp \
drivers/sc18is602b.cpp \
DRONA_COMMAND = command/command.cpp \
command/localisationCommand.cpp \
DRONA_API = API/Specifiers.cpp \
API/Peripheral.cpp \
API/XRanging.cpp \
API/Sensor.cpp \
API/Control.cpp \
API/Estimate.cpp \
API/Utils.cpp\
API/User.cpp\
API/Motor.cpp\
API/API-Utils.cpp\
API/RxConfig.cpp\
API/Localisation.cpp\
DRONA_SRC = $(DRONA_FLIGHT) \
$(DRONA_DRIVERS) \
$(DRONA_COMMAND) \
$(DRONA_API) \
PRIMUSV3R_DRIVERS = drivers/adc.cpp \
drivers/adc_stm32f10x.cpp \
drivers/accgyro_mpu.cpp \
drivers/accgyro_mpu6500.cpp \
drivers/bus_i2c_stm32f10x.c \
drivers/bus_spi.c \
drivers/compass_ak8963.cpp \
drivers/gpio_stm32f10x.cpp \
drivers/light_led_stm32f10x.cpp \
drivers/flash_m25p16.cpp \
drivers/pwm_mapping.cpp \
drivers/pwm_output.cpp \
drivers/pwm_rx.cpp \
drivers/serial_uart.c \
drivers/serial_uart_stm32f10x.c \
drivers/sound_beeper_stm32f10x.cpp \
drivers/system_stm32f10x.cpp \
drivers/timer.cpp \
drivers/timer_stm32f10x.cpp \
drivers/barometer_ms5611.cpp \
PRIMUSV3R_SENSORS = sensors/barometer.cpp \
PRIMUSV3R_SRC = startup_stm32f10x_md_gcc.S \
$(COMMON_SRC) \
$(DRONA_SRC) \
$(RANGING_SRC) \
$(PRIMUSV3R_DRIVERS) \
$(PRIMUSV3R_SENSORS) \
hardware_revision.cpp \
PRIMUSX_DRIVERS = drivers/adc.cpp \
drivers/adc_stm32f30x.c \
drivers/accgyro_mpu.cpp \
drivers/accgyro_mpu6500.cpp \
drivers/accgyro_icm20948.cpp \
drivers/bus_i2c_stm32f30x.c \
drivers/bus_spi.c \
drivers/compass_ak8963.cpp \
drivers/compass_ak09916.cpp \
drivers/gpio_stm32f30x.c \
drivers/light_led_stm32f30x.c \
drivers/flash_m25p16.cpp \
drivers/pwm_mapping.cpp \
drivers/pwm_output.cpp \
drivers/pwm_rx.cpp \
drivers/serial_uart.c \
drivers/serial_uart_stm32f30x.c \
drivers/sound_beeper_stm32f30x.c \
drivers/system_stm32f30x.c \
drivers/timer.cpp \
drivers/timer_stm32f30x.c \
drivers/barometer_ms5611.cpp \
drivers/barometer_icp10111.cpp \
PRIMUSX_SENSORS = sensors/barometer.cpp \
PRIMUSX_SRC = startup_stm32f30x_md_gcc.S \
$(RANGING_SRC) \
$(PRIMUSX_DRIVERS) \
$(PRIMUSX_SENSORS) \
$(COMMON_SRC) \
$(DRONA_SRC) \
ifeq ($(BUILD_TYPE),BIN)
$(TARGET)_SRC:=$($(TARGET)_SRC)\
API/PlutoPilot.cpp
endif
# Search path and source files for the ST stdperiph library
VPATH := $(VPATH) \
$(STDPERIPH_DIR)/src
###############################################################################
# Compiler and Tools
CC = arm-none-eabi-g++
C = arm-none-eabi-gcc
AR = arm-none-eabi-ar
OBJCOPY = arm-none-eabi-objcopy
SIZE = arm-none-eabi-size
ifeq ($(DEBUG),GDB)
OPTIMIZE = -O0
LTO_FLAGS = $(OPTIMIZE)
else
OPTIMIZE = -Os
LTO_FLAGS = -flto --use-linker-plugin $(OPTIMIZE)
endif
DEBUG_FLAGS = -ggdb3 -DDEBUG
CFLAGS = $(ARCH_FLAGS) \
$(LTO_FLAGS) \
$(addprefix -D,$(OPTIONS)) \
$(addprefix -I,$(INCLUDE_DIRS)) \
$(DEBUG_FLAGS) \
-std=gnu17 \
-Wall -Wextra -Wunsafe-loop-optimizations -Wdouble-promotion \
-Wshadow -Wundef -Wconversion -Wsign-conversion \
-ffunction-sections \
-fdata-sections \
-ffat-lto-objects\
$(DEVICE_FLAGS) \
-DUSE_STDPERIPH_DRIVER \
$(TARGET_FLAGS) \
-save-temps=obj \
-MMD -MP
CCFLAGS = $(ARCH_FLAGS) \
$(LTO_FLAGS) \
$(addprefix -D,$(OPTIONS)) \
$(addprefix -I,$(INCLUDE_DIRS)) \
$(DEBUG_FLAGS) \
-std=gnu++17 \
-Wall -Wextra -Wunsafe-loop-optimizations -Wdouble-promotion \
-Wshadow -Wundef -Wconversion -Wsign-conversion \
-ffunction-sections \
-fdata-sections \
-ffat-lto-objects\
$(DEVICE_FLAGS) \
-DUSE_STDPERIPH_DRIVER \
$(TARGET_FLAGS) \
-save-temps=obj \
-MMD -MP
ASFLAGS = $(ARCH_FLAGS) \
-x assembler-with-cpp \
$(addprefix -I,$(INCLUDE_DIRS)) \
-MMD -MP
LDFLAGS = -lm \
-nostartfiles \
--specs=nosys.specs \
-lc \
-lnosys \
$(ARCH_FLAGS) \
$(LTO_FLAGS) \
$(DEBUG_FLAGS) \
-static \
-Wl,-gc-sections,-Map,$(TARGET_MAP) \
-Wl,-L$(LINKER_DIR) \
-T$(LD_SCRIPT)
###############################################################################
# No user-serviceable parts below
###############################################################################
CPPCHECK = cppcheck $(CSOURCES) --enable=all --platform=unix64 \
--std=c99 --inline-suppr --quiet --force \
$(addprefix -I,$(INCLUDE_DIRS)) \
-I/usr/include -I/usr/include/linux
## all : default task; compile C code, build firmware
ifeq ($(BUILD_TYPE),BIN)
all: binary
else
all: libcreate
endif
#
# Things we will build
#
ifeq ($(filter $(TARGET),$(VALID_TARGETS)),)
$(error Target '$(TARGET)' is not valid, must be one of $(VALID_TARGETS))
endif
TARGET_BIN = $(BUILD_DIR)/$(TARGET)/$(FORKNAME)_$(TARGET).bin
TARGET_HEX = $(BUILD_DIR)/$(TARGET)/$(TARGET)-$(FW_Version).hex
TARGET_ELF = $(BUILD_DIR)/$(TARGET)/$(FORKNAME)_$(TARGET).elf
TARGET_MAP = $(BUILD_DIR)/$(TARGET)/$(FORKNAME)_$(TARGET).map
TARGET_OBJS = $(addsuffix .o,$(addprefix $(BUILD_DIR)/$(TARGET)/bin/,$(basename $($(TARGET)_SRC))))
TARGET_DEPS = $(addsuffix .d,$(addprefix $(BUILD_DIR)/$(TARGET)/bin/,$(basename $($(TARGET)_SRC))))
# List of buildable ELF files and their object dependencies.
# It would be nice to compute these lists, but that seems to be just beyond make.
$(TARGET_HEX): $(TARGET_ELF)
$(OBJCOPY) -O ihex --set-start 0x8000000 $< $@
$(TARGET_BIN): $(TARGET_ELF)
$(OBJCOPY) -O binary $< $@
$(TARGET_ELF): $(TARGET_OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
$(SIZE) $(TARGET_ELF)
# Compile
libs/libpluto_$(LIB_MAJOR_VERSION).$(LIB_MINOR_VERSION).a: $(TARGET_OBJS)
mkdir -p $(dir $@)
$(AR) rcs $@ $^
$(BUILD_DIR)/$(TARGET)/bin/%.o: %.cpp
@mkdir -p $(dir $@)
@echo %% $(notdir $<)
@$(CC) -c -o $@ $(CCFLAGS) $<
$(BUILD_DIR)/$(TARGET)/bin/%.o: %.c
@mkdir -p $(dir $@)
@echo %% $(notdir $<)
@$(C) -c -o $@ $(CFLAGS) $<
# Assemble
$(BUILD_DIR)/$(TARGET)/bin/%.o: %.s
@mkdir -p $(dir $@)
@echo %% $(notdir $<)
@$(CC) -c -o $@ $(ASFLAGS) $<
$(BUILD_DIR)/$(TARGET)/bin/%.o: %.S
@mkdir -p $(dir $@)
@echo %% $(notdir $<)
@$(CC) -c -o $@ $(ASFLAGS) $<
libcreate: libs/libpluto_$(LIB_MAJOR_VERSION).$(LIB_MINOR_VERSION).a
## clean : clean up all temporary / machine-generated files
clean:
rm -f $(TARGET_BIN) $(TARGET_HEX) $(TARGET_ELF) $(TARGET_OBJS) $(TARGET_MAP)
rm -rf $(BUILD_DIR)/$(TARGET)
cd src/test && $(MAKE) clean || true
flash_$(TARGET): $(TARGET_HEX)
stty -F $(SERIAL_DEVICE) raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon
echo -n 'R' >$(SERIAL_DEVICE)
stm32flash -w $(TARGET_HEX) -v -g 0x0 -b 115200 $(SERIAL_DEVICE)
## flash : flash firmware (.hex) onto flight controller
flash: flash_$(TARGET)
st-flash_$(TARGET): $(TARGET_BIN)
st-flash --reset write $< 0x08000000
## st-flash : flash firmware (.bin) onto flight controller
st-flash: st-flash_$(TARGET)
binary: $(TARGET_HEX)
unbrick_$(TARGET): $(TARGET_HEX)
stty -F $(SERIAL_DEVICE) raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon
stm32flash -w $(TARGET_HEX) -v -g 0x0 -b 115200 $(SERIAL_DEVICE)
## unbrick : unbrick flight controller
unbrick: unbrick_$(TARGET)
## cppcheck : run static analysis on C source code
cppcheck: $(CSOURCES)
$(CPPCHECK)
cppcheck-result.xml: $(CSOURCES)
$(CPPCHECK) --xml-version=2 2> cppcheck-result.xml
## help : print this help message and exit
help: Makefile
@echo ""
@echo "Makefile for the $(FORKNAME) firmware"
@echo ""
@echo "Usage:"
@echo " make [TARGET=<target>] [OPTIONS=\"<options>\"]"
@echo ""
@echo "Valid TARGET values are: $(VALID_TARGETS)"
@echo ""
@sed -n 's/^## //p' $<
## test : run the cleanflight test suite
test:
cd src/test && $(MAKE) test || true
# rebuild everything when makefile changes
$(TARGET_OBJS) : Makefile
# include auto-generated dependencies
-include $(TARGET_DEPS)