dotemacs

My Emacs configuration
git clone git://git.entf.net/dotemacs
Log | Files | Refs | LICENSE

Makefile (3841B)


      1 # This file has been placed in the public domain.
      2 #
      3 # Where to put the info file(s). NB: the GNU Coding Standards (GCS)
      4 # and the Filesystem Hierarchy Standard (FHS) differ on where info
      5 # files belong. The GCS says /usr/local/info; the FHS says
      6 # /usr/local/share/info. Many distros obey the FHS, but people who
      7 # installed their emacs from source probably have a GCS-ish file
      8 # hierarchy.
      9 infodir=/usr/local/info
     10 
     11 # What command to use to install info file(s)
     12 INSTALL_CMD=install -m 644
     13 
     14 # Info files generated here.
     15 infofiles=sly.info
     16 
     17 TEXI = sly.texi contributors.texi
     18 
     19 help:
     20 	@echo -e "\
     21 Most important targets:\n\
     22 all               generate info, pdf, and html documents\n\
     23 sly.info        generate the sly.info file\n\
     24 sly.html        generate a single html file\n\
     25 html/index.html   generate on html file per node in html/ directory\n\
     26 html.tgz          create a tarball of all html files\n\
     27 clean             remove generated files"
     28 
     29 all: sly.info sly.pdf html/index.html
     30 
     31 sly.dvi: $(TEXI)
     32 	texi2dvi sly.texi
     33 
     34 sly.ps: sly.dvi
     35 	dvips -o $@ $<
     36 
     37 sly.info: $(TEXI)
     38 	makeinfo $<
     39 
     40 sly.html: $(TEXI)
     41 	texi2html --css-include=sly.css $<
     42 
     43 html/index.html: $(TEXI)
     44 	makeinfo -o html --css-include=sly.css --html $<
     45 
     46 html.tgz: html/index.html
     47 	tar -czf $@ html
     48 
     49 DOCDIR=/project/sly/public_html/doc
     50 
     51 publish: sly.html
     52 	rm -rf gh-pages
     53 	git clone git@github.com:joaotavora/sly.git --branch gh-pages --single-branch gh-pages
     54 	cp sly.html gh-pages/index.html
     55 	cp -Rf images/*.png gh-pages/images
     56 	cd gh-pages \
     57 	&& git add index.html images/*\
     58 	&& git commit -a -m "Automatic documentation update" \
     59 	&& git push origin gh-pages
     60 
     61 sly.pdf: $(TEXI)
     62 	texi2pdf $<
     63 
     64 sly-refcard.pdf: sly-refcard.tex
     65 	texi2pdf $<
     66 
     67 install: install-info
     68 
     69 uninstall: uninstall-info
     70 
     71 # Create contributors.texi, a texinfo table listing all known
     72 # contributors of code.
     73 #
     74 # Explicitly includes Eric Marsden (pre-ChangeLog hacker)
     75 #
     76 # The gist of this horror show is that the contributor list is piped
     77 # into texinfo-tabulate.awk with one name per line, sorted
     78 # alphabetically.
     79 contributors.texi: Makefile texinfo-tabulate.awk
     80 	git log --format='%aN' | \
     81 	sort | \
     82 	uniq -c | \
     83 	LC_ALL=C sort -nr | \
     84 	sed -e 's/^[^A-Z]*//; /^$$/d' | \
     85 	LC_ALL=C awk -f texinfo-tabulate.awk \
     86 	> $@
     87 
     88 #.INTERMEDIATE: contributors.texi
     89 
     90 optimize-png:
     91 	optipng -clobber -o 7 images/*.png   
     92 
     93 # Debian's install-info wants a --section argument.
     94 install-info: section=$(shell grep INFO-DIR-SECTION $(infofiles) | sed 's/INFO-DIR-SECTION //')
     95 install-info: sly.info
     96 	mkdir -p $(infodir)
     97 	$(INSTALL_CMD) $(infofiles) $(infodir)/$(infofiles)
     98 	@if (install-info --version && \
     99 		install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
    100 		echo "install-info --info-dir=$(infodir) $(infodir)/$(infofiles)";\
    101 		install-info --info-dir="$(infodir)" "$(infodir)/$(infofiles)" || :;\
    102 	else \
    103 		echo "install-info --infodir=$(infodir) --section $(section) $(section) $(infodir)/$(infofiles)" && \
    104 		install-info --infodir="$(infodir)" --section $(section) ${section} "$(infodir)/$(infofiles)" || :; fi
    105 
    106 uninstall-info:
    107 	@if (install-info --version && \
    108 		install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
    109 		echo "install-info --info-dir=$(infodir) --remove $(infodir)/$(infofiles)";\
    110 		install-info --info-dir="$(infodir)" --remove "$(infodir)/$(infofiles)" || :;\
    111 	else \
    112 		echo "install-info --infodir=$(infodir) --remove $(infodir)/$(infofiles)";\
    113 		install-info --infodir="$(infodir)" --remove "$(infodir)/$(infofiles)" || :; fi
    114 	rm -f $(infodir)/$(infofiles)
    115 
    116 clean:
    117 	rm -f contributors.texi
    118 	rm -f sly.aux sly.cp sly.cps sly.fn sly.fns sly.ky
    119 	rm -f sly.kys sly.log sly.pg sly.tmp sly.toc sly.tp
    120 	rm -f sly.vr sly.vrs
    121 	rm -f sly.info sly.pdf sly.dvi sly.ps sly.html
    122 	rm -f sly-refcard.pdf sly-refcard.log sly-refcard.aux
    123 	rm -rf html html.tgz