config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

Makefile (3541B)


      1 .SUFFIXES:	# we don't need default suffix rules
      2 ifeq ($(MAKELEVEL), 0)
      3   $(error This make needs to be started as a sub-make from the toplevel directory.)
      4 endif
      5 .PHONY:		all info html pdf card manual guide install \
      6 		clean cleanall clean-install
      7 
      8 all:		$(ORG_MAKE_DOC)
      9 
     10 info:		org orgguide
     11 
     12 html:		org.html orgguide.html
     13 
     14 pdf:		org.pdf orgguide.pdf
     15 
     16 card:		orgcard.pdf orgcard_letter.pdf orgguide.pdf
     17 
     18 ifneq ($(SERVERMK),)
     19 manual guide::
     20 	-$(RMR) $@
     21 	$(MKDIR) $@
     22 manual::	org.texi org-version.inc
     23 	$(TEXI2HTML) -o $@ $<
     24 	../mk/mansplit.pl $@/*
     25 guide::		orgguide.texi org-version.inc
     26 	$(TEXI2HTML) -o $@ $<
     27 	../mk/guidesplit.pl $@/*
     28 endif
     29 
     30 # We increase GC threshold when generating documentation.  This
     31 # imrpoves the performance significantly.  See
     32 # https://yhetil.org/emacs-devel/9778F176-E724-4E61-B0FB-327BCDD316C0@acm.org
     33 # Too high number may cause memory overflow (for example, it has
     34 # happened in CI during automated build).  We choose 50Mb threshold,
     35 # based on the above discussion.
     36 org.texi:	org-manual.org
     37 	$(BATCH) 				      \
     38 	  --eval '(add-to-list `load-path "../lisp")' \
     39 	  --eval '(load "../mk/org-fixup.el")' 	      \
     40 	  --eval '(setq gc-cons-threshold (* 50 1000 1000))' \
     41 	  --eval '(org-make-manual)'
     42 
     43 orgguide.texi:	org-guide.org
     44 	$(BATCH) 				      \
     45 	  --eval '(add-to-list `load-path "../lisp")' \
     46 	  --eval '(load "../mk/org-fixup.el")' 	      \
     47 	  --eval '(setq gc-cons-threshold (* 50 1000 1000))' \
     48 	  --eval '(org-make-guide)'
     49 
     50 org-version.inc:	org.texi
     51 	@echo "org-version: $(ORGVERSION) ($(GITVERSION))"
     52 	@echo "@c automatically generated, do not edit"  > org-version.inc
     53 	@echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> org-version.inc
     54 	@echo "@set DATE $(DATE)" >> org-version.inc
     55 
     56 org-version.tex:	orgcard.tex
     57 	@printf "org-version: $(ORGVERSION) ($(GITVERSION))\n"
     58 	@printf "%% automatically generated, do not edit\n" > org-version.tex
     59 	@printf "\def\orgversionnumber{$(ORGVERSION)}\n" >> org-version.tex
     60 	@printf "\def\\\\versionyear{$(YEAR)}\n" >> org-version.tex
     61 	@printf "\def\year{$(YEAR)}\n" >> org-version.tex
     62 
     63 install:	org orgguide
     64 	if [ ! -d $(DESTDIR)$(infodir) ]; then $(MKDIR) $(DESTDIR)$(infodir); else true; fi ;
     65 	$(CP) org.info $(DESTDIR)$(infodir)
     66 	$(CP) orgguide.info $(DESTDIR)$(infodir)
     67 	$(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) org.info
     68 	$(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) orgguide.info
     69 
     70 clean:
     71 	$(RM) *.pdf *.html *.info *_letter.tex org-version.inc org-version.tex \
     72 	      *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs *.toc \
     73               *.tp *.tps *.vr *.vrs *.log *.ps
     74 cleanall:	clean
     75 	$(RM) org.texi orgguide.texi
     76 	$(RMR) guide manual
     77 
     78 clean-install:
     79 	$(RM) $(DESTDIR)$(infodir)/org*
     80 	$(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove org
     81 	$(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove orgguide
     82 
     83 .SUFFIXES:	.texi .tex .txt _letter.tex
     84 
     85 %:		%.texi org-version.inc
     86 	$(MAKEINFO) --no-split $< -o $@.info
     87 
     88 # the following two lines work around a bug in some versions of texi2dvi
     89 %.pdf:		LC_ALL=C
     90 %.pdf:		LANG=C
     91 %.pdf:		%.texi org-version.inc
     92 	$(TEXI2PDF) $<
     93 %.pdf:		%.tex org-version.tex
     94 	PDFLATEX=$(PDFTEX) $(TEXI2PDF) $<
     95 
     96 %.html:		%.texi org-version.inc
     97 	$(TEXI2HTML) --no-split -o $@ $<
     98 ifneq ($(SERVERMK),)
     99 	../mk/manfull.pl $@
    100 
    101 %.txt:		%.tex
    102 	perl ../mk/orgcard2txt.pl $< > $@
    103 endif
    104 
    105 %_letter.tex:	%.tex
    106 	$(BATCH) 				      \
    107 	  --eval '(add-to-list `load-path "../lisp")' \
    108 	  --eval '(load "org-compat.el")' 	      \
    109 	  --eval '(load "../mk/org-fixup.el")' 	      \
    110 	  --eval '(org-make-letterformat "$(<F)" "$(@F)")'