Skip to content

Instantly share code, notes, and snippets.

@thequux
Created September 15, 2015 18:32
Show Gist options
  • Save thequux/03416e4d3d9af963209b to your computer and use it in GitHub Desktop.
Save thequux/03416e4d3d9af963209b to your computer and use it in GitHub Desktop.
# -*- Makefile -*- vim: ft=Makefile
# This expects to be built with make -f
H Ha Hb Hc:
echo halted
define Nr
$(foreach post,a b c,$(eval $(call Nr0,$(1),$(2),$(post))))
endef
define Nr0
H$(1)$(post)%:
make -f $(MF) H$$*$(2)
H$(1)$(post):
make -f $(MF) H$(2)
endef
# a --> bc
# b --> a
# c --> aaa
$(call Nr,a,bc)
$(call Nr,b,a)
$(call Nr,c,aaa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment