| 1 |
# Copyright 2007-2011 Christoph P. Neumann, Bernd Haberstumpf |
| 2 |
# |
| 3 |
# This makefile is intended to build an CV withg the ecv package. |
| 4 |
# |
| 5 |
# This file is free software; as a special exception the author |
| 6 |
# gives unlimited permission to copy and/or distribute it, with |
| 7 |
# or without modifications, as long as this notice is |
| 8 |
# preserved. |
| 9 |
# |
| 10 |
# This file is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY, to the extent permitted by law; |
| 12 |
# without even the implied warranty of MERCHANTABILITY or |
| 13 |
# FITNESS FOR A PARTICULAR PURPOSE. |
| 14 |
|
| 15 |
# LANGUAGE: The language to use |
| 16 |
LANGUAGE ?= de |
| 17 |
# BASENAME: The basename of the document without language |
| 18 |
BASENAME = CV-template_ |
| 19 |
# NAME: Basename of the package |
| 20 |
NAME = $(BASENAME)$(LANGUAGE) |
| 21 |
# PORTTRAIT: The portrait of the writer |
| 22 |
PORTRAIT = portrait.eps |
| 23 |
|
| 24 |
# BUILDPATH: Where distribution will be assembled |
| 25 |
BUILDPATH = build |
| 26 |
# IMAGESPATH: Where images are searched |
| 27 |
IMAGESPATH = . |
| 28 |
|
| 29 |
TEX = $(NAME).tex |
| 30 |
PDF = $(NAME).pdf |
| 31 |
DVI = $(NAME).dvi |
| 32 |
|
| 33 |
RES = 600 |
| 34 |
|
| 35 |
# |
| 36 |
# Tools |
| 37 |
# |
| 38 |
|
| 39 |
MKDIRP = mkdir -p |
| 40 |
CP = cp |
| 41 |
RMRF = rm -rf |
| 42 |
PDFLATEX = pdflatex |
| 43 |
LATEX = latex |
| 44 |
CONVERT = convert |
| 45 |
ACROREAD = acroread |
| 46 |
|
| 47 |
.PHONY : all force pdf fpdf dvi clean distclean |
| 48 |
|
| 49 |
# create $(NAME).pdf |
| 50 |
all : pdf |
| 51 |
|
| 52 |
force : fpdf |
| 53 |
|
| 54 |
# forced create a pdf from $(NAME).tex |
| 55 |
fpdf : |
| 56 |
@touch $(TEX) |
| 57 |
$(MAKE) $(PDF) |
| 58 |
|
| 59 |
# Creates a pdf from $(NAME).tex |
| 60 |
pdf : $(PDF) |
| 61 |
|
| 62 |
# Creates a dvi from $(NAME).tex |
| 63 |
dvi : $(DVI) |
| 64 |
|
| 65 |
# show document with acroread |
| 66 |
viewpdf : pdf |
| 67 |
@$(ACROREAD) $(PDF) |
| 68 |
|
| 69 |
# Rule to create pdfs |
| 70 |
%.pdf : %.tex |
| 71 |
@echo "-- Creating $(BUILDPATH)" |
| 72 |
@$(MKDIRP) "$(BUILDPATH)" |
| 73 |
@echo "-- Copy $< to $(BUILDPATH)" |
| 74 |
@$(CP) "$<" "$(BUILDPATH)" |
| 75 |
@echo "-- Copying image images/$(PORTRAIT)" |
| 76 |
@$(CONVERT) -density $(RES)x$(RES) \ |
| 77 |
-size 945x1417 \ |
| 78 |
$(IMAGESPATH)/$(PORTRAIT) \ |
| 79 |
$(BUILDPATH)/portrait.jpg |
| 80 |
@echo "-- Running pdflatex" |
| 81 |
cd $(BUILDPATH); $(PDFLATEX) $< |
| 82 |
@$(CP) $(BUILDPATH)/$@ . |
| 83 |
|
| 84 |
%.dvi : %.tex |
| 85 |
@echo "-- Creating $(BUILDPATH)" |
| 86 |
@$(MKDIRP) "$(BUILDPATH)" |
| 87 |
@echo "-- Copy $< to $(BUILDPATH)" |
| 88 |
@$(CP) "$<" "$(BUILDPATH)" |
| 89 |
@echo "-- Running pdflatex" |
| 90 |
@( \ |
| 91 |
cd $(BUILDPATH); \ |
| 92 |
$(LATEX) $<; \ |
| 93 |
) |
| 94 |
@$(CP) $(BUILDPATH)/$@ . |
| 95 |
|
| 96 |
images/%.jpg : build/%.jpg |
| 97 |
|
| 98 |
|
| 99 |
# Cleans up this installation |
| 100 |
clean: |
| 101 |
@echo "-- Removing $(BUILDPATH)" |
| 102 |
@$(RMRF) $(BUILDPATH) |
| 103 |
|
| 104 |
# Also removes pdfs and dvis |
| 105 |
distclean: clean |
| 106 |
@echo "-- Removing $(PDF)and $(DVI)" |
| 107 |
@$(RMRF) $(PDF) |
| 108 |
@$(RMRF) $(DVI) |