Skip to content

Instantly share code, notes, and snippets.

@graphicsminded
Created November 19, 2016 11: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 graphicsminded/c611bf374dc9fb0ee8f6bcfd959d8929 to your computer and use it in GitHub Desktop.
Save graphicsminded/c611bf374dc9fb0ee8f6bcfd959d8929 to your computer and use it in GitHub Desktop.
New Project Makefile
# Makefile for Scott Nunemacher
# Makefile format:
# target: dependencies
# actions
# By default, make these targets
all: newest.txt not-newest.txt variable-content.txt
# Clean out all of our previously made text files
clean:
@rm -rf *.txt
# Write out the content of newest.txt
# ('$@' is a macro for the target filename)
newest.txt:
@echo "This is the newest text file called $@." > $@
# Write the contents of the dependency to the target file
# ('$<' is a macro for the first dependecy's filename
not-newest.txt: newest.txt
@cat $< > $@
VARCONTENT = "Some content stored in a variable"
variable-content.txt:
@echo "$(VARCONTENT)" > $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment