diff options
author | Paul Smith <psmith@gnu.org> | 2016-09-25 19:06:56 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2016-12-14 17:56:24 -0500 |
commit | bc9d72beb0cb00e73afff1fa386a0ea9e2e32280 (patch) | |
tree | 87cd6a405b7fac45be92d027f3e1d650def33c4d /maintMakefile | |
parent | d3bba301cee84c6e2b150649411a0d649056a75f (diff) | |
download | make-git-bc9d72beb0cb00e73afff1fa386a0ea9e2e32280.tar.gz |
Resolve issues discovered by static code analysis.
* maintMakefile: Add a rule to submit code for analysis.
* configure.ac: Check for availability of the umask() function.
* output.c (output_tmpfd, output_tmpfile): Use umask on temp files.
* makeint.h (PATH_VAR): Reserve an extra character for nul bytes.
* function.c (func_error): Initialize buffer to empty string.
* job.c (child_execute_job): Verify validity of fdin.
* main.c (main): Simplify code for makefile updating algorithm.
* arscan.c (ar_scan): Verify member name length before reading.
* read.c (readline): Cast pointer arithmetic to avoid warnings.
* remake.c (update_file): Remove unreachable code.
(name_mtime): Verify symlink name length.
Diffstat (limited to 'maintMakefile')
-rw-r--r-- | maintMakefile | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/maintMakefile b/maintMakefile index c1d45097..c5978046 100644 --- a/maintMakefile +++ b/maintMakefile @@ -118,7 +118,6 @@ git-very-clean: git-clean -$(GIT) clean -fd - ## ---------------------- ## ## Generating ChangeLog. ## ## ---------------------- ## @@ -332,6 +331,55 @@ gendocs: update-gnuweb update-makeweb && echo '- cvs commit' \ && echo '- cvs tag make-$(subst .,-,$(VERSION))' + +## --------------------------------------------- ## +## Submitting Coverity cov-build results to Scan ## +## --------------------------------------------- ## + +# Note you must have set COVERITY_TOKEN and COVERITY_EMAIL properly +# to submit results. COVERITY_PATH can be set to the root of the +# cov-build tools if it's not already on your PATH. + +COV_BUILD_FILE := cov-build.tgz + +.PHONY: cov-build cov-submit + +cov-build: $(COV_BUILD_FILE) + +$(COV_BUILD_FILE): $(filter %.c %.h,$(DISTFILES)) + $(MAKE) distdir + @echo "Running Coverity cov-build" + rm -rf '$(distdir)'/_build + mkdir '$(distdir)'/_build + cd '$(distdir)'/_build \ + && ../configure --srcdir=.. \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \ + CFLAGS='$(AM_CFLAGS)' + PATH="$${COVERITY_PATH:+$$COVERITY_PATH/bin:}$$PATH"; \ + cd '$(distdir)'/_build \ + && cov-build --dir cov-int ./build.sh + rm -f '$@' + (cd '$(distdir)'/_build && tar czf - cov-int) > '$@' + +cov-submit: $(COV_BUILD_FILE)-submitted + +$(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE) + @[ -n "$(COVERITY_TOKEN)" ] || { echo 'COVERITY_TOKEN not set'; exit 1; } + @[ -n "$(COVERITY_EMAIL)" ] || { echo 'COVERITY_EMAIL not set'; exit 1; } + rm -f '$@' + case '$(VERSION)' in \ + (*.*.9*) type="daily build"; ext=".$$(date +%Y%m%d)" ;; \ + (*) type="release"; ext= ;; \ + esac; \ + curl --form token='$(COVERITY_TOKEN)' \ + --form email='$(COVERITY_EMAIL)' \ + --form file='@$<' \ + --form version="$(VERSION)$$ext" \ + --form description="GNU make $$type" \ + 'https://scan.coverity.com/builds?project=gmake' + cp '$<' '$@' + + ## ------------------------- ## ## Make release targets. ## ## ------------------------- ## @@ -344,6 +392,7 @@ tag-release: esac; \ $(GIT) tag -m "GNU Make release$$message $(VERSION)" -u '$(GPG_FINGERPRINT)' '$(VERSION)' + ## ------------------------- ## ## GNU FTP upload artifacts. ## ## ------------------------- ## |