Skip to content

Commit 934eb89

Browse files
committed
build: fixing pdf and epub build
Fixes changkun#77
1 parent 6914acc commit 934eb89

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

Makefile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
DOCKER_ENV=changkun/modern-cpp-tutorial:build-env
2+
TARGET = pdf epub
23
LANGS = zh-cn en-us
3-
ALL_BUILDS = website pdf epub
4+
ALL_BUILDS = website $(TARGET)
45

56
# dep
67

78
all: $(ALL_BUILDS)
89

9-
pdf: $(LANGS)
10-
$(LANGS):
11-
cd pdf/$@ && make && make clean
12-
mkdir -p website/public/modern-cpp/pdf
13-
mv pdf/$@/modern-cpp-tutorial.pdf website/public/modern-cpp/pdf/modern-cpp-tutorial-$@.pdf
14-
15-
epub: $(LANGS)
16-
$(LANGS):
17-
cd epub/$@ && make && make clean
18-
mkdir -p website/public/modern-cpp/epub
19-
mv epub/$@/modern-cpp-tutorial.epub website/public/modern-cpp/epub/modern-cpp-tutorial-$@.epub
10+
$(TARGET): $(LANGS)
11+
mkdir -p website/public/modern-cpp/$@/
12+
for lang in $^ ; do \
13+
cd $@/$${lang} && make && make clean && cd ../..; \
14+
mv $@/$${lang}/modern-cpp-tutorial.$@ website/public/modern-cpp/$@/modern-cpp-tutorial-$${lang}.$@; \
15+
done
2016

2117
website:
2218
cd website && make

0 commit comments

Comments
 (0)