3 # Copyright (C) Dean Camera, 2013.
5 # dean [at] fourwalledcubicle [dot] com
9 # Maintenance scripts not required by general LUFA users, used for project development purposes.
12 # Path to the root of the LUFA tree
17 # Generate a header containing all library functions
19 $(MAKE) -C $(patsubst %/,%,$(LUFA_ROOT))/LUFA doxygen DOXYGEN_OVERRIDE_PARAMS="GENERATE_HTML=no GENERATE_XML=yes"
20 @xsltproc $(patsubst %/,%,$(LUFA_ROOT))/LUFA/Documentation/xml/combine.xslt $(patsubst %/,%,$(LUFA_ROOT))/LUFA/Documentation/xml/index.xml > temp.xml
21 @xsltproc lufa_functionlist_transform.xslt temp.xml > function_list.h
24 # Update all Doxygen configuration files to the latest Doxygen version - force Markdown support to be disabled
26 @echo Upgrading Doxygen.conf files...
27 @for doxygen_conf in `find $(LUFA_ROOT) -name Doxygen.conf`; do \
28 doxygen -u $$doxygen_conf; \
30 @echo Doxygen configuration update complete.
32 # Make all possible bootloaders for all targets and configurations as set by the BootloaderTest build test
33 # and store them in a separate directory called "Bootloaders"
35 @echo "build_bootloaders:" > BuildMakefile
36 @printf "\t-mkdir Bootloaders 2>/dev/null\n\n" >> BuildMakefile
40 build_cfg=`echo $$line | grep -v "#" | sed 's/ //g'`; \
42 if ( test -n "$$build_cfg" ); then \
43 build_bootloader=`echo $$build_cfg | cut -d'=' -f1`; \
44 build_cfg=`echo $$build_cfg | cut -d'=' -f2-`; \
46 build_arch=`echo $$build_cfg | cut -d':' -f1`; \
47 build_mcu=`echo $$build_cfg | cut -d':' -f2`; \
48 build_board=`echo $$build_cfg | cut -d':' -f3`; \
49 build_flashsize=`echo $$build_cfg | cut -d':' -f4`; \
50 build_bootsize=`echo $$build_cfg | cut -d':' -f5`; \
51 build_fusb=`echo $$build_cfg | cut -d':' -f6`; \
53 printf "Found '%s' with 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; \
55 printf "\t-mkdir Bootloaders/%s 2>/dev/null\n" $$build_bootloader >> BuildMakefile; \
56 printf "\t@echo Building '%s' with FLASH: %3s KB, BOOT: %3s KB, MCU: %12s, BOARD: %s, F_USB: %sMHz\n" $$build_bootloader $$build_flashsize $$build_bootsize $$build_mcu $$build_board $$build_fusb >> BuildMakefile; \
57 printf "\t$(MAKE) -C $(patsubst %/,%,$(LUFA_ROOT))/Bootloaders/%s/ clean hex ARCH=%s MCU=%s BOARD=%s FLASH_SIZE_KB=%s BOOT_SECTION_SIZE_KB=%s F_USB=%s000000 DEBUG_LEVEL=0\n" $$build_bootloader $$build_arch $$build_mcu $$build_board $$build_flashsize $$build_bootsize $$build_fusb >> BuildMakefile; \
58 printf "\tmv $(patsubst %/,%,$(LUFA_ROOT))/Bootloaders/%s/Bootloader%s.hex Bootloaders/%s/%s-%s-%s-BOARD_%s-BOOT_%sKB-%sMHz.hex\n\n" $$build_bootloader $$build_bootloader $$build_bootloader $$build_bootloader $$build_arch $$build_mcu $$build_board $$build_bootsize $$build_fusb >> BuildMakefile; \
60 done < $(patsubst %/,%,$(LUFA_ROOT))/BuildTests/BootloaderTest/BootloaderDeviceMap.cfg
62 $(MAKE) -f BuildMakefile build_bootloaders
63 cp $(patsubst %/,%,$(LUFA_ROOT))/LUFA/License.txt Bootloaders
66 # Check the working branch documentation, ensure no placeholder values
67 check-documentation-placeholders:
68 @echo Checking for release suitability...
69 @if ( grep "XXXXXX" $(patsubst %/,%,$(LUFA_ROOT))/LUFA/DoxygenPages/*.txt > /dev/null ;); then \
70 echo " ERROR: Doxygen documentation has not been updated for release!"; \
73 @if ( grep "000000" $(patsubst %/,%,$(LUFA_ROOT))/LUFA/Version.h > /dev/null ;); then \
74 echo " ERROR: Version header has not been updated for release!"; \
79 # Validate the working branch - compile all documentation, demos/projects/examples and run build tests
81 $(MAKE) -C $(patsubst %/,%,$(LUFA_ROOT)) doxygen
82 $(MAKE) -C $(patsubst %/,%,$(LUFA_ROOT)) all DEBUG_LEVEL=0
83 $(MAKE) -C $(patsubst %/,%,$(LUFA_ROOT))/BuildTests all
85 # Validate the working branch for general release, check for placeholder documentation then build and test everything
86 validate-release: check-documentation-placeholders validate-branch
89 .PHONY: all upgrade-doxygen bootloaders check-documentation-placeholders validate-branch