diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-06-22 10:50:32 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-06-22 10:54:48 +0300 |
commit | ba15456881dd761c3966960b5583877f14b3edcc (patch) | |
tree | 5faaea8ddf7afa68875e8e830c194a9001095b24 | |
parent | cdc0d483938a646676a91935f7c7108898202814 (diff) |
Makefile: Use proper target for NOTICE generation
We currently use a phony target "notice-tmp" to generate the NOTICE
file. But as we're generating a real file, it doesn't make much sense to
use a phony target as opposed to a real target which is the actualy
generated NOTICE file.
Fix this by adding two normal targets to generate both the NOTICE file
in the source and build directories and have "notice" and
"notice-up-to-date" depend on these.
-rw-r--r-- | Makefile | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -227,19 +227,11 @@ lint-warnings: staticcheck-deprecations # Runs verification analysis that is okay to fail (but not ignore completely) .PHONY: notice-up-to-date -notice-up-to-date: notice-tmp - # notice-up-to-date +notice-up-to-date: ${BUILD_DIR}/NOTICE @(cmp ${BUILD_DIR}/NOTICE ${SOURCE_DIR}/NOTICE) || (echo >&2 "NOTICE requires update: 'make notice'" && false) .PHONY: notice -notice: notice-tmp - mv ${BUILD_DIR}/NOTICE ${SOURCE_DIR}/NOTICE - -.PHONY: notice-tmp -notice-tmp: ${GO_LICENSES} clean-ruby-vendor-go - rm -rf ${BUILD_DIR}/licenses - ${GO_LICENSES} save ./... --save_path=${BUILD_DIR}/licenses - go run ${SOURCE_DIR}/_support/noticegen/noticegen.go -source ${BUILD_DIR}/licenses -template ${SOURCE_DIR}/_support/noticegen/notice.template > ${BUILD_DIR}/NOTICE +notice: ${SOURCE_DIR}/NOTICE .PHONY: clean clean: @@ -326,6 +318,14 @@ ${SOURCE_DIR}/.ruby-bundle: ${GITALY_RUBY_DIR}/Gemfile.lock ${GITALY_RUBY_DIR}/G cd ${GITALY_RUBY_DIR} && bundle install ${BUNDLE_FLAGS} touch $@ +${SOURCE_DIR}/NOTICE: ${BUILD_DIR}/NOTICE + @mv $< $@ + +${BUILD_DIR}/NOTICE: ${GO_LICENSES} clean-ruby-vendor-go + @rm -rf ${BUILD_DIR}/licenses + @${GO_LICENSES} save ./... --save_path=${BUILD_DIR}/licenses + @go run ${SOURCE_DIR}/_support/noticegen/noticegen.go -source ${BUILD_DIR}/licenses -template ${SOURCE_DIR}/_support/noticegen/notice.template > ${BUILD_DIR}/NOTICE + ${BUILD_DIR}: mkdir -p ${BUILD_DIR} |