├── README ├── index.html └── Makefile /README: -------------------------------------------------------------------------------- 1 | The goal was creating an easy to use (and re-use) tool for writing documentation 2 | and presentation in Latex. The target operating systems were GNU/Linux based 3 | systems, however it should work on all Unix based systems. Might work on 4 | Windows as well. 5 | 6 | It makes heavy use of the GNU Make utility: the whole solution consists of a 7 | Makefile making it easy to deploy and use. 8 | 9 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Makefile for Latex 9 | 10 |

Build environment for Latex

11 | 12 |

Introduction

13 | 14 |

15 | The goal was creating an easy to use (and re-use) tool for writing documentation and presentation in Latex. 16 | The target operating systems were GNU/Linux based systems, however it should work on all Unix based systems. 17 | Might work on Windows as well. 18 |

19 | 20 |

21 | It makes heavy use of the GNU Make utility: the whole solution 22 | consists of a Makefile making it easy to deploy and use. 23 |

24 | 25 |

Requirements

26 | 27 |

28 | The following software is required to use this solution: 29 |

30 | 31 | 41 | 42 |

Usage

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 | 90 | 91 | 92 | 93 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 111 | 112 | 113 | 114 | 119 | 120 | 121 | 122 | 126 | 127 | 128 | 129 | 133 | 134 | 135 | 136 | 141 | 142 | 143 | 144 | 147 | 148 | 149 | 150 | 151 | 152 |
makecompiles everything to every format
make [file format]compiles everything to specified format supported formats: dvi, ps, pdf
make clean_tmpdeletes temporary files
make cleandeletes temporary files and targets
make allrebuilds everything
make helpdisplay usage
make help_[target]display usage of the specified target
make show 76 | compile everything and show them
77 |
78 | program used for displaying can be overwritten:
79 |   SHOW_CMD=<command>
80 | preferred file format can be overwritten:
81 |   SHOW_FORMAT=<format>
82 | example:
83 |   make show SHOW_CMD=kghostview SHOW_FORMAT=pdf
84 | These values can be overwritten by defining environment variables as well, for example:
85 |   export SHOW_CMD=kghostview
86 | Default values:
87 |   SHOW_CMD=acroread
88 |   SHOW_FORMAT=pdf 89 |
make slides 94 | display a slideshow
95 | Works similarly to "make show"
96 | The environment variables it uses and their default values:
97 |   SLIDES_CMD=xpdf -fullscreen -aa yes -aaVector yes
98 |   SLIDES_FORMAT=pdf 99 |
make optionsdisplay all options
make slides_template 108 | create a slides template latex source to start with the name of the generated template is the 109 | value of the TEMPLATE_NAME option. 110 |
update 115 | get the latest version of this makefile. Internet connection required. 116 | Unless REMOVE_OLD_LATEX_MAKEFILE is defined, it keeps the old version of 117 | this makefile as Makefile.old. 118 |
zip 123 | cleans the code and creates a zip archive from it. 124 | The name of the zip file depends on the value of PROJECT_NAME. 125 |
project 130 | creates a projectName.txt file in which the value of the actual 131 | PROJECT_NAME is stored. It will be the default value for PROJECT_NAME 132 |
backup 137 | creates a zip archive and uploads it to a backup server defined by:
138 |   FTP_HOST and FTP_USERNAME 139 | password has to be typed interactively. 140 |
todo 145 | grep for the TODO text in the source files. 146 |
targetslist accepted make targets
153 | 154 |

155 | Default values can be overridden by exporting the environment variables with the same name to the 156 | make process or by overriding them explicitly when invoking the make 157 | command: 158 |

159 | 160 |

161 | make NAME=value 162 |

163 | 164 |

Download

165 | 166 |

167 | Download the latest version. 168 |

