[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do you comment your makefiles?
From: |
Bahman Movaqar |
Subject: |
Re: How do you comment your makefiles? |
Date: |
Tue, 24 Oct 2023 02:46:39 -0700 |
User-agent: |
Evolution 3.50.0 |
I found GNU makefile conventions[1]. Even though there are no sections
on comments, the few code snippets available seem to use pattern B.
[1]
https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
--
Bahman
Join the chatter on Matrix:
π£οΈ https://matrix.to/#/#.mk:matrix.org
Subscribe to the Lemmy community:
π https://lemmy.ml/c/makefile
On Sun, 2023-10-22 at 09:43 -0700, Bahman Movaqar wrote:
> Hey all,
>
> Fed up w/ my ad-hoc scripts to display the targets and variables in a
> makefile(s), I've decided [1] to write a reusable piece of code to do
> that: https://github.com/bahmanm/bmakelib/issues/81
>
> The first step toward that would be to understand the common commenting
> styles.Β So far I have identified 4 patterns in the wild which you can
> find below.
>
> Are there any style guides/conventions around this topic?Β Any
> references
> to well-written makefiles I can get inspiration from?
>
>
> ββββββββββββββββββββΒ AΒ βββββββββββββββββββββββββ
>
> VAR1 = fooΒ Β ## short one-liner comment
> my-target: ## short one-liner comment
> β¦
>
>
> ββββββββββββββββββββΒ BΒ βββββββββββββββββββββββββ
>
> # longer comment which
> # may span
> # several lines
> VAR1 = foo
>
> ## comments can be prefixed w/ more than #
> ## lorem ipsum dolor
> my-target:
> β¦
>
>
> ββββββββββββββββββββΒ CΒ βββββββββββββββββββββββββ
>
> #####
> # a comment block which is marked w/ several #s on
> # an otherwise blank line
> #####
> VAR1 = foo
>
>
> ββββββββββββββββββββΒ DΒ βββββββββββββββββββββββββ
>
> #####
> #>Β Β Β # heading 1
> #Β Β Β Β This is a variation to have markdown comments
> #Β Β Β Β inside makefile comments.
> #
> #Β Β Β Β ## It's a made-up style!Β
> #Β Β Β Β I came up w/ this style and used it to document `bmakelib`.
> #Β Β Β Β For example: https://is.gd/QtiqyAΒ (opens github)
> #<
> #####
> VAR1 = foo
>
>