makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #
  2. # LUFA Library
  3. # Copyright (C) Dean Camera, 2018.
  4. #
  5. # dean [at] fourwalledcubicle [dot] com
  6. # www.lufa-lib.org
  7. #
  8. # Makefile for the bootloader build test. This
  9. # test attempts to build all the bootloaders
  10. # with all supported device configurations.
  11. # Path to the LUFA library core
  12. LUFA_PATH := ../../LUFA/
  13. # Build test cannot be run with multiple parallel jobs
  14. .NOTPARALLEL:
  15. all: begin testbootloaders clean end
  16. begin:
  17. @echo Executing build test "BootloaderTest".
  18. @echo
  19. end:
  20. @echo Build test "BootloaderTest" complete.
  21. @echo
  22. testbootloaders:
  23. @echo "buildtest:" > BuildMakefile
  24. @while read line; \
  25. do \
  26. build_cfg=`echo $$line | grep -v "#" | sed 's/ //g'`; \
  27. \
  28. if ( test -n "$$build_cfg" ); then \
  29. build_bootloader=`echo $$build_cfg | cut -d'=' -f1`; \
  30. build_cfg=`echo $$build_cfg | cut -d'=' -f2-`; \
  31. \
  32. build_arch=`echo $$build_cfg | cut -d':' -f1`; \
  33. build_mcu=`echo $$build_cfg | cut -d':' -f2`; \
  34. build_board=`echo $$build_cfg | cut -d':' -f3`; \
  35. build_flashsize=`echo $$build_cfg | cut -d':' -f4`; \
  36. build_bootsize=`echo $$build_cfg | cut -d':' -f5`; \
  37. build_fusb=`echo $$build_cfg | cut -d':' -f6`; \
  38. \
  39. 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; \
  40. \
  41. 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; \
  42. 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; \
  43. fi; \
  44. done < BootloaderDeviceMap.cfg
  45. $(MAKE) -f BuildMakefile buildtest
  46. clean:
  47. rm -f BuildMakefile
  48. %:
  49. .PHONY: all begin end testbootloaders clean
  50. # Include common DMBS build system modules
  51. DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
  52. include $(DMBS_PATH)/core.mk