169 | 170 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Latex and graphviz compilation tool 2 | # Copyright (C) 2009-2011. Abel Sinkovics (abel@sinkovics.hu) 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | -include config.mk 18 | 19 | # The shell to use 20 | SHELL ?= /bin/bash 21 | 22 | # The output directory to use 23 | OUT_DIR ?= . 24 | 25 | # List of options 26 | OPTIONS += SHOW_CMD 27 | OPTIONS += SHOW_FORMAT 28 | 29 | OPTIONS += SLIDES_CMD 30 | OPTIONS += SLIDES_FORMAT 31 | 32 | OPTIONS += TEMPLATE_NAME 33 | 34 | OPTIONS += PROJECT_NAME 35 | 36 | OPTIONS += FTP_HOST 37 | OPTIONS += FTP_USERNAME 38 | 39 | OPTIONS += OUT_DIR 40 | 41 | OPTIONS += USE_PDFLATEX 42 | 43 | OPTIONS += SHELL 44 | 45 | OPTIONS += REMOVE_OLD_LATEX_MAKEFILE 46 | 47 | # The graphviz files 48 | SRC_DOT_FILES = $(wildcard *.dot) 49 | SRC_FILES += SRC_DOT_FILES 50 | 51 | DOT_PS_FILES = $(addprefix $(OUT_DIR)/,$(SRC_DOT_FILES:.dot=.ps)) 52 | OUT_PS_FILES += $(DOT_PS_FILES) 53 | 54 | DOT_PDF_FILES = $(DOT_PS_FILES:.ps=.pdf) 55 | PS_PDF_FILES += $(DOT_PDF_FILES) 56 | 57 | DOT_SVG_FILES = $(addprefix $(OUT_DIR)/,$(SRC_DOT_FILES:.dot=.svg)) 58 | OUT_SVG_FILES += $(DOT_SVG_FILES) 59 | 60 | DOT_SVGZ_FILES = $(addprefix $(OUT_DIR)/,$(SRC_DOT_FILES:.dot=.svgz)) 61 | OUT_SVGZ_FILES += $(DOT_SVGZ_FILES) 62 | 63 | DOT_FIG_FILES = $(addprefix $(OUT_DIR)/,$(SRC_DOT_FILES:.dot=.fig)) 64 | OUT_FIG_FILES += $(DOT_FIG_FILES) 65 | 66 | DOT_PNG_FILES = $(addprefix $(OUT_DIR)/,$(SRC_DOT_FILES:.dot=.png)) 67 | OUT_PNG_FILES += $(DOT_PNG_FILES) 68 | 69 | DOT_GIF_FILES = $(addprefix $(OUT_DIR)/,$(SRC_DOT_FILES:.dot=.gif)) 70 | OUT_GIF_FILES += $(DOT_GIF_FILES) 71 | 72 | DOT_JPG_FILES = $(addprefix $(OUT_DIR)/,$(SRC_DOT_FILES:.dot=.jpg)) 73 | OUT_JPG_FILES += $(DOT_JPG_FILES) 74 | 75 | # The latex files 76 | SRC_TEX_FILES = $(wildcard *.tex) 77 | SRC_FILES += SRC_TEX_FILES 78 | 79 | ifeq ($(USE_PDFLATEX),) 80 | TEX_DVI_FILES = $(addprefix $(OUT_DIR)/,$(SRC_TEX_FILES:.tex=.dvi)) 81 | OUT_DVI_FILES += $(TEX_DVI_FILES) 82 | DVI_PS_FILES += $(TEX_DVI_FILES:.dvi=.ps) 83 | DVI_PDF_FILES += $(TEX_DVI_FILES:.dvi=.pdf) 84 | else 85 | TEX_PDF_FILES = $(addprefix $(OUT_DIR)/,$(SRC_TEX_FILES:.tex=.pdf)) 86 | PDF_PS_FILES += $(TEX_PDF_FILES:.pdf=.ps) 87 | endif 88 | 89 | TMP_LOG_FILES = $(addprefix $(OUT_DIR)/,$(SRC_TEX_FILES:.tex=.log)) 90 | TEMP_FILES += $(TMP_LOG_FILES) 91 | 92 | TMP_AUX_FILES = $(addprefix $(OUT_DIR)/,$(SRC_TEX_FILES:.tex=.aux)) 93 | TEMP_FILES += $(TMP_AUX_FILES) 94 | 95 | TMP_NAV_FILES = $(SRC_TEX_FILES:.tex=.nav) 96 | TEMP_FILES += $(TMP_NAV_FILES) 97 | 98 | OUT_FILES = $(SRC_TEX_FILES:.tex=.out) 99 | TEMP_FILES += $(OUT_FILES) 100 | 101 | TMP_SNM_FILES = $(SRC_TEX_FILES:.tex=.snm) 102 | TEMP_FILES += $(TMP_SNM_FILES) 103 | 104 | TMP_TOC_FILES = $(SRC_TEX_FILES:.tex=.toc) 105 | TEMP_FILES += $(TMP_TOC_FILES) 106 | 107 | TMP_VRB_FILES = $(SRC_TEX_FILES:.tex=.vrb) 108 | TEMP_FILES += $(TMP_VRB_FILES) 109 | 110 | # Bibliography dependencies 111 | BIB_DEPS_FILE = bib.mk 112 | TEMP_FILES += $(BIB_DEPS_FILE) 113 | $(shell echo "" > $(BIB_DEPS_FILE)) 114 | $(foreach t, $(SRC_TEX_FILES), $(shell egrep '\\bibliography\{[^}]*\}' $(t) | sed 's/^.*\\bibliography{\|}.*//g' | awk '{printf("$(t) : %s.bib\nTEMP_FILES += $(OUT_DIR)/$(basename $(t)).blg $(OUT_DIR)/$(basename $(t)).bbl\n", $$0); }' >> $(BIB_DEPS_FILE)) ) 115 | 116 | # Join same file types coming from different source formats 117 | OUT_PS_FILES += $(DVI_PS_FILES) $(PDF_PS_FILES) 118 | OUT_PDF_FILES += $(DVI_PDF_FILES) $(PS_PDF_FILES) $(TEX_PDF_FILES) 119 | 120 | # Files that are real targets 121 | TARGET_FILES += $(OUT_DVI_FILES) 122 | TARGET_FILES += $(OUT_PS_FILES) 123 | TARGET_FILES += $(OUT_PDF_FILES) 124 | TARGET_FILES += $(OUT_SVG_FILES) 125 | TARGET_FILES += $(OUT_SVGZ_FILES) 126 | TARGET_FILES += $(OUT_FIG_FILES) 127 | TARGET_FILES += $(OUT_PNG_FILES) 128 | TARGET_FILES += $(OUT_GIF_FILES) 129 | TARGET_FILES += $(OUT_JPG_FILES) 130 | 131 | # Files that are archived when an archive is created 132 | FILES_TO_ARCHIVE = $(addprefix $(OUT_DIR)/,$(shell ls $(OUT_DIR) | egrep -v '[.]zip$$' $(foreach f,$(patsubst $(OUTDIR)/%,,$(TEMP_FILES) $(TARGET_FILES)), | grep -vF $(f)))) 133 | 134 | # Default options 135 | DEFAULT_SLIDES_CMD = xpdf -fullscreen -aa yes -aaVector yes 136 | DEFAULT_SLIDES_FORMAT = pdf 137 | 138 | DEFAULT_SHOW_CMD = acroread 139 | DEFAULT_SHOW_FORMAT = pdf 140 | 141 | # Options 142 | SHOW_CMD ?= $(DEFAULT_SHOW_CMD) 143 | SHOW_FORMAT ?= $(DEFAULT_SHOW_FORMAT) 144 | SLIDES_CMD ?= $(DEFAULT_SLIDES_CMD) 145 | SLIDES_FORMAT ?= $(DEFAULT_SLIDES_FORMAT) 146 | 147 | # Name of the project 148 | PROJECT_NAME ?= $(shell cat projectName.txt 2>/dev/null) 149 | 150 | # Postfix for archives 151 | ARCHIVE_NAME = $(PROJECT_NAME)_$(shell date '+%Y_%m_%d') 152 | 153 | ZIP_ARCHIVE = $(ARCHIVE_NAME).zip 154 | 155 | # Display the name of an option and it's default value 156 | showOptionAndDefault = $(1)=$(DEFAULT_$(strip $(1))) 157 | 158 | # Phony target to compile all latex files 159 | all_target : dvi ps pdf svg svgz fig png gif jpg 160 | .PHONY: all_target 161 | 162 | # Targets for file formats 163 | dvi : $(OUT_DVI_FILES) 164 | ps : $(OUT_PS_FILES) 165 | pdf : $(OUT_PDF_FILES) 166 | svg : $(OUT_SVG_FILES) 167 | svgz : $(OUT_SVGZ_FILES) 168 | fig : $(OUT_FIG_FILES) 169 | png : $(OUT_PNG_FILES) 170 | gif : $(OUT_GIF_FILES) 171 | jpg : $(OUT_JPG_FILES) 172 | 173 | .PHONY: dvi ps pdf svg svgz fig png gif jpg 174 | 175 | # Dependencies between different types of data formats 176 | LATEX_DEPENDENCIES += $(DOT_PS_FILES) $(DOT_PDF_FILES) $(DOT_FIG_FILES) 177 | 178 | $(DOT_PS_FILES) : $(OUT_DIR)/%.ps : %.dot $(OUT_DIR) 179 | dot -Tps $< -o $@ 180 | 181 | $(DOT_SVG_FILES) : $(OUT_DIR)/%.svg : %.dot 182 | dot -Tsvg $< -o $@ 183 | 184 | $(DOT_SVGZ_FILES) : $(OUT_DIR)/%.svgz : %.dot 185 | dot -Tsvgz $< -o $@ 186 | 187 | $(DOT_FIG_FILES) : $(OUT_DIR)/%.fig : %.dot 188 | dot -Tfig $< -o $@ 189 | 190 | $(DOT_PNG_FILES) : $(OUT_DIR)/%.png : %.dot 191 | dot -Tpng $< -o $@ 192 | 193 | $(DOT_GIF_FILES) : $(OUT_DIR)/%.gif : %.dot 194 | dot -Tgif $< -o $@ 195 | 196 | $(DOT_JPG_FILES) : $(OUT_DIR)/%.jpg : %.dot 197 | dot -Tjpg $< -o $@ 198 | 199 | $(TEX_DVI_FILES) : $(OUT_DIR)/%.dvi : %.tex $(OUT_DIR) $(LATEX_DEPENDENCIES) 200 | latex -output-directory $(OUT_DIR) $< 201 | if egrep '\\bibliography\{[^}]*\}' $<; then bibtex $(OUT_DIR)/$(basename $<).aux && latex -output-directory $(OUT_DIR) $<; else echo "no bibliography found"; fi 202 | latex -output-directory $(OUT_DIR) $< 203 | 204 | $(TEX_PDF_FILES) : $(OUT_DIR)/%.pdf : %.tex $(OUT_DIR) $(LATEX_DEPENDENCIES) 205 | pdflatex -output-directory $(OUT_DIR) $< 206 | if egrep '\\bibliography\{[^}]*\}' $<; then bibtex $(OUT_DIR)/$(basename $<).aux && pdflatex -output-directory $(OUT_DIR) $<; else echo "no bibliography found"; fi 207 | pdflatex -output-directory $(OUT_DIR) $< 208 | 209 | # Convert dvi files to ps files 210 | $(DVI_PS_FILES) : %.ps : %.dvi 211 | dvips -o $@ $< 212 | 213 | # Convert dvi files to pdf files 214 | $(DVI_PDF_FILES) : %.pdf : %.dvi 215 | dvipdf $< $@ 216 | 217 | # Convert ps files to pdf files 218 | $(PS_PDF_FILES) : %.pdf : %.ps 219 | ps2pdf $< $@ 220 | 221 | # Convert pdf files to ps files 222 | $(PDF_PS_FILES) : %.ps : %.pdf 223 | pdf2ps $< $@ 224 | 225 | # Remove temporary files 226 | clean_tmp : 227 | -rm $(TEMP_FILES) 228 | 229 | .PHONY: clean_tmp 230 | 231 | # Remove every generated file, and the output directory if it's empty 232 | clean : clean_tmp 233 | -rm $(TARGET_FILES) 234 | -rmdir $(OUT_DIR) 235 | 236 | .PHONY: clean 237 | 238 | # Clean & build 239 | all : clean all_latex 240 | .PHONY: all 241 | 242 | # Show 243 | show : $(addprefix $(OUT_DIR)/, $(SRC_TEX_FILES:.tex=.$(SHOW_FORMAT))) 244 | $(foreach f,$+, $(SHOW_CMD) $(f) && ) true 245 | .PHONY: show 246 | 247 | # Display slideshow 248 | slides : $(addprefix $(OUT_DIR)/, $(SRC_TEX_FILES:.tex=.$(SLIDES_FORMAT))) 249 | $(foreach f,$+, $(SLIDES_CMD) $(f) && ) true 250 | 251 | # Display options 252 | options : 253 | @$(foreach OPT,$(OPTIONS), echo $(OPT)=$($(OPT)) && ) true 254 | .PHONY: options 255 | 256 | # Update to the latest version of this template 257 | ifdef REMOVE_OLD_LATEX_MAKEFILE 258 | REMOVE_OLD_MAKEFILE = rm Makefile 259 | else 260 | REMOVE_OLD_MAKEFILE = mv Makefile Makefile.old 261 | endif 262 | 263 | update : 264 | -rm Makefile.old 265 | $(REMOVE_OLD_MAKEFILE) 266 | wget http://latex.sinkovics.hu/Makefile 267 | .PHONY: update 268 | 269 | include $(BIB_DEPS_FILE) 270 | 271 | # Grep all TODOs in the source files 272 | todo : 273 | @grep TODO $(SRC_TEX_FILES) || true 274 | .PHONY: todo 275 | 276 | # Create an archive 277 | zip : $(ZIP_ARCHIVE) 278 | .PHONY : zip 279 | 280 | $(ZIP_ARCHIVE) : $(FILES_TO_ARCHIVE) 281 | -rm $(ZIP_ARCHIVE) 282 | zip $(ZIP_ARCHIVE) $(FILES_TO_ARCHIVE) 283 | 284 | # Create a backup 285 | backup : $(ZIP_ARCHIVE) 286 | echo '$(FTP_USERNAME)\nput $(ZIP_ARCHIVE)' | ftp $(FTP_HOST) 287 | 288 | # Create a project name file 289 | project : 290 | echo $(PROJECT_NAME) > projectName.txt 291 | .PHONY: project 292 | 293 | # Create a slides template 294 | REDIRECT = >> $(TEMPLATE_NAME).tex 295 | 296 | slides_template : 297 | @echo > $(TEMPLATE_NAME).tex 298 | @echo '\\documentclass{beamer}' $(REDIRECT) 299 | @echo '' $(REDIRECT) 300 | @echo '\\usepackage{beamerthemesplit}' $(REDIRECT) 301 | @echo '' $(REDIRECT) 302 | @echo '\\title{Title}' $(REDIRECT) 303 | @echo '\\author{Author}' $(REDIRECT) 304 | @echo '\\date{\\today}' $(REDIRECT) 305 | @echo '' $(REDIRECT) 306 | @echo '\\begin{document}' $(REDIRECT) 307 | @echo '' $(REDIRECT) 308 | @echo '\\frame{\\titlepage}' $(REDIRECT) 309 | @echo '' $(REDIRECT) 310 | @echo '\\section[Outline]{}' $(REDIRECT) 311 | @echo '\\frame{\\tableofcontents}' $(REDIRECT) 312 | @echo '' $(REDIRECT) 313 | @echo '\\section{Introduction}' $(REDIRECT) 314 | @echo '\\subsection{Overview}' $(REDIRECT) 315 | @echo '\\frame' $(REDIRECT) 316 | @echo '{' $(REDIRECT) 317 | @echo ' \\frametitle{Frame1}' $(REDIRECT) 318 | @echo '}' $(REDIRECT) 319 | @echo '\\end{document}' $(REDIRECT) 320 | .PHONY: template 321 | 322 | # Create output directory 323 | $(OUT_DIR) : 324 | mkdir -p $(OUT_DIR) 325 | 326 | # Create config makefile 327 | config : 328 | echo 'PROJECT_NAME ?= $(PROJECT_NAME)' > config.mk 329 | echo 'OUT_DIR ?= $(OUT_DIR)' >> config.mk 330 | echo 'USE_PDFLATEX ?= $(USE_PDFLATEX)' >> config.mk 331 | .PHONY: config 332 | 333 | # Help 334 | help_make : help_header 335 | @echo " make - Compiles everything to every format" 336 | @echo 337 | @echo " make [file format] - Compiles everything to specified format" 338 | @echo " Supported formats: dvi, ps, pdf, svg, svgz, fig," 339 | @echo " png, gif, jpg" 340 | @echo " Target files are generated in OUT_DIR which is" 341 | @echo " . by default." 342 | @echo " If a file called out_dir exists, it's content" 343 | @echo " overrides the value of OUT_DIR." 344 | @echo 345 | HELP_TARGETS += make 346 | 347 | help_clean_tmp : help_header 348 | @echo " make clean_tmp - Deletes temporary files" 349 | @echo 350 | HELP_TARGETS += clean_tmp 351 | 352 | help_clean : help_header 353 | @echo " make clean - Deletes temporary files and targets" 354 | @echo 355 | HELP_TARGETS += clean 356 | 357 | help_all : help_header 358 | @echo " make all - Rebuilds everything" 359 | @echo 360 | HELP_TARGETS += all 361 | 362 | help_help : help_header 363 | @echo " make help - Display usage" 364 | @echo 365 | @echo " make help_[target] - Display usage of the specified target" 366 | @echo 367 | HELP_TARGETS += help 368 | 369 | help_show : help_header 370 | @echo " make show - Compile everything and show them" 371 | @echo 372 | @echo " Program used for displaying can be overwritten:" 373 | @echo " SHOW_CMD=" 374 | @echo " Preferred file format can be overwritten:" 375 | @echo " SHOW_FORMAT=" 376 | @echo " Example:" 377 | @echo " make show SHOW_CMD=kghostview SHOW_FORMAT=pdf" 378 | @echo " These values can be overwritten by defining" 379 | @echo " environment variables as well, for example:" 380 | @echo " export SHOW_CMD=kghostview" 381 | @echo " Default values:" 382 | @echo " $(call showOptionAndDefault, SHOW_CMD)" 383 | @echo " $(call showOptionAndDefault, SHOW_FORMAT)" 384 | @echo 385 | HELP_TARGETS += show 386 | 387 | help_slides : help_header 388 | @echo " make slides - Display a slideshow" 389 | @echo " Works similarly to \"make show\"" 390 | @echo " The environment variables it uses and their" 391 | @echo " default values:" 392 | @echo " $(call showOptionAndDefault, SLIDES_CMD)" 393 | @echo " $(call showOptionAndDefault, SLIDES_FORMAT)" 394 | @echo 395 | HELP_TARGETS += slides 396 | 397 | help_options : help_header 398 | @echo " make options - Display all options" 399 | @echo 400 | HELP_TARGETS += options 401 | 402 | help_slides_template : help_header 403 | @echo " make slides_template - Create a slides template latex source to start with" 404 | @echo " The name of the generated template is the" 405 | @echo " value of the TEMPLATE_NAME option." 406 | @echo 407 | HELP_TARGETS += slides_template 408 | 409 | help_update : help_header 410 | @echo " update - Get the latest version of this makefile" 411 | @echo " Internet connection required." 412 | @echo " Unless REMOVE_OLD_LATEX_MAKEFILE is defined, it" 413 | @echo " keeps the old version of this makefile as" 414 | @echo " Makefile.old" 415 | @echo 416 | HELP_TARGETS += update 417 | 418 | help_zip : help_header 419 | @echo " zip - Cleans the code and creates a zip archive" 420 | @echo " from it. The name of the zip file depends" 421 | @echo " on the value of PROJECT_NAME" 422 | @echo 423 | HELP_TARGETS += zip 424 | 425 | help_backup : help_header 426 | @echo " backup - Creates a zip archive and uploads it to" 427 | @echo " a backup server defined by:" 428 | @echo " FTP_HOST and FTP_USERNAME" 429 | @echo " Password has to be typed interactively" 430 | @echo 431 | HELP_TARGETS += backup 432 | 433 | help_todo : help_header 434 | @echo " todo - Grep for the TODO text in the source files." 435 | @echo 436 | HELP_TARGETS += todo 437 | 438 | help_config : help_header 439 | @echo " config - Generate the config.mk file containing the" 440 | @echo " project-specific options." 441 | @echo " It stores the following options:" 442 | @echo " PROJECT_NAME - used for archive generation" 443 | @echo " OUT_DIR - directory to generate output" 444 | @echo " files into" 445 | @echo " USE_PDFLATEX - use pdflatex instead of latex" 446 | @echo " Changing these options:" 447 | @echo " make config PROJECT_NAME=" 448 | HELP_TARGETS += config 449 | 450 | help_targets : help_header 451 | @echo " targets - List accepted make targets" 452 | @echo 453 | HELP_TARGETS += targets 454 | 455 | help_header : license 456 | @echo " Usage:" 457 | @echo 458 | 459 | license : 460 | @echo 461 | @echo "Latex and Graphviz compilation tool." 462 | @echo "Copyright (C) 2009. Abel Sinkovics (abel@sinkovics.hu)" 463 | @echo "This program comes with ABSOLUTELY NO WARRANTY" 464 | @echo "This is free software, and you are welcome to redistribute it" 465 | @echo "under certain conditions; see http://www.gnu.org/licenses/ for details." 466 | @echo 467 | 468 | help : help_header $(addprefix help_, $(HELP_TARGETS)) 469 | 470 | targets : help_header 471 | @echo " $(foreach t, $(sort $(HELP_TARGETS)), $(t)\n)" 472 | 473 | 474 | 475 | --------------------------------------------------------------------------------