summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/ecv/template/Makefile
blob: 9eab4bb635c44ebd39f2d20c01b9364521cf15fb (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Copyright 2007 Bernd Haberstumpf
#
# This makefile is intended to build an CV withg the ecv package.
#
# This file is free software; as a special exception the author
# gives unlimited permission to copy and/or distribute it, with
# or without modifications, as long as this notice is 
# preserved.
#
# This file is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY, to the extent permitted by law; 
# without even the implied warranty of MERCHANTABILITY or 
# FITNESS FOR A PARTICULAR PURPOSE.

# LANGUAGE: The language to use
LANGUAGE	= de
# BASENAME: The basename of the document without language
BASENAME	= CV-template_
# NAME: Basename of the package
NAME		= $(BASENAME)$(LANGUAGE)
# PORTTRAIT: The portrait of the writer
PORTRAIT	= portrait.eps

# BUILDPATH: Where distribution will be assembled
BUILDPATH	= build
# IMAGESPATH: Where images are searched
IMAGESPATH	= .

TEX		= $(NAME).tex
PDF		= $(NAME).pdf
DVI		= $(NAME).dvi

RES		= 600

#
# Tools
#

MKDIRP		= mkdir -p
CP		= cp
RMRF		= rm -rf
PDFLATEX	= pdflatex
LATEX		= latex
CONVERT		= convert
ACROREAD	= acroread

.PHONY : all force pdf fpdf dvi clean distclean

# create $(NAME).pdf
all : pdf

force : fpdf

# forced create a pdf from $(NAME).tex
fpdf : 
	@touch $(TEX)
	$(MAKE) $(PDF)

# Creates a pdf from $(NAME).tex
pdf : $(PDF)

# Creates a dvi from $(NAME).tex
dvi : $(DVI)

# show document with acroread
viewpdf : pdf
	@$(ACROREAD) $(PDF)

# Rule to create pdfs
%.pdf : %.tex
	@echo "-- Creating $(BUILDPATH)"
	@$(MKDIRP) "$(BUILDPATH)"
	@echo "-- Copy $< to $(BUILDPATH)"
	@$(CP) "$<" "$(BUILDPATH)"
	@echo "-- Copying image images/$(PORTRAIT)"
	@$(CONVERT) -density $(RES)x$(RES) \
		    -size 945x1417 \
		    $(IMAGESPATH)/$(PORTRAIT) \
		    $(BUILDPATH)/portrait.jpg
	@echo "-- Running pdflatex"
	cd $(BUILDPATH); $(PDFLATEX) $<
	@$(CP) $(BUILDPATH)/$@ .

%.dvi : %.tex
	@echo "-- Creating $(BUILDPATH)"
	@$(MKDIRP) "$(BUILDPATH)"
	@echo "-- Copy $< to $(BUILDPATH)"
	@$(CP) "$<" "$(BUILDPATH)"
	@echo "-- Running pdflatex"
	@( \
	cd $(BUILDPATH); \
	$(LATEX) $<; \
	)
	@$(CP) $(BUILDPATH)/$@ .

images/%.jpg : build/%.jpg
	

# Cleans up this installation
clean:
	@echo "-- Removing $(BUILDPATH)"
	@$(RMRF) $(BUILDPATH)

# Also removes pdfs and dvis
distclean: clean
	@echo "-- Removing $(BASENAME)*.pdf and $(BASENAME)*.dvi"
	@$(RMRF) $(BASENAME)*.pdf
	@$(RMRF) $(BASENAME)*.dvi