yatex

annotate makefile @ 487:129b9f9b6d34

Target tag:
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 10 Sep 2017 21:42:08 +0859
parents 87504e29b1d5
children e9c20490b85d
rev   line source
yuuji@24 1 #
yuuji@201 2 # Makefile for YaTeX/yahtml
yuuji@24 3 #
yuuji@24 4
yuuji@67 5 # Edit these variables to be suitable for your site
yuuji@382 6 EMACS = emacs
yuuji@382 7 #EMACS = mule
yuuji@382 8 PREFIX = `${EMACS} -batch --eval '(princ (expand-file-name "../../../.." data-directory))'`
yuuji@382 9 # PREFIX = /usr/local
yuuji@67 10
yuuji@101 11 #EMACSDIR= ${PREFIX}/lib/${EMACS}
yuuji@201 12 ## emacs20 or later
yuuji@101 13 EMACSDIR= ${PREFIX}/share/${EMACS}
yuuji@81 14 ## XEmacs
yuuji@81 15 #EMACS = xemacs
yuuji@81 16 #EMACSDIR= ${PREFIX}/lib/${EMACS}
yuuji@81 17 ## Meadow (Sample)
yuuji@81 18 #EMACS = meadow
yuuji@81 19 #EMACSDIR = c:/usr/local/meadow
yuuji@302 20 ## Cocoa(or Carbon)Emacs on Darwin (Sample)
yuuji@81 21 #EMACS = /Applications/Emacs.app/Contents/MacOS/Emacs
yuuji@81 22 #PREFIX = /Applications/Emacs.app/Contents/Resources
yuuji@81 23 #EMACSDIR = ${PREFIX}
yuuji@81 24
yuuji@67 25 LISPDIR = ${EMACSDIR}/site-lisp/yatex
yuuji@81 26 # LISPDIR = ${EMACSDIR}/site-packages/lisp/yatex
yuuji@67 27 DOCDIR = ${LISPDIR}/docs
yuuji@382 28 HELPDIR = ${LISPDIR}/help
yuuji@382 29 INFODIR = ${PREFIX}/share/info
yuuji@67 30
yuuji@81 31 TAR = tar
yuuji@67 32 INSTALL = install -c -m 444
yuuji@81 33 MKDIR = mkdir -p
yuuji@81 34 INSTINFO= install-info
yuuji@81 35
yuuji@81 36
yuuji@81 37 # Comment out below if you are using Emacs Windows(meadow, etc)
yuuji@81 38 GEO = -geometry 80x20+0+0
yuuji@67 39
yuuji@67 40 ###################
yuuji@67 41 # Do not edit below
yuuji@67 42 ###################
yuuji@67 43 # make install to install YaTeX into public space
yuuji@67 44 # make ajimi to feel taste
yuuji@67 45 # make ajimi-nw same as above, but -nw mode
yuuji@67 46 # make package to create package for relase
yuuji@67 47 # make yahtmlpack to create package for relase
yuuji@67 48 # make clean to delete all producted files
yuuji@67 49 # make ci to check in all
yuuji@81 50 # make co to check out all
yuuji@444 51 MVER = 1.79
yuuji@330 52 LISP = ${LISP18} ${LISP19} ${LISP23}
yuuji@67 53 YAHTML = yahtml.el
yuuji@67 54 COMMON = yatexlib.el yatexprc.el
yuuji@67 55 LISP18 = comment.el yatex.el yatexadd.el yatexgen.el yatexenv.el \
yuuji@67 56 ${COMMON} \
yuuji@67 57 yatexmth.el yatexhks.el yatexhlp.el \
yuuji@81 58 yatexm-o.el yatexsec.el yatexhie.el yatexpkg.el ${YAHTML}
yuuji@67 59 LISP19 = yatex19.el
yuuji@330 60 LISP23 = yatex23.el
yuuji@67 61 DOCS = ${DOCSRC} ${DOCOBJ} ${NEWS}
yuuji@67 62 NEWS = yatex.new
yuuji@81 63 DOCHTML = docs/htmlqa docs/htmlqa.eng docs/yahtmlj.tex docs/yahtmle.tex
yuuji@67 64 DOCSRC = docs/yatexj.tex docs/yatexe.tex \
yuuji@67 65 docs/yatex.ref docs/yatexref.eng \
yuuji@67 66 docs/yatexadd.doc docs/yatexgen.doc \
yuuji@67 67 docs/qanda docs/qanda.eng ${DOCHTML}
yuuji@81 68 DOCOBJ = docs/yatexj docs/yatexe docs/yahtmlj docs/yahtmle
yuuji@67 69 HELP = help/YATEXHLP.jp help/YATEXHLP.eng
yuuji@24 70 MANIFEST= manifest
yuuji@201 71 EXTRA = dir install 00readme makefile readme.meadow.j newpage.rb
yuuji@67 72 DISTRIB = ${EXTRA} ${LISP} ${DOCS} ${MANIFEST} ${HELP}
yuuji@67 73 RCSFILE = ${LISP} ${NEWS} ${DOCSRC} ${HELP}
yuuji@67 74 YAHTMLLISP = ${YAHTML} ${COMMON}
yuuji@201 75 YAHTMLDIST = ${YAHTMLLISP} install 00readme makefile newpage.rb
yuuji@81 76 PACK = `ls ${DISTRIB}`
yuuji@24 77 TMPDIR = /tmp
yuuji@286 78 VERSION = `head -20 yatex.el|awk -F'"' '/revision/{print $$2}'`
yuuji@67 79 PACKDIR = ${TMPDIR}/yatex${VERSION}
yuuji@24 80
yuuji@24 81 all:
yuuji@67 82 @echo "Edit this makefile first."
yuuji@389 83 @echo 'Type "${MAKE} install" to install YaTeX.'
yuuji@389 84 @echo 'Type "${MAKE} install-yahtml" to install yahtml.'
yuuji@389 85 @echo 'If you love elc files, type "${MAKE} elc" before ${MAKE} install'
yuuji@81 86 # @echo "If you don't use X-clinet of Emacs,"
yuuji@81 87 # @echo 'type "make install-nw" instead.'
yuuji@24 88
yuuji@382 89 install: install-real install-message
yuuji@81 90 #install-yahtml: bytecompile-yahtml
yuuji@81 91 install-yahtml:
yuuji@81 92 [ -d ${LISPDIR} ] || mkdir ${LISPDIR}
yuuji@81 93 for f in *.el; do \
yuuji@81 94 rm -f ${LISPDIR}/$${f}c; \
yuuji@81 95 done
yuuji@81 96
yuuji@81 97 ${INSTALL} *.el* ${LISPDIR}
yuuji@24 98
yuuji@67 99 install-real:
yuuji@382 100 [ -d ${LISPDIR} ] || ${MKDIR} ${LISPDIR}
yuuji@382 101 [ -d ${HELPDIR} ] || ${MKDIR} ${HELPDIR}
yuuji@382 102 [ -d ${DOCDIR} ] || ${MKDIR} ${DOCDIR}
yuuji@382 103 [ -d ${INFODIR} ] || ${MKDIR} ${INFODIR}
yuuji@81 104 for f in *.el; do \
yuuji@81 105 rm -f ${LISPDIR}/$${f}c; \
yuuji@81 106 done
yuuji@81 107 ${INSTALL} *.el* ${NEWS} ${LISPDIR}
yuuji@67 108 ${INSTALL} ${DOCSRC} ${DOCDIR}
yuuji@67 109 ${INSTALL} ${DOCOBJ} ${INFODIR}
yuuji@67 110 ${INSTALL} ${HELP} ${HELPDIR}
yuuji@382 111
yuuji@382 112 install-message:
yuuji@81 113 @echo "--------------------------------"
yuuji@389 114 @echo "If you have install-info command, type '${MAKE} install-info'."
yuuji@81 115 @echo "If not, add next lines into your site's info dir manually."
yuuji@67 116 @cat dir
yuuji@382 117 @echo "--------------------------------"
yuuji@382 118 @echo "=== INSTALLATION DONE ==="
yuuji@382 119 @echo " You might need to add these expression below to your ~/.emacs"
yuuji@382 120 @echo " 完了. ~/.emacs 等に以下を追加する必要があるかもしれません."
yuuji@382 121 @echo
yuuji@382 122 @echo ";;; ------ Startup definitions for YaTeX ------ ;;;"
yuuji@389 123 @${MAKE} show-init
yuuji@382 124 @echo ";;; ------------------------------------------- ;;;"
yuuji@382 125 @echo
yuuji@389 126 @echo " To get elisp above again, call ${MAKE} command as below."
yuuji@389 127 @echo " 上記elispを再度得るには以下のように${MAKE}を起動してください."
yuuji@389 128 @echo " % ${MAKE} $${PREFIX:+PREFIX=$$PREFIX }show-init"
yuuji@67 129
yuuji@81 130 install-info:
yuuji@81 131 for f in ${DOCOBJ}; do \
yuuji@81 132 b=`basename $$f | sed 's,/.*,,'`; \
yuuji@81 133 ${INSTINFO} --entry="`grep $$b dir`" --section=TeX \
yuuji@81 134 --section=Emacs $${f} ${INFODIR}/dir; \
yuuji@81 135 done
yuuji@81 136
yuuji@382 137 show-init:
yuuji@387 138 @printf '%s\n' \
yuuji@382 139 '(setq auto-mode-alist' \
yuuji@382 140 " (cons (cons \"\\.tex$$\" 'yatex-mode) auto-mode-alist))" \
yuuji@382 141 "(autoload 'yatex-mode \"yatex\" \"Yet Another LaTeX mode\" t)" \
yuuji@387 142 "(add-to-list 'load-path \"${LISPDIR}\")" \
yuuji@387 143 "(setq YaTeX-help-file \"${LISPDIR}/help/YATEXHLP.eng\")"
yuuji@389 144 @printf '(setq tex-command "%s")\n' \
yuuji@382 145 `CMDS='platex pdflatex ptex2pdf lualatex' DFLT=latex \
yuuji@389 146 ${MAKE} -s search-cmd`
yuuji@389 147 @printf '(setq dvi2-command "%s")\n' \
yuuji@382 148 `CMDS='pxdvi xdvik kxdvi dviout texworks' DFLT=xdvi \
yuuji@389 149 ${MAKE} -s search-cmd`
yuuji@389 150 @printf '(setq tex-pdfview-command "%s")\n' \
yuuji@382 151 `CMDS='evince mupdf xpdf kpdf texworks sumatrapdf' \
yuuji@382 152 DFLT=acroread \
yuuji@389 153 ${MAKE} -s search-cmd`
yuuji@382 154
yuuji@382 155 show-init2:
yuuji@389 156 @${MAKE} LISPDIR=$$PWD show-init
yuuji@382 157
yuuji@382 158 search-cmd:
yuuji@382 159 @for f in $$CMDS; do \
yuuji@382 160 type $$f >/dev/null 2>&1 && echo $$f && exit 0; done; echo $$DFLT
yuuji@382 161
yuuji@67 162 install-nw: bytecompile-nw install-real
yuuji@67 163
yuuji@81 164 elc: bytecompile
yuuji@81 165
yuuji@67 166 bytecompile: lp
yuuji@67 167 if [ "$$DISPLAY"x = ""x ]; then \
yuuji@67 168 echo "Set DISPLAY environment variable!!"; exit 1; fi
yuuji@81 169 ${EMACS} -q ${GEO} -l ./yatexlib.el -e bcf-and-exit ${LISP}
yuuji@67 170
yuuji@81 171 bytecompile-nw: lp1
yuuji@81 172 ${EMACS} -batch -l ./yatexlib.el -e batch-byte-compile ${LISP18}
yuuji@67 173
yuuji@81 174 bytecompile-yahtml:
yuuji@67 175 if [ "$$DISPLAY"x = ""x ]; then \
yuuji@67 176 echo "Set DISPLAY environment variable!!"; exit 1; fi
yuuji@81 177 ${EMACS} -q -g 80x20+0+0 -l ./yatexlib.el -e bcf-and-exit ${YAHTMLLISP}
yuuji@67 178
yuuji@67 179 lp:
yuuji@67 180 echo '(setq load-path (cons "." load-path))' > lp.el
yuuji@67 181 echo '(load-file "./yatexlib.el")' >>lp.el
yuuji@67 182
yuuji@81 183 lp1: lp
yuuji@67 184 echo '(load-file "./yatex.el")' >>lp.el
yuuji@67 185 echo '(load-file "./comment.el")' >>lp.el
yuuji@67 186
yuuji@67 187 lp2:
yuuji@67 188 echo '(setq load-path (cons "'`pwd`'" load-path))' >>lp.el
yuuji@67 189 echo '(setq auto-mode-alist' >>lp.el
yuuji@67 190 echo '(cons (cons "\\.tex" '"'yatex-mode) auto-mode-alist))" >>lp.el
yuuji@67 191 echo '(load-library "yatex")' >>lp.el
yuuji@67 192
yuuji@67 193 ajimi: lp lp2
yuuji@67 194 ${EMACS} -l ./lp.el -e yatex-mode
yuuji@67 195
yuuji@67 196 ajimi-nw: lp lp2
yuuji@67 197 ${EMACS} -nw -l ./lp.el -e yatex-mode
yuuji@67 198
yuuji@67 199 clean:
yuuji@67 200 rm -f *.elc *~ lp.el
yuuji@67 201
yuuji@81 202 info: docs/yatexj docs/yatexe docs/yahtmlj docs/yahtmle
yuuji@67 203
yuuji@67 204 docs/yatexj: docs/yatexj.tex
yuuji@81 205 (cd docs; ${EMACS} -batch -l ../yatexlib.el -e tfb-and-exit yatexj.tex)
yuuji@67 206
yuuji@67 207 docs/yatexe: docs/yatexe.tex
yuuji@81 208 (cd docs; ${EMACS} -batch -l ../yatexlib.el -e tfb-and-exit yatexe.tex)
yuuji@81 209
yuuji@81 210 docs/yahtmlj: docs/yahtmlj.tex
yuuji@81 211 (cd docs;${EMACS} -batch -l ../yatexlib.el -e tfb-and-exit yahtmlj.tex)
yuuji@81 212
yuuji@81 213 docs/yahtmle: docs/yahtmle.tex
yuuji@81 214 (cd docs;${EMACS} -batch -l ../yatexlib.el -e tfb-and-exit yahtmle.tex)
yuuji@67 215
yuuji@67 216 package: info
yuuji@67 217 @-mkdir ${PACKDIR}
yuuji@67 218 @tar cf - ${PACK} | (cd ${PACKDIR}; tar xf -)
yuuji@67 219 ( version=${VERSION}; cd ${TMPDIR}; \
yuuji@67 220 ${TAR} vzcf ${TMPDIR}/yatex$$version.tar.gz yatex$$version)
yuuji@67 221
yuuji@67 222 yahtmlpack:
yuuji@67 223 @-mkdir ${PACKDIR}
yuuji@67 224 @tar cf - ${YAHTMLDIST} | (cd ${PACKDIR}; tar xf -)
yuuji@67 225 ( version=${VERSION}; cd ${TMPDIR}; \
yuuji@67 226 ${TAR} vzcf ${TMPDIR}/yahtml$$version.tar.gz yatex$$version)
yuuji@24 227
yuuji@479 228 tag:
yuuji@487 229 hg tag yatex-${VERSION}
yuuji@479 230 # ci:
yuuji@479 231 # ci -r${VERSION} -sRel -f ${RCSFILE}
yuuji@479 232 # ci -u${VERSION} makefile 00readme
yuuji@40 233
yuuji@479 234 # co:
yuuji@479 235 # co ${RCSFILE}
yuuji@40 236
yuuji@27 237
yuuji@81 238 RSYNCDIR = ${HOME}/http/yatex/rsync/yatex
yuuji@114 239 #sync:
yuuji@114 240 # @-mkdir ${PACKDIR}
yuuji@114 241 # @tar cf - ${PACK} | (cd ${PACKDIR}; tar xf -)
yuuji@114 242 # syncdir -A -x CVS ${PACKDIR} ${RSYNCDIR}
yuuji@114 243 # (cd ${RSYNCDIR}; cvs ci -m '')
yuuji@114 244 # rm -rf ${PACKDIR}