DEV Community

loading...

Discussion on: Streamline your projects using Makefile

Collapse
mjgs profile image
Info Comment hidden by post author - thread only visible in this permalink
Mark Smith

I like the general idea of where this tutorial was going but there were some parts that either were not well described (@ symbol) or inconsistencies (env variables) that broke the flow, making it difficult to understand.

Collapse
yankee profile image
Yankee Maharjan Author • Edited

Hey Mark, thank you for the comment, I have written about `@ symbol on the Notes section here.

For environment variables, from where did you find it confusing? Is it the sub topic Variables itself or Include other Makefiles?

Let me know, I will update accordingly to make it more understandable. 🙂

Collapse
mjgs profile image
Mark Smith

@ symbol is for disabling the echo for recipe.

I have no idea what that means. It feels weird adding symbols to bash commands like that, where is the symbol interpreted?

In our shell we can export an environment variable called greeting.

But then the name of the variable is not ‘greeting’:

$ export INFO="Run make help to show

These sorts of small inconsistencies really break the flow of the entire piece.

Thread Thread
yankee profile image
Yankee Maharjan Author

Made the tweaks. On regards for the @ symbol, that's the standard syntax for Makefile and just how it works to disable printing the recipe to your stdout. As the note section suggests, you can try to build a rule where there is no @ symbol in the recipe to see what it means.

If you find the @ symbol weird in front of the bash commands. you can run the commands with -s flag

$ make -s <target-name>
Enter fullscreen mode Exit fullscreen mode

to disable printing the recipe to your stdout.

Hope it helps. Cheers!

Thread Thread
mjgs profile image
Mark Smith

It’s not clear to me what this means:

printing the recipe to your stdout

Are you saying that adding the @ causes make to suppress command output to stdout? Or is it that make doesn’t print the step name to stdout? Or something else?

It might be more obvious with some example make output.

Thread Thread
yankee profile image
Yankee Maharjan Author

Doing is knowing, so just try it out first!

Thread Thread
mjgs profile image
Mark Smith

Honestly I didn’t make it to the end of the article, I stopped after the second round of confusion.

Some comments have been hidden by the post's author - find out more