Skip to content

Commit 48e01e4

Browse files
committed
fix location of licenses template
Signed-off-by: Ashley Davis <ashley.davis@cyberark.com>
1 parent 7085ba6 commit 48e01e4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

modules/licenses/01_mod.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
###################### Generate LICENSES files ######################
1616

17+
# _module_dir is the directory containing this Makefile, used to retrieve the path of the licenses.tmpl file
18+
_module_dir := $(abspath $(dir $(lastword $(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: #
3033
shared_generate_targets += generate-go-licenses
3134

3235
define 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) $(_module_dir)/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 $(_module_dir)/licenses.tmpl ./... > LICENSES
3841

3942
generate-go-licenses: $1/LICENSES
4043
# The /LICENSE targets make sure these files exist.

0 commit comments

Comments
 (0)