Fed up w/ my ad-hoc scripts to display the targets and variables in a makefile(s), I’ve decided 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
You are viewing a single thread.
View all comments View context
0 points

(Because this is the Internet, add a /s to the end of the previous message for full comprehension.)

permalink
report
parent
reply
1 point

What’s /s supposed to do in this context? 🤔 It looks like a Windoze/.NET command line option.

permalink
report
parent
reply

makefile

!makefile@lemmy.ml

Create post

📢   All about Makefiles, Gnu Make, BSD Make & POSIX Make:

  • Questions
  • Tips & tricks
  • Success stories
  • Failures
  • Use-cases / Showing off
  • Ideas / Design discussions

😎   Don’t repeat yourself - Make Make make things happen for you!

📖   Gnu Make manual is your friend.

🗨   Join the chatter in #.mk:matrix.org.


⚠   Knowing/Mastering Make is nothing special. Please bear that in mind & keep the conversations respectful & civil.

⛔   Hate speech, bigotry and NSFW content will not be tolerated.


Community stats

  • 1

    Monthly active users

  • 7

    Posts

  • 3

    Comments

Community moderators