Last active
November 4, 2020 15:13
-
-
Save stenehall/7d343f548405cd4227b4adc69134b04c to your computer and use it in GitHub Desktop.
Makefile sheet cheat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#: This help command | |
help: | |
@grep -B1 -E "^[a-zA-Z0-9_-]+\:([^\=]|$$)" Makefile | grep -v -- -- | sed 'N;s/\n/###/' | sed -n 's/^#: \(.*\)###\(.*\):.*/\2###\1/p' | column -t -s '###' | |
basic: | |
echo "This is a basic command, it's also the default command" | |
basicWithoutCommand: | |
@echo "Now the command isn't echoed" | |
basicWithVariable: | |
echo "This is a ${VAR} inputed as VAR=foobar" | |
withDependency: aDependency | |
@echo "This is the command withDependency" | |
aDependency: | |
@echo "This is a dependency" | |
#: A command with some help text | |
aCommandWithHelpText: | |
@echo "This has a help text" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment