X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/8820b1f6cce9a37fbe959cf7c756aed29bfd134f..3642ea0b9715cdf0196b10c9fc97898940eaefa6:/Maintenance/makefile diff --git a/Maintenance/makefile b/Maintenance/makefile index b5a3b7bcd..3ff93c184 100644 --- a/Maintenance/makefile +++ b/Maintenance/makefile @@ -1,6 +1,6 @@ # # LUFA Library -# Copyright (C) Dean Camera, 2012. +# Copyright (C) Dean Camera, 2015. # # dean [at] fourwalledcubicle [dot] com # www.lufa-lib.org @@ -14,66 +14,32 @@ LUFA_ROOT := ../ all: -# Update all Doxygen configuration files to the latest Doxygen version - force Markdown support to be disabled +# Print a list of all filenames and line numbers that exceed an allowed threshold +line-lengths: + awk '{ if (length > 120) { print FILENAME, ":", FNR, "[", length, "]" } }' `find $(LUFA_ROOT) -name *.[ch]` + +# Generate a header containing all library functions +function-list: + $(MAKE) -C $(patsubst %/,%,$(LUFA_ROOT))/LUFA doxygen DOXYGEN_OVERRIDE_PARAMS="GENERATE_HTML=no GENERATE_XML=yes" + @xsltproc $(patsubst %/,%,$(LUFA_ROOT))/LUFA/Documentation/xml/combine.xslt $(patsubst %/,%,$(LUFA_ROOT))/LUFA/Documentation/xml/index.xml > temp.xml + @xsltproc lufa_functionlist_transform.xslt temp.xml > function_list.h + @sort function_list.h | uniq > function_list_unique.h + @rm temp.xml + +# Update all Doxygen configuration files to the latest Doxygen version upgrade-doxygen: - @echo Upgrading Doxygen.conf files... - @for doxygen_conf in `find $(LUFA_ROOT) -name Doxygen.conf`; do \ - doxygen -u $$doxygen_conf; \ - sed "s/MARKDOWN_SUPPORT *= *YES/MARKDOWN_SUPPORT = NO/1" $$doxygen_conf > $$doxygen_conf.new; \ - sed "s/DISABLE_INDEX *= *NO/DISABLE_INDEX = YES/1" $$doxygen_conf.new > $$doxygen_conf.new2; \ - mv -u $$doxygen_conf.new2 $$doxygen_conf; \ - rm $$doxygen_conf.new; \ + @echo Upgrading Doxygen files... + @for doxygen_conf in `find $(LUFA_ROOT) -name doxyfile`; do \ + doxygen -u $$doxygen_conf; \ done; @echo Doxygen configuration update complete. -# Generate AVR Studio 4 project files for each project from a template -make-as4-projects: - @echo Creating AVR Studio 4 project files for Demos... - @for project_makefile in `find $(LUFA_ROOT)/Demos $(LUFA_ROOT)/Projects $(LUFA_ROOT)/Bootloaders -name makefile*`; do \ - target_name=`grep "TARGET *=" $$project_makefile | cut -d'=' -f2 | sed 's/ //g'`; \ - target_folder=`dirname $$project_makefile`; \ - as4_date=`date "+%-e-%b-%Y %-H:%-M:%-S"`; \ - \ - if ( test -n "$$target_name" ); then \ - echo Creating AS4 project for project $$target_name; \ - \ - source_files="`basename $$project_makefile`<\/OTHERFILE>"; \ - gcc_source_files=""; \ - for c_source_file in `find $$target_folder -name *.c`; do \ - source_filename=`basename $$c_source_file`; \ - \ - source_files="$$source_files$$source_filename<\/SOURCEFILE>"; \ - gcc_source_files="$$gcc_source_files$$source_filename<\/Name>"; \ - done; \ - for c_header_file in `find $$target_folder -name *.h`; do \ - source_filename=`basename $$c_header_file`; \ - \ - source_files="$$source_files$$source_filename<\/HEADERFILE>"; \ - gcc_source_files="$$gcc_source_files$$source_filename<\/Name>"; \ - done; \ - for assembly_file in `find $$target_folder -name *.S`; do \ - source_filename=`basename $$assembly_file`; \ - \ - source_files="$$source_files$$source_filename<\/OTHERFILE>"; \ - gcc_source_files="$$gcc_source_files$$source_filename<\/Name>"; \ - done; \ - \ - sed "s/%TARGET%/$$target_name/g" AS4Template.aps > $$target_folder/$$target_name.aps.new; \ - sed "s/%CREATED%/$$as4_date/g" $$target_folder/$$target_name.aps.new > $$target_folder/$$target_name.aps.new2; \ - sed "s/%FILE_LIST%/$$source_files/g" $$target_folder/$$target_name.aps.new2 > $$target_folder/$$target_name.aps.new3; \ - sed "s/%GCC_FILE_LIST%/$$gcc_source_files/g" $$target_folder/$$target_name.aps.new3 > $$target_folder/$$target_name.aps.new4; \ - mv $$target_folder/$$target_name.aps.new4 $$target_folder/$$target_name.aps; \ - rm $$target_folder/$$target_name.aps.new $$target_folder/$$target_name.aps.new2 $$target_folder/$$target_name.aps.new3; \ - fi; \ - done; - @echo AVR Studio 4 project generation complete. - # Make all possible bootloaders for all targets and configurations as set by the BootloaderTest build test -# and store them in a seperate directory called "Bootloaders" -make_bootloaders: +# and store them in a separate directory called "Bootloaders" +bootloaders: @echo "build_bootloaders:" > BuildMakefile @printf "\t-mkdir Bootloaders 2>/dev/null\n\n" >> BuildMakefile - + @while read line; \ do \ build_cfg=`echo $$line | grep -v "#" | sed 's/ //g'`; \ @@ -87,16 +53,19 @@ make_bootloaders: build_board=`echo $$build_cfg | cut -d':' -f3`; \ build_flashsize=`echo $$build_cfg | cut -d':' -f4`; \ build_bootsize=`echo $$build_cfg | cut -d':' -f5`; \ + build_fusb=`echo $$build_cfg | cut -d':' -f6`; \ \ - printf "Found '%s' with FLASH: %3s KB, BOOT: %3s KB, MCU: %12s / %4s, BOARD: %s\n" $$build_bootloader $$build_flashsize $$build_bootsize $$build_mcu $$build_arch $$build_board; \ + 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; \ \ - printf "\t@echo Building '%s' with FLASH: %3s KB, BOOT: %3s KB, MCU: %12s / %4s, BOARD: %s\n" $$build_bootloader $$build_flashsize $$build_bootsize $$build_mcu $$build_arch $$build_board >> BuildMakefile; \ - 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 DEBUG_LEVEL=0\n" $$build_bootloader $$build_arch $$build_mcu $$build_board $$build_flashsize $$build_bootsize >> BuildMakefile; \ - printf "\tmv $(patsubst %/,%,$(LUFA_ROOT))/Bootloaders/%s/Bootloader%s.hex Bootloaders/%s-%s-%s-BOARD_%s-BOOT_%sKB.hex\n\n" $$build_bootloader $$build_bootloader $$build_bootloader $$build_arch $$build_mcu $$build_board $$build_bootsize >> BuildMakefile; \ + printf "\t-mkdir Bootloaders/%s 2>/dev/null\n" $$build_bootloader >> BuildMakefile; \ + 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; \ + 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; \ + 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; \ fi; \ done < $(patsubst %/,%,$(LUFA_ROOT))/BuildTests/BootloaderTest/BootloaderDeviceMap.cfg $(MAKE) -f BuildMakefile build_bootloaders + cp $(patsubst %/,%,$(LUFA_ROOT))/LUFA/License.txt Bootloaders rm -f BuildMakefile # Check the working branch documentation, ensure no placeholder values @@ -122,4 +91,4 @@ validate-branch: validate-release: check-documentation-placeholders validate-branch -.PHONY: all upgrade-doxygen make-as4-projects make_bootloaders check-documentation-placeholders validate-branch \ No newline at end of file +.PHONY: all upgrade-doxygen bootloaders check-documentation-placeholders validate-branch