forked from marian-nmt/marian-nmt.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (49 loc) · 1.53 KB
/
Makefile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
SHELL := /bin/bash
MARIAN = marian-dev/build
COMMANDS = marian marian-decoder marian-server marian-scorer marian-vocab marian-conv
CMDFILES = $(patsubst %,docs/cmd/%.md,$(COMMANDS))
.PHONY: build install update-gems update-cmds update-datafile run
# Update Marian outputs and build
all: update-cmds update-datafile run
# Jekyll
run: build
bundle exec jekyll serve --skip-initial-build
build: install
bundle exec jekyll build
install: Gemfile
bundle install
update-gems: Gemfile
bundle update
## Update pages with command-line options
update-cmds: $(CMDFILES)
## Update verion datafile
update-datafile: _data/marian.yml
## Generate datafile from extracted version/sha
_data/marian.yml: $(MARIAN)/marian.version $(MARIAN)/marian.sha
_scripts/datafile.sh $^ $@
## Extract version
$(MARIAN)/%.version: | $(MARIAN)
@echo "Ouput Version"
$(MARIAN)/$* --version > $@ 2>&1
## Extract helptext
$(MARIAN)/%.help: | $(MARIAN)
@echo "Ouput Help"
$(MARIAN)/$* --help > $@ 2>&1
## Extract submodule commmit ref (sha)
$(MARIAN)/marian.sha:
rev=$$(cd $(MARIAN) && echo "$$(git rev-parse HEAD)");\
echo $$rev > $@
## Build CLI markdown file
docs/cmd/%.md: docs/cmd/_template.tmp $(MARIAN)/%.version $(MARIAN)/%.help
python _scripts/generate_cli_md.py $* $(MARIAN)/$*.version $(MARIAN)/$*.help \
| python _scripts/wrap_help.py > $@
## Compile Marian
$(MARIAN):
git submodule update --init --recursive;\
mkdir -p marian-dev/build \
&& cd marian-dev/build \
&& cmake .. -DCOMPILE_SERVER=ON \
&& make -j8
# Clean
clean:
bundle exec jekyll clean