3 #     Copyright (C) Dean Camera, 2018.
 
   5 #  dean [at] fourwalledcubicle [dot] com
 
   9 # Makefile for the bootloader build test. This
 
  10 # test attempts to build all the bootloaders
 
  11 # with all supported device configurations.
 
  13 # Path to the LUFA library core
 
  14 LUFA_PATH := ../../LUFA/
 
  16 # Build test cannot be run with multiple parallel jobs
 
  19 all: begin testbootloaders clean end
 
  22         @echo Executing build test "BootloaderTest".
 
  26         @echo Build test "BootloaderTest" complete.
 
  30         @echo "buildtest:" > BuildMakefile
 
  34            build_cfg=`echo $$line | grep -v "#" | sed 's/ //g'`;  \
 
  36            if ( test -n "$$build_cfg" ); then                     \
 
  37              build_bootloader=`echo $$build_cfg | cut -d'=' -f1`; \
 
  38                  build_cfg=`echo $$build_cfg | cut -d'=' -f2-`;       \
 
  40              build_arch=`echo $$build_cfg | cut -d':' -f1`;       \
 
  41              build_mcu=`echo $$build_cfg | cut -d':' -f2`;        \
 
  42              build_board=`echo $$build_cfg | cut -d':' -f3`;      \
 
  43              build_flashsize=`echo $$build_cfg | cut -d':' -f4`;  \
 
  44              build_bootsize=`echo $$build_cfg | cut -d':' -f5`;   \
 
  45              build_fusb=`echo $$build_cfg | cut -d':' -f6`;       \
 
  47              printf "Found '%s' bootloader configuration (FLASH: %3s KB | BOOT: %3s KB | MCU: %12s / %4s | BOARD: %s | F_USB: %sMHz)\n" $$build_bootloader $$build_flashsize $$build_bootsize $$build_mcu $$build_arch $$build_board $$build_fusb; \
 
  49              printf "\t@echo Building bootloader %s - %s - FLASH: %s KB, BOOT: %s KB, BOARD: %s, F_USB: %sMHz\n" $$build_bootloader $$build_mcu $$build_flashsize $$build_bootsize $$build_board $$build_fusb >> BuildMakefile; \
 
  50              printf "\t$(MAKE) -C $(patsubst %/,%,$(LUFA_PATH))/../Bootloaders/%s/ clean elf ARCH=%s MCU=%s BOARD=%s FLASH_SIZE_KB=%s BOOT_SECTION_SIZE_KB=%s F_USB=%s000000 DEBUG_LEVEL=0\n\n" $$build_bootloader $$build_arch $$build_mcu $$build_board $$build_flashsize $$build_bootsize $$build_fusb >> BuildMakefile; \
 
  52          done < BootloaderDeviceMap.cfg
 
  54          $(MAKE) -f BuildMakefile buildtest
 
  61 .PHONY: all begin end testbootloaders clean
 
  63 # Include common DMBS build system modules
 
  64 DMBS_PATH      ?= $(LUFA_PATH)/Build/DMBS/DMBS
 
  65 include $(DMBS_PATH)/core.mk