update.
[elisp/egg.git] / Makefile
1 # Makefile --- Makefile of EGG V4.0
2
3 # Copyright (C) 1997 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.1/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
22 SRCS = menudiag.el its.el egg.el \
23        its/hira.el \
24        egg-mlh.el egg-cnv.el egg-com.el \
25        euc-cn.el \
26        egg/sj3.el egg/sj3rpc.el \
27        egg/wnn.el egg/wnnrpc.el
28
29 ELCS = ${SRCS:.el=.elc}
30
31 DIST = ${ETCS} ${SRCS}
32
33 .el.elc:
34         ${EMACS} ${BATCHFLAGS} ${DEPS} -f batch-byte-compile $<
35
36 all: ${ELCS}
37
38 clean: 
39         rm -f ${ELCS} leim-list.el
40
41 dotemacs:
42         @if (grep "^;;; Emacs/Egg Configuration" $(DOTEMACS) 2>&1) >/dev/null; then \
43                 echo Emacs/Egg setup already exists in $(DOTEMACS);     \
44         else                                                            \
45                 (echo >> $(DOTEMACS)); \
46                 (echo ";;; Emacs/Egg Configuration" >> $(DOTEMACS)); \
47                 (echo "(require 'egg)" >> $(DOTEMACS)); \
48                 echo "Added Emacs/Egg setup to $(DOTEMACS)"; \
49         fi
50
51 leim-list.el:
52         @if (grep ";;; Egg" ${LEIMDIR}/leim-list.el 2>&1) >/dev/null; then \
53           echo Egg setup already exists in ${LEIMDIR}/leim-list.el; \
54           cat ${LEIMDIR}/leim-list.el  >leim-list.el; \
55         else                                                            \
56           cat ${LEIMDIR}/leim-list.el leim-list-egg.el >leim-list.el; \
57         fi
58
59 install-dirs:
60         for d in its egg; do \
61           if [ ! -d ${SITEDIR}/$$d ]; then mkdir -p ${SITEDIR}/$$d; fi; \
62         done
63
64 install: all dotemacs leim-list.el install-dirs
65         for x in ${SRCS} ${ELCS}; do $(INSTALL) -m 644 $$x ${SITEDIR}/`dirname $$x`; done
66         $(INSTALL) -m 644 leim-list.el ${SITEDIR}
67
68 egg/sj3rpc.elc: egg-com.elc egg/sj3.elc
69 egg/wnnrpc.elc: egg-com.elc egg/wnn.elc
70
71 distclean:
72         rm -f ${ELCS} leim-list.el *~
73
74 ###  Source code maintainance
75 DATE=$(shell date "+%y%m%d")
76
77 dist: distclean
78         rm -rf ../egg-${DATE}
79         mkdir ../egg-${DATE}
80         tar -c -f - ${DIST} | tar Cxf ../egg-${DATE} -
81         (cd ../egg-${DATE}; \
82          sed "/^### Source code maintainance/,\$$d" <Makefile >Makefile.dist; \
83          mv -f Makefile.dist Makefile)
84         (cd ..; tar cvzf egg-${DATE}.tar.gz egg-${DATE})
85
86 working-ss: distclean
87         rm -rf ../egg-snap-${DATE}
88         mkdir ../egg-snap-${DATE}
89         tar -c -f - . | tar Cxf ../egg-snap-${DATE} -
90         (cd ..; tar cvzf egg-snap-${DATE}.tar.gz egg-snap-${DATE})