This repository has been archived by the owner on Sep 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
47 lines (39 loc) · 1.48 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
###########################################################
# Thesis Generator for Creative Informatics
# Author: Yuki Furuta <[email protected]>
# Date: 2015/11/12
###########################################################
TARGET := main
OS := $(shell uname -s)
VERSION := $(shell lsb_release -rs 2> /dev/null)
LATEXMK := $(shell command -v latexmk 2> /dev/null)
LATEXMK_OPTION := -time -recorder -rules
LATEXMK_EXEC := latexmk $(LATEXMK_OPTION)
.PHONY: all install preview clean wipe
all: install
$(LATEXMK_EXEC) $(TARGET)
preview: install
$(LATEXMK_EXEC) -pv $(TARGET)
clean: install
$(LATEXMK_EXEC) -c
wipe: install clean
$(LATEXMK_EXEC) -C
git clean -X -f -i -e '.tex' -e '.tex.orig'
install:
ifndef LATEXMK
@echo 'installing components...'
ifeq ($(OS), Linux)
ifeq ($(VERSION), )
$(error lsb-release is not installed)
else ifeq ($(VERSION), 12.04)
sudo apt-get install -y -qq texlive texlive-lang-cjk texlive-science texlive-fonts-recommended texlive-fonts-extra xdvik-ja dvipsk-ja gv latexmk
else ifeq ($(VERSION), 14.04)
sudo apt install -y -qq texlive texlive-lang-cjk texlive-science texlive-fonts-recommended texlive-fonts-extra xdvik-ja dvipsk-ja gv latexmk
else
sudo apt install -y -qq texlive texlive-lang-cjk texlive-lang-japanese texlive-science texlive-fonts-recommended texlive-fonts-extra texlive-font-utils xdvik-ja gv latexmk
endif
endif
ifeq ($(OS), Darwin)
brew tap caskroom/cask && brew cask install -v mactex && sudo tlmgr update --self --all
endif
endif