Merge pull request #7509 from mikeller/add_uint16_cli_support
[betaflight.git] / Makefile
blob48a99a2217e8a0d139087f9a15573fb17eec70cb
1 ###############################################################################
2 # "THE BEER-WARE LICENSE" (Revision 42):
3 # <msmith@FreeBSD.ORG> wrote this file. As long as you retain this notice you
4 # can do whatever you want with this stuff. If we meet some day, and you think
5 # this stuff is worth it, you can buy me a beer in return
6 ###############################################################################
8 # Makefile for building the betaflight firmware.
10 # Invoke this with 'make help' to see the list of supported targets.
12 ###############################################################################
15 # Things that the user might override on the commandline
18 # The target to build, see VALID_TARGETS below
19 TARGET ?= BETAFLIGHTF3
21 # Compile-time options
22 OPTIONS ?=
24 # compile for OpenPilot BootLoader support
25 OPBL ?= no
27 # Debugger optons:
28 # empty - ordinary build with all optimizations enabled
29 # RELWITHDEBINFO - ordinary build with debug symbols and all optimizations enabled
30 # GDB - debug build with minimum number of optimizations
31 DEBUG ?=
33 # Insert the debugging hardfault debugger
34 # releases should not be built with this flag as it does not disable pwm output
35 DEBUG_HARDFAULTS ?=
37 # Serial port/Device for flashing
38 SERIAL_DEVICE ?= $(firstword $(wildcard /dev/ttyUSB*) no-port-found)
40 # Flash size (KB). Some low-end chips actually have more flash than advertised, use this to override.
41 FLASH_SIZE ?=
44 ###############################################################################
45 # Things that need to be maintained as the source changes
48 FORKNAME = betaflight
50 # Working directories
51 ROOT := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
52 SRC_DIR := $(ROOT)/src/main
53 OBJECT_DIR := $(ROOT)/obj/main
54 BIN_DIR := $(ROOT)/obj
55 CMSIS_DIR := $(ROOT)/lib/main/CMSIS
56 INCLUDE_DIRS := $(SRC_DIR) \
57 $(ROOT)/src/main/target
58 LINKER_DIR := $(ROOT)/src/main/target/link
60 ## V : Set verbosity level based on the V= parameter
61 ## V=0 Low
62 ## V=1 High
63 include $(ROOT)/make/build_verbosity.mk
65 # Build tools, so we all share the same versions
66 # import macros common to all supported build systems
67 include $(ROOT)/make/system-id.mk
69 # developer preferences, edit these at will, they'll be gitignored
70 -include $(ROOT)/make/local.mk
72 # configure some directories that are relative to wherever ROOT_DIR is located
73 ifndef TOOLS_DIR
74 TOOLS_DIR := $(ROOT)/tools
75 endif
76 BUILD_DIR := $(ROOT)/build
77 DL_DIR := $(ROOT)/downloads
79 export RM := rm
81 # import macros that are OS specific
82 include $(ROOT)/make/$(OSFAMILY).mk
84 # include the tools makefile
85 include $(ROOT)/make/tools.mk
87 # default xtal value for F4 targets
88 HSE_VALUE ?= 8000000
90 # used for turning on features like VCP and SDCARD
91 FEATURES =
93 # used to disable features based on flash space shortage (larger number => more features disabled)
94 FEATURE_CUT_LEVEL_SUPPLIED := $(FEATURE_CUT_LEVEL)
95 FEATURE_CUT_LEVEL =
97 include $(ROOT)/make/targets.mk
99 REVISION := $(shell git log -1 --format="%h")
101 FC_VER_MAJOR := $(shell grep " FC_VERSION_MAJOR" src/main/build/version.h | awk '{print $$3}' )
102 FC_VER_MINOR := $(shell grep " FC_VERSION_MINOR" src/main/build/version.h | awk '{print $$3}' )
103 FC_VER_PATCH := $(shell grep " FC_VERSION_PATCH" src/main/build/version.h | awk '{print $$3}' )
105 FC_VER := $(FC_VER_MAJOR).$(FC_VER_MINOR).$(FC_VER_PATCH)
107 # Search path for sources
108 VPATH := $(SRC_DIR):$(SRC_DIR)/startup
109 USBFS_DIR = $(ROOT)/lib/main/STM32_USB-FS-Device_Driver
110 USBPERIPH_SRC = $(notdir $(wildcard $(USBFS_DIR)/src/*.c))
111 FATFS_DIR = $(ROOT)/lib/main/FatFS
112 FATFS_SRC = $(notdir $(wildcard $(FATFS_DIR)/*.c))
114 CSOURCES := $(shell find $(SRC_DIR) -name '*.c')
116 LD_FLAGS :=
119 # Default Tool options - can be overridden in {mcu}.mk files.
121 ifeq ($(DEBUG),GDB)
122 OPTIMISE_DEFAULT := -Og
124 LTO_FLAGS := $(OPTIMISE_DEFAULT)
125 DEBUG_FLAGS = -ggdb3 -DDEBUG
126 else
127 ifeq ($(DEBUG),INFO)
128 DEBUG_FLAGS = -ggdb3
129 endif
130 OPTIMISATION_BASE := -flto -fuse-linker-plugin -ffast-math
131 OPTIMISE_DEFAULT := -O2
132 OPTIMISE_SPEED := -Ofast
133 OPTIMISE_SIZE := -Os
135 LTO_FLAGS := $(OPTIMISATION_BASE) $(OPTIMISE_SPEED)
136 endif
138 VPATH := $(VPATH):$(ROOT)/make/mcu
139 VPATH := $(VPATH):$(ROOT)/make
141 # start specific includes
142 include $(ROOT)/make/mcu/$(TARGET_MCU).mk
144 # openocd specific includes
145 include $(ROOT)/make/openocd.mk
147 # Configure default flash sizes for the targets (largest size specified gets hit first) if flash not specified already.
148 ifeq ($(FLASH_SIZE),)
149 ifneq ($(TARGET_FLASH),)
150 FLASH_SIZE := $(TARGET_FLASH)
151 else
152 $(error FLASH_SIZE not configured for target $(TARGET))
153 endif
154 endif
156 DEVICE_FLAGS := $(DEVICE_FLAGS) -DFLASH_SIZE=$(FLASH_SIZE)
158 ifneq ($(HSE_VALUE),)
159 DEVICE_FLAGS := $(DEVICE_FLAGS) -DHSE_VALUE=$(HSE_VALUE)
160 endif
162 ifneq ($(FEATURE_CUT_LEVEL_SUPPLIED),)
163 DEVICE_FLAGS := $(DEVICE_FLAGS) -DFEATURE_CUT_LEVEL=$(FEATURE_CUT_LEVEL_SUPPLIED)
164 else ifneq ($(FEATURE_CUT_LEVEL),)
165 DEVICE_FLAGS := $(DEVICE_FLAGS) -DFEATURE_CUT_LEVEL=$(FEATURE_CUT_LEVEL)
166 endif
168 TARGET_DIR = $(ROOT)/src/main/target/$(BASE_TARGET)
169 TARGET_DIR_SRC = $(notdir $(wildcard $(TARGET_DIR)/*.c))
171 ifeq ($(OPBL),yes)
172 TARGET_FLAGS := -DOPBL $(TARGET_FLAGS)
173 .DEFAULT_GOAL := binary
174 else
175 .DEFAULT_GOAL := hex
176 endif
178 INCLUDE_DIRS := $(INCLUDE_DIRS) \
179 $(ROOT)/lib/main/MAVLink
181 INCLUDE_DIRS := $(INCLUDE_DIRS) \
182 $(TARGET_DIR)
184 VPATH := $(VPATH):$(TARGET_DIR)
186 include $(ROOT)/make/source.mk
188 ###############################################################################
189 # Things that might need changing to use different tools
192 # Find out if ccache is installed on the system
193 CCACHE := ccache
194 RESULT = $(shell (which $(CCACHE) > /dev/null 2>&1; echo $$?) )
195 ifneq ($(RESULT),0)
196 CCACHE :=
197 endif
199 # Tool names
200 CROSS_CC := $(CCACHE) $(ARM_SDK_PREFIX)gcc
201 CROSS_CXX := $(CCACHE) $(ARM_SDK_PREFIX)g++
202 CROSS_GDB := $(ARM_SDK_PREFIX)gdb
203 OBJCOPY := $(ARM_SDK_PREFIX)objcopy
204 OBJDUMP := $(ARM_SDK_PREFIX)objdump
205 SIZE := $(ARM_SDK_PREFIX)size
208 # Tool options.
210 CC_DEBUG_OPTIMISATION := $(OPTIMISE_DEFAULT)
211 CC_DEFAULT_OPTIMISATION := $(OPTIMISATION_BASE) $(OPTIMISE_DEFAULT)
212 CC_SPEED_OPTIMISATION := $(OPTIMISATION_BASE) $(OPTIMISE_SPEED)
213 CC_SIZE_OPTIMISATION := $(OPTIMISATION_BASE) $(OPTIMISE_SIZE)
215 CFLAGS += $(ARCH_FLAGS) \
216 $(addprefix -D,$(OPTIONS)) \
217 $(addprefix -I,$(INCLUDE_DIRS)) \
218 $(DEBUG_FLAGS) \
219 -std=gnu11 \
220 -Wall -Wextra -Wunsafe-loop-optimizations -Wdouble-promotion \
221 -ffunction-sections \
222 -fdata-sections \
223 -fno-common \
224 -pedantic \
225 $(DEVICE_FLAGS) \
226 -D_GNU_SOURCE \
227 -DUSE_STDPERIPH_DRIVER \
228 -D$(TARGET) \
229 $(TARGET_FLAGS) \
230 -D'__FORKNAME__="$(FORKNAME)"' \
231 -D'__TARGET__="$(TARGET)"' \
232 -D'__REVISION__="$(REVISION)"' \
233 -save-temps=obj \
234 -MMD -MP \
235 $(EXTRA_FLAGS)
237 ASFLAGS = $(ARCH_FLAGS) \
238 $(DEBUG_FLAGS) \
239 -x assembler-with-cpp \
240 $(addprefix -I,$(INCLUDE_DIRS)) \
241 -MMD -MP
243 ifeq ($(LD_FLAGS),)
244 LD_FLAGS = -lm \
245 -nostartfiles \
246 --specs=nano.specs \
247 -lc \
248 -lnosys \
249 $(ARCH_FLAGS) \
250 $(LTO_FLAGS) \
251 $(DEBUG_FLAGS) \
252 -static \
253 -Wl,-gc-sections,-Map,$(TARGET_MAP) \
254 -Wl,-L$(LINKER_DIR) \
255 -Wl,--cref \
256 -Wl,--no-wchar-size-warning \
257 -Wl,--print-memory-usage \
258 -T$(LD_SCRIPT)
259 endif
261 ###############################################################################
262 # No user-serviceable parts below
263 ###############################################################################
265 CPPCHECK = cppcheck $(CSOURCES) --enable=all --platform=unix64 \
266 --std=c99 --inline-suppr --quiet --force \
267 $(addprefix -I,$(INCLUDE_DIRS)) \
268 -I/usr/include -I/usr/include/linux
271 # Things we will build
273 TARGET_BIN = $(BIN_DIR)/$(FORKNAME)_$(FC_VER)_$(TARGET).bin
274 TARGET_HEX = $(BIN_DIR)/$(FORKNAME)_$(FC_VER)_$(TARGET).hex
275 TARGET_ELF = $(OBJECT_DIR)/$(FORKNAME)_$(TARGET).elf
276 TARGET_LST = $(OBJECT_DIR)/$(FORKNAME)_$(TARGET).lst
277 TARGET_OBJS = $(addsuffix .o,$(addprefix $(OBJECT_DIR)/$(TARGET)/,$(basename $(SRC))))
278 TARGET_DEPS = $(addsuffix .d,$(addprefix $(OBJECT_DIR)/$(TARGET)/,$(basename $(SRC))))
279 TARGET_MAP = $(OBJECT_DIR)/$(FORKNAME)_$(TARGET).map
282 CLEAN_ARTIFACTS := $(TARGET_BIN)
283 CLEAN_ARTIFACTS += $(TARGET_HEX)
284 CLEAN_ARTIFACTS += $(TARGET_ELF) $(TARGET_OBJS) $(TARGET_MAP)
285 CLEAN_ARTIFACTS += $(TARGET_LST)
287 # Make sure build date and revision is updated on every incremental build
288 $(OBJECT_DIR)/$(TARGET)/build/version.o : $(SRC)
290 # List of buildable ELF files and their object dependencies.
291 # It would be nice to compute these lists, but that seems to be just beyond make.
293 $(TARGET_LST): $(TARGET_ELF)
294 $(V0) $(OBJDUMP) -S --disassemble $< > $@
296 $(TARGET_HEX): $(TARGET_ELF)
297 @echo "Creating HEX $(TARGET_HEX)" "$(STDOUT)"
298 $(V1) $(OBJCOPY) -O ihex --set-start 0x8000000 $< $@
300 $(TARGET_BIN): $(TARGET_ELF)
301 @echo "Creating BIN $(TARGET_BIN)" "$(STDOUT)"
302 $(V1) $(OBJCOPY) -O binary $< $@
304 $(TARGET_ELF): $(TARGET_OBJS)
305 @echo "Linking $(TARGET)" "$(STDOUT)"
306 $(V1) $(CROSS_CC) -o $@ $^ $(LD_FLAGS)
307 $(V1) $(SIZE) $(TARGET_ELF)
309 # Compile
310 ifeq ($(DEBUG),GDB)
311 $(OBJECT_DIR)/$(TARGET)/%.o: %.c
312 $(V1) mkdir -p $(dir $@)
313 $(V1) echo "%% (debug) $(notdir $<)" "$(STDOUT)" && \
314 $(CROSS_CC) -c -o $@ $(CFLAGS) $(CC_DEBUG_OPTIMISATION) $<
315 else
316 $(OBJECT_DIR)/$(TARGET)/%.o: %.c
317 $(V1) mkdir -p $(dir $@)
318 $(V1) $(if $(findstring $(subst ./src/main/,,$<),$(SPEED_OPTIMISED_SRC)), \
319 echo "%% (speed optimised) $(notdir $<)" "$(STDOUT)" && \
320 $(CROSS_CC) -c -o $@ $(CFLAGS) $(CC_SPEED_OPTIMISATION) $<, \
321 $(if $(findstring $(subst ./src/main/,,$<),$(SIZE_OPTIMISED_SRC)), \
322 echo "%% (size optimised) $(notdir $<)" "$(STDOUT)" && \
323 $(CROSS_CC) -c -o $@ $(CFLAGS) $(CC_SIZE_OPTIMISATION) $<, \
324 echo "%% $(notdir $<)" "$(STDOUT)" && \
325 $(CROSS_CC) -c -o $@ $(CFLAGS) $(CC_DEFAULT_OPTIMISATION) $<))
326 endif
328 # Assemble
329 $(OBJECT_DIR)/$(TARGET)/%.o: %.s
330 $(V1) mkdir -p $(dir $@)
331 @echo "%% $(notdir $<)" "$(STDOUT)"
332 $(V1) $(CROSS_CC) -c -o $@ $(ASFLAGS) $<
334 $(OBJECT_DIR)/$(TARGET)/%.o: %.S
335 $(V1) mkdir -p $(dir $@)
336 @echo "%% $(notdir $<)" "$(STDOUT)"
337 $(V1) $(CROSS_CC) -c -o $@ $(ASFLAGS) $<
340 ## all : Build all targets (excluding unsupported)
341 all: $(SUPPORTED_TARGETS)
343 ## all_with_unsupported : Build all targets (including unsupported)
344 all_with_unsupported: $(VALID_TARGETS)
346 ## unsupported : Build unsupported targets
347 unsupported: $(UNSUPPORTED_TARGETS)
349 ## official : Build all official (travis) targets
350 official: $(OFFICIAL_TARGETS)
352 ## targets-group-1 : build some targets
353 targets-group-1: $(GROUP_1_TARGETS)
355 ## targets-group-2 : build some targets
356 targets-group-2: $(GROUP_2_TARGETS)
358 ## targets-group-3 : build some targets
359 targets-group-3: $(GROUP_3_TARGETS)
361 ## targets-group-3 : build some targets
362 targets-group-4: $(GROUP_4_TARGETS)
364 ## targets-group-rest: build the rest of the targets (not listed in group 1, 2 or 3)
365 targets-group-rest: $(GROUP_OTHER_TARGETS)
367 $(VALID_TARGETS):
368 $(V0) @echo "Building $@" && \
369 $(MAKE) binary hex TARGET=$@ && \
370 echo "Building $@ succeeded."
372 $(NOBUILD_TARGETS):
373 $(MAKE) TARGET=$@
375 CLEAN_TARGETS = $(addprefix clean_,$(VALID_TARGETS) )
376 TARGETS_CLEAN = $(addsuffix _clean,$(VALID_TARGETS) )
378 ## clean : clean up temporary / machine-generated files
379 clean:
380 @echo "Cleaning $(TARGET)"
381 $(V0) rm -f $(CLEAN_ARTIFACTS)
382 $(V0) rm -rf $(OBJECT_DIR)/$(TARGET)
383 @echo "Cleaning $(TARGET) succeeded."
385 ## clean_test : clean up temporary / machine-generated files (tests)
386 clean_test:
387 $(V0) cd src/test && $(MAKE) clean || true
389 ## clean_<TARGET> : clean up one specific target
390 $(CLEAN_TARGETS):
391 $(V0) $(MAKE) -j TARGET=$(subst clean_,,$@) clean
393 ## <TARGET>_clean : clean up one specific target (alias for above)
394 $(TARGETS_CLEAN):
395 $(V0) $(MAKE) -j TARGET=$(subst _clean,,$@) clean
397 ## clean_all : clean all valid targets
398 clean_all: $(CLEAN_TARGETS)
400 ## all_clean : clean all valid targets (alias for above)
401 all_clean: $(TARGETS_CLEAN)
404 flash_$(TARGET): $(TARGET_HEX)
405 $(V0) stty -F $(SERIAL_DEVICE) raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon
406 $(V0) echo -n 'R' >$(SERIAL_DEVICE)
407 $(V0) stm32flash -w $(TARGET_HEX) -v -g 0x0 -b 115200 $(SERIAL_DEVICE)
409 ## flash : flash firmware (.hex) onto flight controller
410 flash: flash_$(TARGET)
412 st-flash_$(TARGET): $(TARGET_BIN)
413 $(V0) st-flash --reset write $< 0x08000000
415 ## st-flash : flash firmware (.bin) onto flight controller
416 st-flash: st-flash_$(TARGET)
418 ifneq ($(OPENOCD_COMMAND),)
419 openocd-gdb: $(TARGET_ELF)
420 $(V0) $(OPENOCD_COMMAND) & $(CROSS_GDB) $(TARGET_ELF) -ex "target remote localhost:3333" -ex "load"
421 endif
423 binary:
424 $(V0) $(MAKE) -j $(TARGET_BIN)
426 hex:
427 $(V0) $(MAKE) -j $(TARGET_HEX)
429 unbrick_$(TARGET): $(TARGET_HEX)
430 $(V0) stty -F $(SERIAL_DEVICE) raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon
431 $(V0) stm32flash -w $(TARGET_HEX) -v -g 0x0 -b 115200 $(SERIAL_DEVICE)
433 ## unbrick : unbrick flight controller
434 unbrick: unbrick_$(TARGET)
436 ## cppcheck : run static analysis on C source code
437 cppcheck: $(CSOURCES)
438 $(V0) $(CPPCHECK)
440 cppcheck-result.xml: $(CSOURCES)
441 $(V0) $(CPPCHECK) --xml-version=2 2> cppcheck-result.xml
443 # mkdirs
444 $(DL_DIR):
445 mkdir -p $@
447 $(TOOLS_DIR):
448 mkdir -p $@
450 $(BUILD_DIR):
451 mkdir -p $@
453 ## version : print firmware version
454 version:
455 @echo $(FC_VER)
457 ## help : print this help message and exit
458 help: Makefile make/tools.mk
459 @echo ""
460 @echo "Makefile for the $(FORKNAME) firmware"
461 @echo ""
462 @echo "Usage:"
463 @echo " make [V=<verbosity>] [TARGET=<target>] [OPTIONS=\"<options>\"]"
464 @echo "Or:"
465 @echo " make <target> [V=<verbosity>] [OPTIONS=\"<options>\"]"
466 @echo ""
467 @echo "Valid TARGET values are: $(VALID_TARGETS)"
468 @echo ""
469 @sed -n 's/^## //p' $?
471 ## targets : print a list of all valid target platforms (for consumption by scripts)
472 targets:
473 @echo "Valid targets: $(VALID_TARGETS)"
474 @echo "Supported targets: $(SUPPORTED_TARGETS)"
475 @echo "Unsupported targets: $(UNSUPPORTED_TARGETS)"
476 @echo "Target: $(TARGET)"
477 @echo "Base target: $(BASE_TARGET)"
478 @echo "targets-group-1: $(GROUP_1_TARGETS)"
479 @echo "targets-group-2: $(GROUP_2_TARGETS)"
480 @echo "targets-group-3: $(GROUP_3_TARGETS)"
481 @echo "targets-group-4: $(GROUP_4_TARGETS)"
482 @echo "targets-group-rest: $(GROUP_OTHER_TARGETS)"
484 @echo "targets-group-1: $(words $(GROUP_1_TARGETS)) targets"
485 @echo "targets-group-2: $(words $(GROUP_2_TARGETS)) targets"
486 @echo "targets-group-3: $(words $(GROUP_3_TARGETS)) targets"
487 @echo "targets-group-4: $(words $(GROUP_4_TARGETS)) targets"
488 @echo "targets-group-rest: $(words $(GROUP_OTHER_TARGETS)) targets"
489 @echo "total in all groups $(words $(SUPPORTED_TARGETS)) targets"
491 ## target-mcu : print the MCU type of the target
492 target-mcu:
493 @echo $(TARGET_MCU)
495 ## targets-by-mcu : make all targets that have a MCU_TYPE mcu
496 targets-by-mcu:
497 $(V1) for target in $(VALID_TARGETS); do \
498 TARGET_MCU_TYPE=$$($(MAKE) -s TARGET=$${target} target-mcu); \
499 if [ "$${TARGET_MCU_TYPE}" = "$${MCU_TYPE}" ]; then \
500 if [ "$${DO_BUILD}" = 1 ]; then \
501 echo "Building target $${target}..."; \
502 $(MAKE) TARGET=$${target}; \
503 if [ $$? -ne 0 ]; then \
504 echo "Building target $${target} failed, aborting."; \
505 exit 1; \
506 fi; \
507 else \
508 echo -n "$${target} "; \
509 fi; \
510 fi; \
511 done
512 @echo
514 ## targets-f3 : make all F3 targets
515 targets-f3:
516 $(V1) $(MAKE) -s targets-by-mcu MCU_TYPE=STM32F3 DO_BUILD=1
518 targets-f3-print:
519 $(V1) $(MAKE) -s targets-by-mcu MCU_TYPE=STM32F3
521 ## targets-f4 : make all F4 targets
522 targets-f4:
523 $(V1) $(MAKE) -s targets-by-mcu MCU_TYPE=STM32F4 DO_BUILD=1
525 targets-f4-print:
526 $(V1) $(MAKE) -s targets-by-mcu MCU_TYPE=STM32F4
528 ## targets-f7 : make all F7 targets
529 targets-f7:
530 $(V1) $(MAKE) -s targets-by-mcu MCU_TYPE=STM32F7 DO_BUILD=1
532 targets-f7-print:
533 $(V1) $(MAKE) -s targets-by-mcu MCU_TYPE=STM32F7
535 ## test : run the Betaflight test suite
536 ## junittest : run the Betaflight test suite, producing Junit XML result files.
537 ## test-representative: run a representative subset of the Betaflight test suite (i.e. run all tests, but run each expanded test only for one target)
538 test junittest test-representative:
539 $(V0) cd src/test && $(MAKE) $@
541 ## test_help : print the help message for the test suite (including a list of the available tests)
542 test_help:
543 $(V0) cd src/test && $(MAKE) help
545 ## test_% : run test 'test_%' from the test suite
546 test_%:
547 $(V0) cd src/test && $(MAKE) $@
550 check-target-independence:
551 $(V1) for test_target in $(VALID_TARGETS); do \
552 FOUND=$$(grep -rE "\W$${test_target}\W?" src/main | grep -vE "(//)|(/\*).*\W$${test_target}\W?" | grep -vE "^src/main/target"); \
553 if [ "$${FOUND}" != "" ]; then \
554 echo "Target dependencies found:"; \
555 echo "$${FOUND}"; \
556 exit 1; \
557 fi; \
558 done
560 check-fastram-usage-correctness:
561 $(V1) NON_TRIVIALLY_INITIALIZED=$$(grep -Ern "\W?FAST_RAM_ZERO_INIT\W.*=.*" src/main/ | grep -Ev "=\s*(false|NULL|0(\.0*f?)?)\s*[,;]"); \
562 if [ "$${NON_TRIVIALLY_INITIALIZED}" != "" ]; then \
563 echo "Non-trivially initialized FAST_RAM_ZERO_INIT variables found, use FAST_RAM instead:"; \
564 echo "$${NON_TRIVIALLY_INITIALIZED}"; \
565 exit 1; \
566 fi; \
567 TRIVIALLY_INITIALIZED=$$(grep -Ern "\W?FAST_RAM\W.*;" src/main/ | grep -v "="); \
568 EXPLICITLY_TRIVIALLY_INITIALIZED=$$(grep -Ern "\W?FAST_RAM\W.*;" src/main/ | grep -E "=\s*(false|NULL|0(\.0*f?)?)\s*[,;]"); \
569 if [ "$${TRIVIALLY_INITIALIZED}$${EXPLICITLY_TRIVIALLY_INITIALIZED}" != "" ]; then \
570 echo "Trivially initialized FAST_RAM variables found, use FAST_RAM_ZERO_INIT instead to save FLASH:"; \
571 echo "$${TRIVIALLY_INITIALIZED}\n$${EXPLICITLY_TRIVIALLY_INITIALIZED}"; \
572 exit 1; \
575 # rebuild everything when makefile changes
576 $(TARGET_OBJS): Makefile $(TARGET_DIR)/target.mk
579 # include auto-generated dependencies
580 -include $(TARGET_DEPS)