Skip to content

Instantly share code, notes, and snippets.

@ichramm
Created April 2, 2022 04:24
Show Gist options
  • Save ichramm/6dfa8e7d0dbbfb40657d52636b19d061 to your computer and use it in GitHub Desktop.
Save ichramm/6dfa8e7d0dbbfb40657d52636b19d061 to your computer and use it in GitHub Desktop.
makefile list objs for binary
$(shell $(MAKE) -qp -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | grep $(shell echo $(OUTPUT_FILE) | sed 's|./||') | awk '{ for ( n=1; n<=NF; n++ ) if($$n ~ "[.]o$$") print $$n }') \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment