Getting the current target name in a Makefile

Published on 2024-11-03 • Modified on 2024-11-03

This snippet shows how to get the current target name in a Makefile. It is an automatic Make variable. Check out the documentation link below for more explanations.


show-current-target:
    echo 'Making $(@)...'
    echo 'Making $@...'

# Outputs:
# echo 'Making show-current-target...'
# Making show-current-target...
# echo 'Making show-current-target'
# Making show-current-target...

 More on Stackoverflow   Read the doc  Random snippet

  Work with me!


Call to action

Did you like this post? You can help me back in several ways: (use the "reply" link on the right to comment or to contact me )

Thank you for reading! And see you soon on Strangebuzz! 😉

COil