Created
February 20, 2023 11:24
-
-
Save AuruTus/28fcbfabb8ee4c700bf91de1fdf2a7f9 to your computer and use it in GitHub Desktop.
Makefile useful hints and snippets
This file contains hidden or 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
| # TO MATCH FILES RECURSIVELY | |
| ## recursive wildcard | |
| ## use it like `SRC := ${call rwildcard, ., *.c *.o *.s}` | |
| rwildcard := ${foreach d,${wildcard ${1:=/*}},${call rwildcard,$d,$2} ${filter ${subst *,%,$2},$d}} | |
| ## use find cmd | |
| ## NOTE: I prefer this one | |
| SRC := ${shell find . -type f -name *.c -or -name *.o} | |
| # How to prevent make echoing commands to the console | |
| ## just add `@` before this command | |
| build: | |
| @go build -o main main.go |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment