From 1989caf71c1d453c26f150a412af75795b35a980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 4 Jan 2016 12:57:32 +0100 Subject: [PATCH] Use a full config.h with doxygen Otherwise we get warnings that some documentation items don't have corresponding #define, and more importantly the corresponding snippets are not included in the output. For that we need a modified version of the "full" argument for config.pl. Also, the new CMakeLists.txt target only works on Unix (which was already the case of the Makefile target). Hopefully this is not an issue as people are unlikely to need that target on Windows. --- CMakeLists.txt | 17 ++++++++++++++--- Makefile | 3 +++ scripts/config.pl | 16 +++++++++++----- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 094d9069b..890521853 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,9 +85,20 @@ if(ENABLE_PROGRAMS) add_subdirectory(programs) endif() -ADD_CUSTOM_TARGET(apidoc - COMMAND doxygen doxygen/mbedtls.doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +# targets for doxygen only work on Unix +if(UNIX) + ADD_CUSTOM_TARGET(apidoc + COMMAND mkdir -p apidoc + COMMAND cp include/mbedtls/config.h include/mbedtls/config.h.bak + COMMAND scripts/config.pl realfull + COMMAND doxygen doxygen/mbedtls.doxyfile + COMMAND mv include/mbedtls/config.h.bak include/mbedtls/config.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + + ADD_CUSTOM_TARGET(apidoc_clean + COMMAND rm -rf apidoc + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +endif(UNIX) if(ENABLE_TESTING) enable_testing() diff --git a/Makefile b/Makefile index 7f03115b0..0950e6b17 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,10 @@ lcov: apidoc: mkdir -p apidoc + cp include/mbedtls/config.h include/mbedtls/config.h.bak + scripts/config.pl realfull doxygen doxygen/mbedtls.doxyfile + mv include/mbedtls/config.h.bak include/mbedtls/config.h apidoc_clean: rm -rf apidoc diff --git a/scripts/config.pl b/scripts/config.pl index f673c2aaf..d4c32fd1b 100755 --- a/scripts/config.pl +++ b/scripts/config.pl @@ -10,7 +10,7 @@ $0 [-f ] unset $0 [-f ] set [] EOU # for our eyes only: -# $0 [-f ] full +# $0 [-f ] full|realfull # Things that shouldn't be enabled with "full". # Notes: @@ -61,7 +61,7 @@ die $usage unless @ARGV; my $action = shift; my ($name, $value); -if ($action eq "full") { +if ($action eq "full" || $action eq "realfull") { # nothing to do } elsif ($action eq "unset") { die $usage unless @ARGV; @@ -79,14 +79,20 @@ open my $config_read, '<', $config_file or die "read $config_file: $!\n"; my @config_lines = <$config_read>; close $config_read; -my $exclude_re = join '|', @excluded; -my $no_exclude_re = join '|', @non_excluded; +my ($exclude_re, $no_exclude_re); +if ($action eq "realfull") { + $exclude_re = qr/^$/; + $no_exclude_re = qr/./; +} else { + $exclude_re = join '|', @excluded; + $no_exclude_re = join '|', @non_excluded; +} open my $config_write, '>', $config_file or die "write $config_file: $!\n"; my $done; for my $line (@config_lines) { - if ($action eq "full") { + if ($action eq "full" || $action eq "realfull") { if ($line =~ /name SECTION: Module configuration options/) { $done = 1; }