makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 board driver build test. This
  9. # test attempts to build a dummy project with all
  10. # possible board targets using their respective
  11. # compiler.
  12. # Path to the LUFA library core
  13. LUFA_PATH := ../../LUFA/
  14. # Build test cannot be run with multiple parallel jobs
  15. .NOTPARALLEL:
  16. all: begin makeboardlist testboards clean end
  17. begin:
  18. @echo Executing build test "BoardDriverTest".
  19. @echo
  20. end:
  21. @echo Build test "BoardDriverTest" complete.
  22. @echo
  23. makeboardlist:
  24. @grep "BOARD_" $(patsubst %/,%,$(LUFA_PATH))/Common/BoardTypes.h | cut -d'#' -f2 | cut -d' ' -f2 | grep "BOARD_" > BoardList.txt
  25. testboards:
  26. @echo "buildtest:" > BuildMakefile
  27. @while read line; \
  28. do \
  29. build_cfg=`grep "$$line " BoardDeviceMap.cfg | grep -v "#" | cut -d'=' -f2- | sed 's/ //g'`; \
  30. \
  31. build_board=$$line; \
  32. build_arch=`echo $$build_cfg | cut -d':' -f1`; \
  33. build_mcu=`echo $$build_cfg | cut -d':' -f2`; \
  34. \
  35. if ( test -z "$$build_cfg" ); then \
  36. echo "No matching information set for board $$build_board"; \
  37. else \
  38. echo "Found board configuration for $$build_board - $$build_arch, $$build_mcu"; \
  39. \
  40. printf "\t@echo Building dummy project for $$build_board...\n" >> BuildMakefile; \
  41. printf "\t$(MAKE) -f makefile.test clean elf MCU=%s ARCH=%s BOARD=%s\n\n" $$build_mcu $$build_arch $$build_board >> BuildMakefile; \
  42. fi; \
  43. done < BoardList.txt
  44. $(MAKE) -f BuildMakefile buildtest
  45. clean:
  46. rm -f BuildMakefile
  47. rm -f BoardList.txt
  48. $(MAKE) -f makefile.test clean BOARD=NONE ARCH=AVR8 MCU=at90usb1287
  49. $(MAKE) -f makefile.test clean BOARD=NONE ARCH=XMEGA MCU=atxmega128a1u
  50. $(MAKE) -f makefile.test clean BOARD=NONE ARCH=UC3 MCU=uc3a0256
  51. %:
  52. .PHONY: all begin end makeboardlist testboards clean
  53. # Include common DMBS build system modules
  54. DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
  55. include $(DMBS_PATH)/core.mk