forked from ocaml/v2.ocaml.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.from_md
30 lines (24 loc) · 867 Bytes
/
Makefile.from_md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- mode: Makefile -*-
include Makefile.common
USE_OPAM_UPDATE_LIST = \
ocaml.org/index.html \
ocaml.org/index.fr.html \
ocaml.org/platform/index.html
$(USE_OPAM_UPDATE_LIST): opam_update_list
ocaml.org/%.html: site/%.md
@echo "HTML for $*"
@mkdir -p "$(shell dirname $@)"
@if grep -q '*Table of contents*' "$<" ; then $(MAKE) -f Makefile.from_md "[email protected]" ; fi
@$(MAKE) -f Makefile.from_md "[email protected]"
@if [ -f "[email protected]" ] ; then \
${MPP} -set "filename=$<" -set "[email protected]" -set "[email protected]" template/main.mpp -o "$@" ; \
else \
${MPP} -set "filename=$<" -set "[email protected]" template/main.mpp -o "$@" ; \
fi
@$(RM) "[email protected]" "[email protected]"
ocaml.org/%.html.toc:site/%.md
@echo "TOC for $*"
@${OMD} -otoc -ts 0 "$<" -o "$@"
ocaml.org/%.html.tmp:site/%.md
@echo "Preprocess $*"
@sed -e 's|\*Table of contents\*||g' "$<" | $(OMD_PP) | ${OMD} -o "$@"