Skip to content

Instantly share code, notes, and snippets.

@kulp
Created May 28, 2009 19:09
Show Gist options
  • Save kulp/119508 to your computer and use it in GitHub Desktop.
Save kulp/119508 to your computer and use it in GitHub Desktop.
Finds undefined symbols in OBJECTS that are not defined in SUPPORT_OBJECTS.
undefsym = (nm -pAP $(2); nm -puAP $(1)) | cut -d' ' -f1-2 | sort -k2 | uniq -u -f1 | grep '^$(1)' | cut -d: -f2 | cut -b2-
OBJECTS = work.o
SUPPORT_OBJECTS = support.o
.PHONY: need
need: ; @$(call undefsym,$(OBJECTS),$(SUPPORT_OBJECTS))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment