golang: avoid expanding Makefile variables
authorGeorge Sapkin <george@sapk.in>
Thu, 29 Jan 2026 00:09:06 +0000 (02:09 +0200)
committerGeorge Sapkin <george@sapk.in>
Mon, 2 Feb 2026 08:10:03 +0000 (10:10 +0200)
Replace Makefile variables in comments to avoid expanding them
unnecessarily.

Link: https://github.com/openwrt/packages/pull/28445
Signed-off-by: George Sapkin <george@sapk.in>
lang/golang/golang-compiler.mk
lang/golang/golang-package.mk

index f683c1e34e9e82c652bbd33c481e53a9bbad79c9..a85af0f7a3cc2dcb8b25956ad17a39cb6afa19d9 100644 (file)
@@ -10,14 +10,14 @@ endif
 include $(GO_INCLUDE_DIR)/golang-values.mk
 
 
-# $(1) valid GOOS_GOARCH combinations
-# $(2) go version id
+# 1: valid GOOS_GOARCH combinations
+# 2: go version id
 define GoCompiler/Default/CheckHost
        $(if $(filter $(GO_HOST_OS_ARCH),$(1)),,$(error go-$(2) cannot be installed on $(GO_HOST_OS)/$(GO_HOST_ARCH)))
 endef
 
-# $(1) source go root
-# $(2) additional environment variables (optional)
+# 1: source go root
+# 2: additional environment variables (optional)
 define GoCompiler/Default/Make
        cd "$(1)/src" ; \
        $(2) $(BASH) make.bash \
@@ -25,27 +25,27 @@ define GoCompiler/Default/Make
                --no-banner
 endef
 
-# $(1) destination prefix
-# $(2) go version id
+# 1: destination prefix
+# 2: go version id
 define GoCompiler/Default/Install/make-dirs
        $(INSTALL_DIR) "$(1)/lib/go-$(2)"
        $(INSTALL_DIR) "$(1)/share/go-$(2)"
 endef
 
-# $(1) source go root
-# $(2) destination prefix
-# $(3) go version id
-# $(4) file/directory name
+# 1: source go root
+# 2: destination prefix
+# 3: go version id
+# 4: file/directory name
 define GoCompiler/Default/Install/install-share-data
        $(CP) "$(1)/$(4)" "$(2)/share/go-$(3)/"
        $(LN) "../../share/go-$(3)/$(4)" "$(2)/lib/go-$(3)/"
 endef
 
-# $(1) source go root
-# $(2) destination prefix
-# $(3) go version id
-# $(4) GOOS_GOARCH
-# $(5) install suffix (optional)
+# 1: source go root
+# 2: destination prefix
+# 3: go version id
+# 4: GOOS_GOARCH
+# 5: install suffix (optional)
 define GoCompiler/Default/Install/Bin
        $(call GoCompiler/Default/Install/make-dirs,$(2),$(3))
 
