egg-980404.
[elisp/egg.git] / Makefile
1 # Makefile --- Makefile of EGG V4.0
2
3 # Copyright (C) 1997, 1998 Mule Project,
4 # Powered by ElectrotechnicalLaboratory, JAPAN.
5 # Project Leader: Satoru Tomura <tomura@etl.go.jp>
6
7 DOTEMACS=/home/niibe/.emacs
8 LEIMDIR=/usr/local/share/emacs/20.2.892/leim
9 SITEDIR=/usr/local/share/emacs/site-lisp
10
11 INSTALL=/usr/bin/install
12 ######
13
14 DEPS = -l ./docomp.el
15 BATCHFLAGS = -batch -q -no-site-file
16 EMACS = emacs
17
18 .SUFFIXES: .el .elc
19
20 ETCS = Makefile leim-list-egg.el AUTHORS ChangeLog README TODO docomp.el \
21        Egg.prj PROBLEMS
22
23 SRCS = menudiag.el its.el egg.el \
24        its/ascii.el \
25        its/erpin.el \
26        its/hankata.el \
27        its/hira.el \
28        its/jeonkak.el \
29        its/pinyin.el \
30        its/hangul.el \
31        its/kata.el \
32        its/quanjiao.el \
33        its/zenkaku.el \
34        its/zhuyin.el \
35        its-keydef.el \
36        egg-mlh.el egg-cnv.el egg-com.el \
37        egg/canna.el egg/cannarpc.el \
38        egg/sj3.el egg/sj3rpc.el \
39        egg/wnn.el egg/wnnrpc.el
40
41 ELCS = ${SRCS:.el=.elc}
42
43 DIST = ${ETCS} ${SRCS}
44
45 .el.elc:
46         ${EMACS} ${BATCHFLAGS} ${DEPS} -f batch-byte-compile $<
47
48 all: ${ELCS}
49
50 clean: 
51         rm -f ${ELCS} leim-list.el
52
53 dotemacs:
54         @if (grep "^;;; Emacs/Egg Configuration" $(DOTEMACS) 2>&1) >/dev/null; then \
55                 echo Emacs/Egg setup already exists in $(DOTEMACS);     \
56         else                                                            \
57                 (echo >> $(DOTEMACS)); \
58                 (echo ";;; Emacs/Egg Configuration" >> $(DOTEMACS)); \
59                 (echo "(require 'egg)" >> $(DOTEMACS)); \
60                 echo "Added Emacs/Egg setup to $(DOTEMACS)"; \
61         fi
62
63 leim-list.el:
64         @if (grep ";;; Egg" ${LEIMDIR}/leim-list.el 2>&1) >/dev/null; then \
65           echo Egg setup already exists in ${LEIMDIR}/leim-list.el; \
66           cat ${LEIMDIR}/leim-list.el  >leim-list.el; \
67         else                                                            \
68           cat ${LEIMDIR}/leim-list.el leim-list-egg.el >leim-list.el; \
69         fi
70
71 install-dirs:
72         for d in its egg; do \
73           if [ ! -d ${SITEDIR}/$$d ]; then mkdir -p ${SITEDIR}/$$d; fi; \
74         done
75
76 install: all dotemacs leim-list.el install-dirs
77         for x in ${SRCS} ${ELCS}; do $(INSTALL) -m 644 $$x ${SITEDIR}/`dirname $$x`; done
78         $(INSTALL) -m 644 leim-list.el ${SITEDIR}
79
80 # DEPENDENCIES
81 egg/sj3rpc.elc: egg-com.elc egg/sj3.elc
82 egg/wnnrpc.elc: egg-com.elc egg/wnn.elc
83
84 egg.elc its/ascii.elc its/erpin.elc its/hankata.elc \
85        its/hira.elc its/jeonkak.elc its/pinyin.elc \
86        its/hangul.elc its/kata.elc its/quanjiao.elc \
87        its/zenkaku.elc its/zhuyin.elc: its-keydef.elc
88
89 distclean:
90         rm -f ${ELCS} leim-list.el *~
91
92 ###  Source code maintainance
93 DATE=$(shell date "+%y%m%d")
94
95 dist: distclean
96         rm -rf ../egg-${DATE}
97         mkdir ../egg-${DATE}
98         tar -c -f - ${DIST} | tar Cxf ../egg-${DATE} -
99         (cd ../egg-${DATE}; \
100          sed "/^### Source code maintainance/,\$$d" <Makefile >Makefile.dist; \
101          mv -f Makefile.dist Makefile)
102         (cd ..; tar cvzf egg-${DATE}.tar.gz egg-${DATE})
103
104 working-ss: distclean
105         rm -rf ../egg-snap-${DATE}
106         mkdir ../egg-snap-${DATE}
107         tar -c -f - . | tar Cxf ../egg-snap-${DATE} -
108         (cd ..; tar cvzf egg-snap-${DATE}.tar.gz egg-snap-${DATE})