3 #     Copyright (C) Dean Camera, 2011.
 
   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 root of the LUFA tree to scan
 
  14 LUFA_ROOT_PATH    = ../..
 
  17 all: begin testbootloaders clean end
 
  20         @echo Executing build test "BootloaderTest".
 
  24         @echo Build test "BootloaderTest" complete.
 
  28         @echo "buildtest:" > BuildMakefile
 
  32            build_cfg=`echo $$line | sed 's/ //g' | grep -v "#"`; \
 
  34            if ( test -n "$$build_cfg" ); then \
 
  35              build_bootloader=`echo $$build_cfg | cut -d'=' -f1`; \
 
  36              build_arch=`echo $$build_cfg | cut -d'=' -f2- | cut -d':' -f1`; \
 
  37              build_mcu=`echo $$build_cfg | cut -d'=' -f2- | cut -d':' -f2`; \
 
  38              build_board=`echo $$build_cfg | cut -d'=' -f2- | cut -d':' -f3`; \
 
  39              build_flashsize=`echo $$build_cfg | cut -d'=' -f2- | cut -d':' -f4`; \
 
  40              build_bootsize=`echo $$build_cfg | cut -d'=' -f2- | cut -d':' -f5`; \
 
  42              printf "Found bootloader configuration for bootloader '%s' (FLASH: %3s KB | BOOT: %3s KB | MCU: %12s / %4s)\n" $$build_bootloader $$build_flashsize $$build_bootsize $$build_mcu $$build_arch; \
 
  44              printf "\t@echo Building bootloader %s - %s - FLASH: %s KB, BOOT: %s KB\n" $$build_bootloader $$build_mcu $$build_flashsize $$build_bootsize >> BuildMakefile; \
 
  45              printf "\tmake -s -C $(LUFA_ROOT_PATH)/Bootloaders/%s/ clean\n" $$build_bootloader >> BuildMakefile; \
 
  46              printf "\tmake -s -C $(LUFA_ROOT_PATH)/Bootloaders/%s/ MCU=%s BOARD=%s FLASH_SIZE_KB=%s BOOT_SECTION_SIZE_KB=%s elf\n\n" $$build_bootloader $$build_mcu $$build_board $$build_flashsize $$build_bootsize >> BuildMakefile; \
 
  48          done < BootloaderDeviceMap.cfg
 
  50          $(MAKE) -f BuildMakefile buildtest