1 | #-----[ Directory ]---------------------------------------- |
---|
2 | |
---|
3 | DIR_DOC = . |
---|
4 | DIR_TEX = $(DIR_DOC) |
---|
5 | DIR_FIG = $(DIR_DOC)/fig |
---|
6 | DIR_EPS = $(DIR_DOC)/eps |
---|
7 | DIR_STY = $(DIR_DOC)/sty |
---|
8 | |
---|
9 | #-----[ Files ]-------------------------------------------- |
---|
10 | |
---|
11 | TEX_FILES = $(wildcard $(DIR_TEX)/*.tex) |
---|
12 | DVI_FILES = $(patsubst $(DIR_TEX)/%.tex,%.dvi,$(TEX_FILES)) |
---|
13 | PS_FILES = $(patsubst $(DIR_TEX)/%.tex,%.ps ,$(TEX_FILES)) |
---|
14 | PDF_FILES = $(patsubst $(DIR_TEX)/%.tex,%.pdf,$(TEX_FILES)) |
---|
15 | EPS_FILES = $(patsubst $(DIR_FIG)/%.fig,$(DIR_EPS)/%.eps,$(wildcard $(DIR_FIG)/*.fig)) \ |
---|
16 | $(patsubst $(DIR_FIG)/%.dot,$(DIR_EPS)/%.eps,$(wildcard $(DIR_FIG)/*.dot)) \ |
---|
17 | $(patsubst $(DIR_FIG)/%.eps,$(DIR_EPS)/%.eps,$(wildcard $(DIR_FIG)/*.eps)) |
---|
18 | |
---|
19 | #-----[ Rules ]-------------------------------------------- |
---|
20 | |
---|
21 | #-------------------------------------------------------------------------------- |
---|
22 | # The reset of this file shall not be editted |
---|
23 | #-------------------------------------------------------------------------------- |
---|
24 | .PHONY : all clean clean_all help |
---|
25 | .SECONDARY : $(DVI_FILES) $(PS_FILES) $(PDF_FILES) $(EPS_FILES) $(DIR_EPS) |
---|
26 | |
---|
27 | all_documentation : $(EPS_FILES) |
---|
28 | $(MAKE) $(PDF_FILES) |
---|
29 | |
---|
30 | #-------------------------------------------------------------------------------- |
---|
31 | # Generation of the formatted text: |
---|
32 | # regular flow tex -> dvi -> ps -> pdf. |
---|
33 | #-------------------------------------------------------------------------------- |
---|
34 | %.pdf : %.ps |
---|
35 | @\ |
---|
36 | $(ECHO) "Génération du fichier $*.pdf"; \ |
---|
37 | $(PS2PDF) $< $@; |
---|
38 | |
---|
39 | %.ps : %.dvi |
---|
40 | @\ |
---|
41 | $(ECHO) "Génération du fichier $*.ps"; \ |
---|
42 | $(DVIPS) -o $@ $<; |
---|
43 | |
---|
44 | %.dvi : $(DIR_TEX)/%.tex |
---|
45 | @\ |
---|
46 | $(ECHO) "Génération du fichier $*.dvi"; \ |
---|
47 | $(LATEX) $<; \ |
---|
48 | $(LATEX) $< > /dev/null; \ |
---|
49 | citation=`$(GREP) "citation" $*.aux`; \ |
---|
50 | if $(TEST) -n "$$citation" ; then \ |
---|
51 | $(BIBTEX) $* ; \ |
---|
52 | fi; \ |
---|
53 | $(LATEX) $< > /dev/null; \ |
---|
54 | $(LATEX) $< > /dev/null; |
---|
55 | |
---|
56 | #-------------------------------------------------------------------------------- |
---|
57 | # The figures directory |
---|
58 | #-------------------------------------------------------------------------------- |
---|
59 | $(DIR_EPS) : |
---|
60 | @\ |
---|
61 | $(ECHO) "Make directory : $@"; \ |
---|
62 | $(MKDIR) $@; |
---|
63 | |
---|
64 | $(DIR_EPS)/%.eps : $(DIR_FIG)/%.eps $(DIR_EPS) |
---|
65 | @\ |
---|
66 | $(ECHO) "Generate files : $*.eps"; \ |
---|
67 | $(CP) $(DIR_FIG)/$*.eps $(DIR_EPS); |
---|
68 | |
---|
69 | $(DIR_EPS)/%.eps : $(DIR_FIG)/%.fig $(DIR_EPS) |
---|
70 | @\ |
---|
71 | $(ECHO) "Generate files : $*.eps"; \ |
---|
72 | $(FIG2EPS) $< $@; |
---|
73 | |
---|
74 | $(DIR_EPS)/%.eps : $(DIR_FIG)/%.dot $(DIR_EPS) |
---|
75 | @\ |
---|
76 | $(ECHO) "Generate files : $*.eps"; \ |
---|
77 | $(DOT) -Tfig -o $(DIR_EPS)/${*}.fig $<; \ |
---|
78 | $(FIG2EPS) $(DIR_EPS)/${*}.fig $@; \ |
---|
79 | $(RM) $(DIR_EPS)/${*}.fig; |
---|
80 | |
---|
81 | #-------------------------------------------------------------------------------- |
---|
82 | # Cleaning |
---|
83 | #-------------------------------------------------------------------------------- |
---|
84 | |
---|
85 | clean : |
---|
86 | @\ |
---|
87 | $(ECHO) "Delete temporary files "$(PWD); \ |
---|
88 | $(RM) $(DIR_EPS) \ |
---|
89 | $(DVI_FILES) \ |
---|
90 | $(PS_FILES) \ |
---|
91 | $(DIR_DOC)/*~ \ |
---|
92 | $(DIR_STY)/*~ \ |
---|
93 | $(DIR_TEX)/*~ \ |
---|
94 | $(DIR_FIG)/*~ \ |
---|
95 | $(DIR_DOC)/*.bak \ |
---|
96 | $(DIR_DOC)/*.aux \ |
---|
97 | $(DIR_DOC)/*.bbl \ |
---|
98 | $(DIR_DOC)/*.blg \ |
---|
99 | $(DIR_DOC)/*.bmt \ |
---|
100 | $(DIR_DOC)/*.log \ |
---|
101 | $(DIR_DOC)/*.mtc* \ |
---|
102 | $(DIR_DOC)/*.toc \ |
---|
103 | $(DIR_DOC)/*.idx \ |
---|
104 | $(DIR_DOC)/*.maf \ |
---|
105 | $(DIR_DOC)/*.ilg \ |
---|
106 | $(DIR_DOC)/*.ind \ |
---|
107 | $(DIR_DOC)/*.out \ |
---|
108 | $(DIR_DOC)/*.nav \ |
---|
109 | $(DIR_DOC)/*.snm \ |
---|
110 | $(DIR_DOC)/missfont.log; \ |
---|
111 | |
---|
112 | clean_all : clean |
---|
113 | @$(RM) $(PDF_FILES); |
---|
114 | |
---|
115 | #-------------------------------------------------------------------------------- |
---|
116 | # Help |
---|
117 | #-------------------------------------------------------------------------------- |
---|
118 | |
---|
119 | help : |
---|
120 | @\ |
---|
121 | $(ECHO) " -----[ Documentation ]------------------------------";\ |
---|
122 | $(ECHO) ""; \ |
---|
123 | $(ECHO) " * all_documentation : Generate all documents"; \ |
---|
124 | $(ECHO) " * clean : Erase all temporary files"; \ |
---|
125 | $(ECHO) " * clean_all : Erase all generate files"; \ |
---|
126 | $(ECHO) " * help : Print this message"; \ |
---|
127 | $(ECHO) ""; |
---|