Last active
February 28, 2018 06:23
-
-
Save defanator/d82ac3a39917bb3aca685ab50172a230 to your computer and use it in GitHub Desktop.
Makefile with implicit pattern rules - dependencies ordering example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OPTS = a b c | |
default: | |
@echo "try: make {all|base|opts}" | |
all: pattern-dep-all base opts | |
base: pattern-dep-base | |
@echo "base" | |
@touch $@ | |
opts: $(addprefix opt-, $(OPTS)) | |
opt-%: pattern-dep-% | |
@echo "opt-$*" | |
@touch $@ | |
pattern-dep-%: | |
@echo "pattern-dep-$*" | |
@touch $@ | |
clean: | |
@rm -f base opt-* pattern-dep-* | |
.PHONY: default all opts clean | |
.SECONDARY: $(addprefix pattern-dep-, $(OPTS)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment