diff --git a/configure/CONFIG_BASE b/configure/CONFIG_BASE index 365042775..1b1b9f14f 100644 --- a/configure/CONFIG_BASE +++ b/configure/CONFIG_BASE @@ -67,7 +67,7 @@ REGISTERRECORDDEVICEDRIVER = $(PERL) $(TOOLS)/registerRecordDeviceDriver.pl CONVERTRELEASE = $(PERL) $(call FIND_TOOL,convertRelease.pl) FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl -GENVERSIONHEADER = $(PERL) $(TOOLS)/genVersionHeader.pl $(QUIET_FLAG) +GENVERSIONHEADER = $(PERL) $(TOOLS)/genVersionHeader.pl $(QUIET_FLAG) $(QUESTION_FLAG) #--------------------------------------------------------------- # tools for installing libraries and products diff --git a/configure/CONFIG_COMMON b/configure/CONFIG_COMMON index 79807c2f2..18e5a2cec 100644 --- a/configure/CONFIG_COMMON +++ b/configure/CONFIG_COMMON @@ -80,6 +80,7 @@ IOCS_APPL_TOP = $(shell $(FULLPATHNAME) $(INSTALL_LOCATION)) NOP = : ECHO = @$(if $(findstring s,$(patsubst T_A=%,,$(MAKEFLAGS))),$(NOP),echo) QUIET_FLAG := $(if $(findstring s,$(MAKEFLAGS)),-q,) +QUESTION_FLAG := $(if $(findstring q,$(MAKEFLAGS)),-i,) #------------------------------------------------------- ifdef T_A diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 14e7a32ea..49e6f78ce 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -185,7 +185,7 @@ endif # RELEASE file consistency checking checkRelease: - $(CONVERTRELEASE) checkRelease + +$(CONVERTRELEASE) checkRelease warnRelease: -$(CONVERTRELEASE) checkRelease noCheckRelease: diff --git a/src/tools/genVersionHeader.pl b/src/tools/genVersionHeader.pl index c61f14c98..92dbd81b2 100644 --- a/src/tools/genVersionHeader.pl +++ b/src/tools/genVersionHeader.pl @@ -23,18 +23,20 @@ my $tfmt = '%Y-%m-%dT%H:%M'; $tfmt .= '%z' unless $^O eq 'MSWin32'; # %z returns zone name on Windows my $now = strftime($tfmt, localtime); -our ($opt_h, $opt_v, $opt_q); +our ($opt_d, $opt_h, $opt_i, $opt_v, $opt_q); our $opt_t = '.'; our $opt_N = 'VCSVERSION'; our $opt_V = $now; my $vcs; -getopts('hvqt:N:V:') && @ARGV == 1 +getopts('dhivqt:N:V:') && @ARGV == 1 or HELP_MESSAGE(); my ($outfile) = @ARGV; +if ($opt_d) { exit 0 } # exit if make is run in dry-run mode + if (!$vcs && -d "$opt_t/_darcs") { # Darcs print "== Found /_darcs directory\n" if $opt_v; # v1-4-dirty @@ -148,6 +150,8 @@ if (open($DST, '+<', $outfile)) { or die "Can't create $outfile: $!\n"; } +if ($opt_i) { exit 1 }; # exit if make is run in "question" mode + seek $DST, 0, 0; truncate $DST, 0; print $DST $output; @@ -158,9 +162,11 @@ sub HELP_MESSAGE { Usage: genVersionHeader.pl -h Display this Usage message - genVersionHeader.pl [-v] [-q] [-t top] [-N NAME] [-V version] output.h"; + genVersionHeader.pl [-v] [-d] [-q] [-t top] [-N NAME] [-V version] output.h"; Generate or update the header file output.h -v - Verbose (debugging messages) + -d - Dry-run + -i - Question mode -q - Quiet -t top - Path to the module's top (default '$opt_t') -N NAME - Macro name to be defined (default '$opt_N')