Skip to content

Instantly share code, notes, and snippets.

@infotroph
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infotroph/2f53db2f610730abe27a to your computer and use it in GitHub Desktop.
Save infotroph/2f53db2f610730abe27a to your computer and use it in GitHub Desktop.
# Have a set of Make rules that produce some outputs I usually want to keep,
# and some cruft I only want when debugging.
# Want cruft removed at the end of every successful build,
# and outputs AND cruft removed on $(make clean).
# This version appears to do all these things, but I welcome more feedback if something looks wrong.
OUTPUTS = \
# bunch of compiled end products here
JUNK = \
*.hi
*.o
*.aux
*.out
all: $(OUTPUTS) clean-intermediates
# non-phony rules not shown; all appear to work as intended
.PHONY: all clean-intermediates clean
clean-intermediates:
rm -f $(JUNK)
clean: clean-intermediates
rm -f $(OUTPUTS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment