diff --git a/Makefile b/Makefile index 791e8f0..6e5b53b 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,18 @@ DOCKER_ENV=changkun/modern-cpp-tutorial:build-env +TARGET = pdf epub LANGS = zh-cn en-us -ALL_BUILDS = website pdf epub +ALL_BUILDS = website $(TARGET) # dep all: $(ALL_BUILDS) -pdf: $(LANGS) -$(LANGS): - cd pdf/$@ && make && make clean - mkdir -p website/public/modern-cpp/pdf - mv pdf/$@/modern-cpp-tutorial.pdf website/public/modern-cpp/pdf/modern-cpp-tutorial-$@.pdf - -epub: $(LANGS) -$(LANGS): - cd epub/$@ && make && make clean - mkdir -p website/public/modern-cpp/epub - mv epub/$@/modern-cpp-tutorial.epub website/public/modern-cpp/epub/modern-cpp-tutorial-$@.epub +$(TARGET): $(LANGS) + mkdir -p website/public/modern-cpp/$@/ + for lang in $^ ; do \ + cd $@/$${lang} && make && make clean && cd ../..; \ + mv $@/$${lang}/modern-cpp-tutorial.$@ website/public/modern-cpp/$@/modern-cpp-tutorial-$${lang}.$@; \ + done website: cd website && make