From 1862f8f7bc0e45cf8bae0b85cbe74e3a289857c6 Mon Sep 17 00:00:00 2001 From: adin Date: Thu, 6 Jul 2017 16:31:06 -0300 Subject: [PATCH] Updated with dynamic rules --- example/Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/example/Makefile b/example/Makefile index 853ffb5..f0d92e3 100644 --- a/example/Makefile +++ b/example/Makefile @@ -1,4 +1,7 @@ -# Our languages +# Programs +MAKE = make + +# Our languages, styles, and patterns LANGS = en es pt STYLES = classic oldstyle fancy banking casual academic friggeri PATTERNS := $(foreach style, $(STYLES), $(foreach lang, $(LANGS), $(style)-$(lang))) @@ -9,11 +12,17 @@ SOURCE = $(NAME: %=%.tex) DETAILS = true # Default make to build these rules instead of files in case they exist -.PHONY: all clean veryclean $(PATTERNS) +.PHONY: all clean veryclean $(PATTERNS) $(LANGS) $(STYLES) # Rules all: $(PATTERNS) +$(LANGS): + @$(MAKE) $(foreach style, $(STYLES), $(style)-$@) + +$(STYLE): + @$(MAKE) $(foreach lang, $(LANGS), $@-$(lang)) + # we need to clean before compiling a new language $(PATTERNS): clean # compile the language -- 2.50.1