Created
June 9, 2020 09:28
-
-
Save abel0b/b91043ea7bab105353d9687ac86c111b to your computer and use it in GitHub Desktop.
Makefile snippets
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
# Check if a library exists | |
define lib_exists | |
echo "int main(){}" | g++ -x c++ -Wl,--no-as-needed -l$(1) - | |
endef | |
# Update a git submodule | |
define update_external | |
if git submodule status external/$(1) | egrep -q '^[-]|^[+]'; then\ | |
git submodule update --init external/$(1);\ | |
fi | |
endef |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment