File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515# ##################### Generate LICENSES files ######################
1616
17+ # _top is the directory containing the top-level Makefile
18+ _top = $(abspath $(dir $(firstword $(MAKEFILE_LIST ) ) ) )
19+
1720# Create a go.work file so that go-licenses can discover the LICENSE file of the
1821# other modules in the repo.
1922#
@@ -30,11 +33,11 @@ generate-go-licenses: #
3033shared_generate_targets += generate-go-licenses
3134
3235define licenses_target
33- $1/LICENSES: $1/go.mod $(licenses_go_work ) $(dir $( lastword $( MAKEFILE_LIST ) ) ) /licenses.tmpl | $(NEEDS_GO-LICENSES )
36+ $1/LICENSES: $1/go.mod $(licenses_go_work ) $(_top ) /make/_shared/licenses /licenses.tmpl | $(NEEDS_GO-LICENSES )
3437 cd $$(dir $$@ ) && \
3538 GOWORK=$(abspath $(licenses_go_work ) ) \
3639 GOOS=linux GOARCH=amd64 \
37- $(GO-LICENSES ) report --ignore "$$(license_ignore ) " --template $(dir $( lastword $( MAKEFILE_LIST ) ) ) /licenses.tmpl ./... > LICENSES
40+ $(GO-LICENSES ) report --ignore "$$(license_ignore ) " --template $(_top ) /make/_shared/licenses /licenses.tmpl ./... > LICENSES
3841
3942generate-go-licenses: $1/LICENSES
4043# The /LICENSE targets make sure these files exist.
You can’t perform that action at this time.
0 commit comments