SHELL:=/bin/bash PACKAGE_NAME?=lettre MAKELEVELBASE?=0 EXAMPLES:=letex1 letex2 letex3 letex4 letex5 letex6 \ letex7 letex8 \ testfaxf testfaxe testfaxd SUBSRC:=$(addsuffix .tex,$(EXAMPLES)) SCRIPTOUT_SRC:=lettre-languages.tex AUTO_SRC:=$(SCRIPTOUT_SRC) lettre-path.tex TOPSRC := lettre.tex MAINSRC := lettre-sondes.tex $(AUTO_SRC) DOCTEXMKFILE:= latexmkrc.pl letdoc.ist DOCMAKEFILE := $(DOCTEXMKFILE) makefile lettre-makedefinitions.mak LOGOS:= amgmono.mps ecusson55.mps INSTITUTS:=amg obs default DOCSRC := $(MAINSRC) $(SUBSRC) $(TOPSRC) $(LOGOS) DOCPDF := $(patsubst %.tex,%.pdf, $(TOPSRC)) # ce qui est livré tout compilé dans les zip DOC := lettre.pdf LANGS:=english french german romand USenglish STYFILES_STRIP:=lettre.cls $(patsubst %,lettre-%.ldf,$(LANGS)) STYFILES_INDOC:=$(STYFILES_STRIP) STYFILES_PLAIN:=$(patsubst %,lettre-%.cfg,$(INSTITUTS)) STYFILES := $(STYFILES_STRIP) $(STYFILES_PLAIN) README:= README ALIRE DOS2UNIX?= ifeq ($(OS),Windows_NT) define DOS2UNIX dos2unix $(1); endef endif TEMPLATES:=lettre-institut.tpl lettre.tpl lettre-telefax.tpl DISTTYPE:=plain # DISTTYPE:=dtx EMPTY:=# SPACE:=$(EMPTY) # define TEX_TRIMMER_AWK BEGIN {print_enb = 0};\ /^ *\\documentclass/ {print_enb = 1} ;\ print_enb == 1 {print};\ /^ *\\end{document}/ {print_enb=0} endef define STYSTRIP_TRIMMER_AWK BEGIN { RS="\r?\n|\r"; state = 0; to_print_count = 0 };\ {type = 0 };\ /^%\^\^A/ { type = 1; if(state == 1) to_print[to_print_count++] = $$0;}; \ /^\\iffalse [A-Za-z:" ]+ *\\fi *$$/ { type = 2 }; \ /^ *$$/ { type = 3; if(state == 1) to_print[to_print_count++] = $$0; }; \ type == 0 { state= 1; for(i=0; i < to_print_count;) print to_print[i++]; to_print_count = 0; print} endef #" define STYPLAIN_TRIMMER_AWK BEGIN { RS="\r?\n|\r"; state = 0; to_print_count = 0 };\ {type = 0 };\ /^%/ { type = 1; if(state == 1) to_print[to_print_count++] = $$0;}; \ /^\\iffalse [A-Za-z:" ]+ *\\fi *$$/ { type = 2 }; \ /^ *$$/ { type = 3; if(state == 1) to_print[to_print_count++] = $$0; }; \ type == 0 { state= 1; for(i=0; i < to_print_count;) print to_print[i++]; to_print_count = 0; print} endef #" define GET_RELATIVE_PATH_AWK BEGIN{\ split(from,a_from,"/");\ split(to,a_to,"/");\ i = 1;\ while(i in a_from && i in a_to && a_from[i] == a_to[i]) ++i;\ j=i;\ while(j in a_to){\ printf("../");\ ++j;\ };\ while(i in a_from) printf("%s/",a_from[i++]);\ exit\ } endef # Le rm -f $(notdir $(2)); est nécessaire à cause de l'émulation MSYS # qui fait une copie au lieu d'un vrai lien symbolique. define MAKE_SYMLINK targetpath=$$(awk \ -v "from=$(abspath $(dir $(1)))" \ -v "to=$(abspath $(dir $(2)))" \ '$(GET_RELATIVE_PATH_AWK)'); \ pushd "$(dir $(2))"; \ rm -f $(notdir $(2)); \ echo 'symlink: cd "$(dir $(2))"; ln -s "'"$$targetpath"'$(notdir $(1))" "'"$(notdir $(2))"'"'; \ ln -s "$${targetpath}$(notdir $(1))" "$(notdir $(2))"; \ popd endef # Commodité pour le déboggage des makefile define PAUSE echo "Appuyer la touche pour continuer..."; \ read touche; \ case $touche in \ *) echo "Reprise du script..." \ ;;\ esac endef define SET_OUTFILE if [ -f $@ ]; then \ outfile=$$(mktemp /tmp/version.XXXXX); \ move_it=true; \ else \ outfile=$@; \ move_it=false; \ fi endef define OUTFILE $$outfile; \ if $$move_it; then \ if diff -q $$outfile $@; then \ rm $$outfile; \ else \ mv $$outfile $@; \ fi; \ fi endef # Local Variables: # mode: makefile-gmake # End: