makefile 2.62 KB
Newer Older
1
2
#
#             LUFA Library
Dean Camera's avatar
Dean Camera committed
3
#     Copyright (C) Dean Camera, 2017.
4
5
6
7
8
9
10
11
12
13
#
#  dean [at] fourwalledcubicle [dot] com
#           www.lufa-lib.org
#

# Makefile for the bootloader build test. This
# test attempts to build all the bootloaders
# with all supported device configurations.

# Path to the LUFA library core
14
LUFA_PATH := ../../LUFA/
15

16
17
# Build test cannot be run with multiple parallel jobs
.NOTPARALLEL:
18
19
20
21
22
23
24
25
26
27

all: begin testbootloaders clean end

begin:
	@echo Executing build test "BootloaderTest".
	@echo

end:
	@echo Build test "BootloaderTest" complete.
	@echo
Dean Camera's avatar
Dean Camera committed
28

29
30
testbootloaders:
	@echo "buildtest:" > BuildMakefile
Dean Camera's avatar
Dean Camera committed
31

32
33
34
35
36
37
38
39
40
41
42
43
44
	@while read line;                                         \
	 do                                                       \
	   build_cfg=`echo $$line | grep -v "#" | sed 's/ //g'`;  \
	                                                          \
	   if ( test -n "$$build_cfg" ); then                     \
	     build_bootloader=`echo $$build_cfg | cut -d'=' -f1`; \
		 build_cfg=`echo $$build_cfg | cut -d'=' -f2-`;       \
		                                                      \
	     build_arch=`echo $$build_cfg | cut -d':' -f1`;       \
	     build_mcu=`echo $$build_cfg | cut -d':' -f2`;        \
	     build_board=`echo $$build_cfg | cut -d':' -f3`;      \
	     build_flashsize=`echo $$build_cfg | cut -d':' -f4`;  \
	     build_bootsize=`echo $$build_cfg | cut -d':' -f5`;   \
45
	     build_fusb=`echo $$build_cfg | cut -d':' -f6`;       \
46
	                                                          \
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; \
48
	                                                          \
49
50
	     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; \
	     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; \
51
52
	   fi;                                                    \
	 done < BootloaderDeviceMap.cfg
Dean Camera's avatar
Dean Camera committed
53

54
55
56
57
58
59
60
61
62
	 $(MAKE) -f BuildMakefile buildtest

clean:
	rm -f BuildMakefile

%:

.PHONY: all begin end testbootloaders clean

63
64
65
# Include common DMBS build system modules
DMBS_PATH      ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk