Merge branch 'fix-make-question-mode' into 3.16

This commit is contained in:
Andrew Johnson
2018-10-25 14:38:44 -05:00
4 changed files with 31 additions and 9 deletions
+1 -1
View File
@@ -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
+1
View File
@@ -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
+1 -1
View File
@@ -186,7 +186,7 @@ endif
# RELEASE file consistency checking
checkRelease:
$(CONVERTRELEASE) checkRelease
+$(CONVERTRELEASE) checkRelease
warnRelease:
-$(CONVERTRELEASE) checkRelease
noCheckRelease:
+28 -7
View File
@@ -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 <top>/_darcs directory\n" if $opt_v;
# v1-4-dirty
@@ -135,19 +137,36 @@ if (open($DST, '+<', $outfile)) {
print "== Current:\n$actual==\n" if $opt_v;
if ($actual eq $output) {
print "Keeping VCS header $outfile\n $opt_N = \"$opt_V\"\n"
close $DST;
print "Keeping VCS header $outfile\n",
" $opt_N = \"$opt_V\"\n"
unless $opt_q;
exit 0;
}
print "Updating VCS header $outfile\n $opt_N = \"$opt_V\"\n"
unless $opt_q;
# This regexp must match the #define in $output above:
$actual =~ m/#define (\w+) ("[^"]*")\n/;
if ($opt_i) {
print "Outdated VCS header $outfile\n",
" has: $1 = $2\n",
" needs: $opt_N = \"$opt_V\"\n";
}
else {
print "Updating VCS header $outfile\n",
" from: $1 = $2\n",
" to: $opt_N = \"$opt_V\"\n"
unless $opt_q;
}
} else {
print "Creating VCS header $outfile\n $opt_N = \"$opt_V\"\n"
print "Creating VCS header $outfile\n",
" $opt_N = \"$opt_V\"\n"
unless $opt_q;
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 +177,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')