@@ -77,26 +77,26 @@ define GoCompiler/Default/Install/Bin
        $(INSTALL_BIN) -p "$(1)/pkg/tool/$(4)"/* "$(2)/lib/go-$(3)/pkg/tool/$(4)/"
 endef
 
-# $(1) destination prefix
-# $(2) go version id
+# 1: destination prefix
+# 2: go version id
 define GoCompiler/Default/Install/BinLinks
        $(INSTALL_DIR) "$(1)/bin"
        $(LN) "../lib/go-$(2)/bin/go" "$(1)/bin/go$(2)"
        $(LN) "../lib/go-$(2)/bin/gofmt" "$(1)/bin/gofmt$(2)"
 endef
 
-# $(1) source go root
-# $(2) destination prefix
-# $(3) go version id
+# 1: source go root
+# 2: destination prefix
+# 3: go version id
 define GoCompiler/Default/Install/Doc
        $(call GoCompiler/Default/Install/make-dirs,$(2),$(3))
 
        $(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),doc)
 endef
 
-# $(1) source go root
-# $(2) destination prefix
-# $(3) go version id
+# 1: source go root
+# 2: destination prefix
+# 3: go version id
 define GoCompiler/Default/Install/Src
        $(call GoCompiler/Default/Install/make-dirs,$(2),$(3))
 
@@ -118,65 +118,65 @@ define GoCompiler/Default/Install/Src
        fi
 endef
 
-# $(1) destination prefix
-# $(2) go version id
+# 1: destination prefix
+# 2: go version id
 define GoCompiler/Default/Uninstall
        rm -rf "$(1)/lib/go-$(2)"
        rm -rf "$(1)/share/go-$(2)"
 endef
 
-# $(1) destination prefix
-# $(2) go version id
+# 1: destination prefix
+# 2: go version id
 define GoCompiler/Default/Uninstall/BinLinks
        rm -f "$(1)/bin/go$(2)"
        rm -f "$(1)/bin/gofmt$(2)"
 endef
 
 
-# $(1) profile name
-# $(2) source go root
-# $(3) destination prefix
-# $(4) go version id
-# $(5) GOOS_GOARCH
-# $(6) install suffix (optional)
+# 1: profile name
+# 2: source go root
+# 3: destination prefix
+# 4: go version id
+# 5: GOOS_GOARCH
+# 6: install suffix (optional)
 define GoCompiler/AddProfile
 
-  # $$(1) valid GOOS_GOARCH combinations
+  # 1: valid GOOS_GOARCH combinations
   define GoCompiler/$(1)/CheckHost
        $$(call GoCompiler/Default/CheckHost,$$(1),$(4))
   endef
 
-  # $$(1) additional environment variables (optional)
+  # 1: additional environment variables (optional)
   define GoCompiler/$(1)/Make
        $$(call GoCompiler/Default/Make,$(2),$$(1))
   endef
 
-  # $$(1) override install prefix (optional)
+  # 1: override install prefix (optional)
   define GoCompiler/$(1)/Install/Bin
        $$(call GoCompiler/Default/Install/Bin,$(2),$$(or $$(1),$(3)),$(4),$(5),$(6))
   endef
 
-  # $$(1) override install prefix (optional)
+  # 1: override install prefix (optional)
   define GoCompiler/$(1)/Install/BinLinks
        $$(call GoCompiler/Default/Install/BinLinks,$$(or $$(1),$(3)),$(4))
   endef
 
-  # $$(1) override install prefix (optional)
+  # 1: override install prefix (optional)
   define GoCompiler/$(1)/Install/Doc
        $$(call GoCompiler/Default/Install/Doc,$(2),$$(or $$(1),$(3)),$(4))
   endef
 
-  # $$(1) override install prefix (optional)
+  # 1: override install prefix (optional)
   define GoCompiler/$(1)/Install/Src
        $$(call GoCompiler/Default/Install/Src,$(2),$$(or $$(1),$(3)),$(4))
   endef
 
-  # $$(1) override install prefix (optional)
+  # 1: override install prefix (optional)
   define GoCompiler/$(1)/Uninstall
        $$(call GoCompiler/Default/Uninstall,$$(or $$(1),$(3)),$(4))
   endef
 
-  # $$(1) override install prefix (optional)
+  # 1: override install prefix (optional)
   define GoCompiler/$(1)/Uninstall/BinLinks
        $$(call GoCompiler/Default/Uninstall/BinLinks,$$(or $$(1),$(3)),$(4))
   endef
index 4d76d30c6ce974a189dbfa1ea68638e6a936dd22..b0cb5eb126ef28174fd4eb9297d1bc76663a713d 100644 (file)
@@ -264,7 +264,7 @@ define GoPackage/Build/Configure
        $(SHELL) $(GO_INCLUDE_DIR)golang-build.sh configure
 endef
 
-# $(1) additional arguments for go command line (optional)
+# 1: additional arguments for go command line (optional)
 define GoPackage/Build/Compile
        $(GO_GENERAL_BUILD_CONFIG_VARS) \
        $(GO_PKG_BUILD_CONFIG_VARS) \