# HG changeset patch # User ib # Date 1338412906 0 # Node ID 4df5cb727be4f8762bde458ef00e76f50b2875ec # Parent 8e539c65122723196f270acfe55501fe285b99c3 Add a Makefile target for testing the help message text headers. This allows a syntax check without having to compile for each language, but doesn't check the correctness of the used format specifiers though. diff -r 8e539c651227 -r 4df5cb727be4 Makefile --- a/Makefile Wed May 30 21:08:05 2012 +0000 +++ b/Makefile Wed May 30 21:21:46 2012 +0000 @@ -811,6 +811,9 @@ @echo "####### Please run ./configure again - it's changed! #######" @echo "############################################################" +checkhelp: help/help_mp*.h + help/help_check.sh $(CC) $^ + help_mp.h: help/help_mp-en.h $(HELP_FILE) help/help_create.sh $(HELP_FILE) $(CHARSET) @@ -1171,7 +1174,7 @@ -include $(DEP_FILES) $(DRIVER_DEP_FILES) $(TESTS_DEP_FILES) $(TOOLS_DEP_FILES) $(DHAHELPER_DEP_FILES) .PHONY: all doxygen *install* *tools drivers dhahelper* -.PHONY: checkheaders *clean tests check_checksums fatetest +.PHONY: checkheaders *clean tests check_checksums fatetest checkhelp .PHONY: doc html-chunked* html-single* xmllint* # Disable suffix rules. Most of the builtin rules are suffix rules, diff -r 8e539c651227 -r 4df5cb727be4 help/help_check.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/help/help_check.sh Wed May 30 21:21:46 2012 +0000 @@ -0,0 +1,22 @@ +#!/bin/sh +# Check help message header files. + +CHECK=checkhelp + +trap "rm -f ${CHECK}.c ${CHECK}.o" EXIT + +CC=$1 +shift + +for h in "$@"; do + cat < ${CHECK}.c +#include +#include +#include "config.h" +#include "$h" +void $CHECK () { +EOF + sed -n "s:^[ \t]*#define[ \t]\+\([0-9A-Za-z_]\+\)[ \t].*:strdup(\1);:p" "$h" >> ${CHECK}.c + echo "}" >> ${CHECK}.c + $CC -Werror -c -o ${CHECK}.o ${CHECK}.c || exit +done