Skip to content

Instantly share code, notes, and snippets.

@dperuo
Last active August 7, 2018 13:40
Show Gist options
  • Save dperuo/3a3c542392dcbba1d439 to your computer and use it in GitHub Desktop.
Save dperuo/3a3c542392dcbba1d439 to your computer and use it in GitHub Desktop.
INPUT := myfile
OUTPUT := myfile2
.PHONY: all
all: $(OUTPUT)
$(OUTPUT): $(INPUT)
cp $^ $@
$(INPUT):
touch $@
.PHONY: test
test:
@if [[ ! -a $(OUTPUT) ]]; \
then echo "$(MAKE) will make $(OUTPUT)"; \
else echo "$(OUTPUT) exits!"; \
fi
.PHONY: clean
clean:
$(RM) $(INPUT)
$(RM) $(OUTPUT)
.INTERMEDIATE: $(INPUT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment