dotemacs

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

Makefile (3762B)


      1 -include ../config.mk
      2 include ../default.mk
      3 
      4 docs: info html html-dir pdf
      5 
      6 info: $(PKG).info dir
      7 html: $(PKG).html
      8 pdf:  $(PKG).pdf
      9 
     10 ORG_ARGS  = --batch -Q $(ORG_LOAD_PATH)
     11 ORG_EVAL += --eval "(setq indent-tabs-mode nil)"
     12 ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)"
     13 ORG_EVAL += --funcall org-texinfo-export-to-texinfo
     14 
     15 .PHONY: texi
     16 texi:
     17 	@$(EMACS) $(ORG_ARGS) $(PKG).org $(ORG_EVAL)
     18 	@printf "\n" >> $(PKG).texi
     19 	@rm -f $(PKG).texi~
     20 
     21 %.info: %.texi
     22 	@printf "Generating $@\n"
     23 	@$(MAKEINFO) --no-split $< -o $@
     24 
     25 dir: $(PKG).info
     26 	@printf "Generating $@\n"
     27 	@printf "%s" $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@
     28 
     29 HTML_FIXUP_CSS    = '/<link rel="stylesheet" type="text\/css" href="\/assets\/page.css">/a\
     30 <link rel="icon" href="/assets/magit_alt1.ico">\
     31 \n<link class="s-css-s--style" rel="stylesheet"           title="Default"               href="/assets/themes/default.css">\
     32 \n<link class="s-css-s--style" rel="stylesheet alternate" title="Default high contrast" href="/assets/themes/default-high-contrast.css">\
     33 \n<link class="s-css-s--style" rel="stylesheet alternate" title="Solarized dark xterm"  href="/assets/themes/solarized-dark-xterm.css">\
     34 \n<link class="s-css-s--style" rel="stylesheet alternate" title="Black on white"        href="/assets/themes/black-on-white.css">\
     35 \n<script src="/assets/js/simple-css-switch.js"></script>'
     36 HTML_FIXUP_ONLOAD = 's/<body lang="en">/<body lang="en" onload="simpleCssSwitch()">/'
     37 HTML_FIXUP_MENU   = '/<\/body>/i<div id="s-css-s--menu"><\/div>'
     38 
     39 %.html: %.texi
     40 	@printf "Generating $@\n"
     41 	@$(MAKEINFO) --html --no-split $(MANUAL_HTML_ARGS) $<
     42 	@sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e $(HTML_FIXUP_MENU) $@
     43 
     44 html-dir: $(PKG).texi
     45 	@printf "Generating $(PKG)/*.html\n"
     46 	@$(MAKEINFO) --html $(MANUAL_HTML_ARGS) $<
     47 	@for f in $$(find $(PKG) -name '*.html') ; do \
     48 	sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e $(HTML_FIXUP_MENU) $$f ; \
     49 	done
     50 
     51 %.pdf: %.texi
     52 	@printf "Generating $@\n"
     53 	@texi2pdf --clean $< > /dev/null
     54 
     55 .PHONY: stats
     56 stats:
     57 	@printf "Generating statistics\n"
     58 	@gitstats $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR)
     59 
     60 PUBLISH_PATH   ?= /manual/
     61 RELEASE_PATH   ?= /manual/$(VERSION)/
     62 S3_BUCKET      ?= s3://$(DOMAIN)
     63 PUBLISH_TARGET  = $(S3_BUCKET)$(PUBLISH_PATH)
     64 RELEASE_TARGET  = $(S3_BUCKET)$(RELEASE_PATH)
     65 CFRONT_PATHS    = $(PKG).html $(PKG).pdf $(PKG)/*
     66 
     67 comma := ,
     68 empty :=
     69 space := $(empty) $(empty)
     70 
     71 publish: html html-dir pdf
     72 	@aws s3 cp $(PKG).html $(PUBLISH_TARGET)
     73 	@aws s3 cp $(PKG).pdf  $(PUBLISH_TARGET)
     74 	@aws s3 sync $(PKG)    $(PUBLISH_TARGET)$(PKG)/
     75 	@printf "Generating CDN invalidation\n"
     76 	@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
     77 	"$(subst $(space),$(comma),$(addprefix $(PUBLISH_PATH),$(CFRONT_PATHS)))" > /dev/null
     78 
     79 release: html html-dir pdf
     80 	@aws s3 cp $(PKG).html $(RELEASE_TARGET)
     81 	@aws s3 cp $(PKG).pdf  $(RELEASE_TARGET)
     82 	@aws s3 sync $(PKG)    $(RELEASE_TARGET)$(PKG)/
     83 	@aws s3 cp $(PUBLISH_TARGET)dir.html $(RELEASE_TARGET)dir.html
     84 	@aws s3 cp $(PUBLISH_TARGET)dir/index.html $(RELEASE_TARGET)dir/index.html
     85 	@printf "Generating CDN invalidation\n"
     86 	@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
     87 	"$(subst $(space),$(comma),$(addprefix $(RELEASE_PATH),$(CFRONT_PATHS)))" > /dev/null
     88 
     89 CLEAN = $(PKG).info dir $(PKG) $(PKG).html $(PKG).pdf
     90 
     91 clean:
     92 	@printf "Cleaning docs/*...\n"
     93 	@rm -rf $(CLEAN)
     94 
     95 .PHONY: authors AUTHORS.md
     96 authors: AUTHORS.md
     97 
     98 AUTHORS.md:
     99 	@ printf "Authors\n=======\n\n" > $@
    100 	@ ( printf "%s\n" "- Barak A. Pearlmutter <barak+git@pearlmutter.net>" && \
    101 	    printf "%s\n" "- Lele Gaifax <lele@metapensiero.it>" && \
    102 	    printf "%s\n" "- RĂ©mi Vanicat <vanicat@debian.org>" && \
    103 	    git log --pretty=format:'- %aN <%aE>' \
    104 	  ) | sort -u >> $@