generated from rodluger/showyourwork-template
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
35 lines (27 loc) · 910 Bytes
/
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
# Snakemake options. Override by calling, e.g., `make ms.pdf OPTIONS="..."`
OPTIONS ?= -c1
# Settings
export OPTIONS
.PHONY: Makefile
SHOWYOURWORK := $(shell test -f showyourwork/LICENSE && echo 1 || echo 0)
GAMMAPY := $(shell test -f gammapy/LICENSE.rst && echo 1 || echo 0)
# Default target: generate the article
ms.pdf: showyourwork_setup
@$(MAKE) -C showyourwork ms.pdf
# Ensure we've cloned the showyourwork submodule
showyourwork_setup:
@if [ "$(SHOWYOURWORK)" = "0" ]; then \
echo "Setting up the showyourwork submodule...";\
git submodule init;\
git submodule update;\
fi
# Ensure we've cloned the gammapy submodule
gammapy_setup:
@if [ "$(GAMMAPY)" = "0" ]; then \
echo "Setting up the gammapy submodule...";\
git submodule init;\
git submodule update;\
fi
# Route all targets to showyourwork/Makefile
%: Makefile showyourwork_setup gammapy_setup
@$(MAKE) -C showyourwork $@