makefile 1.74 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#
#             LUFA Library
#     Copyright (C) Dean Camera, 2011.
#
#  dean [at] fourwalledcubicle [dot] com
#           www.lufa-lib.org
#

# Makefile for the board driver build test. This
# test attempts to build a dummy project with all
# possible board targets using their respective
# compiler.

# Path to the root of the LUFA tree to scan
LUFA_ROOT_PATH    = ../..


all: begin makeboardlist testboards clean end

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

end:
	@echo Build test "BoardDriverTest" complete.
	@echo

makeboardlist:
	@grep "BOARD_" $(LUFA_ROOT_PATH)/LUFA/Common/BoardTypes.h | cut -d'#' -f2 | cut -d' ' -f2 | grep "BOARD_" > BoardList.txt
	
testboards:
32
	@echo "buildtest:" > BuildMakefile
33
	
34
35
	@while read line; \
	 do \
36
	   build_cfg=`grep "$$line " BoardDeviceMap.cfg | sed 's/ //g' | grep -v "#" | cut -d'=' -f2-`; \
37
38
	   \
	   build_board=$$line; \
39
40
	   build_arch=`echo $$build_cfg | cut -d':' -f1`; \
	   build_mcu=`echo $$build_cfg | cut -d':' -f2`; \
41
42
	   \
	   if ( test -z "$$build_cfg" ); then \
43
	     echo "No matching information set for board $$build_board"; \
44
	   else \
45
46
	     echo "Found board configuration for $$build_board - $$build_arch, $$build_mcu"; \
		 \
47
		 printf "\t@echo Building dummy project for $$build_board...\n" >> BuildMakefile; \
48
		 printf "\tmake -s -f makefile.%s clean\n" $$build_arch >> BuildMakefile; \
49
		 printf "\tmake -s -f makefile.%s MCU=%s BOARD=%s elf\n\n" $$build_arch $$build_mcu $$build_board >> BuildMakefile; \
50
51
	   fi; \
	 done < BoardList.txt
52
	 
53
	 $(MAKE) -f BuildMakefile buildtest
54
55
56
57
58
59
60
61
62
63

clean:
	rm -f BuildMakefile
	rm -f BoardList.txt
	$(MAKE) -f makefile.avr8 clean
	$(MAKE) -f makefile.xmega clean
	$(MAKE) -f makefile.uc3 clean

%: