]> code.delx.au - gnu-emacs/blob - lisp/Makefile
*** empty log message ***
[gnu-emacs] / lisp / Makefile
1 #
2 # Maintenance productions for the Lisp directory
3 #
4
5 # You can specify a different executable on the make command line,
6 # e.g. "make EMACS=../src/emacs ...".
7
8 EMACS = ../src/emacs
9
10 # Command line flags for Emacs. This must include --multibyte,
11 # otherwise some files will not compile.
12
13 EMACSOPT = --no-init-file --no-site-file --multibyte -batch
14
15 SOURCES = *.el COPYING Makefile
16 lisptagsfiles1 = [a-zA-Z]*.el
17 lisptagsfiles2 = [a-zA-Z]*/[a-zA-Z]*.el
18 ETAGS = ../lib-src/etags
19
20 # Files which should not be compiled. All file names must be relative
21 # to the `lisp' directory.
22 # - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
23 # no point compiling it, although it doesn't hurt.
24
25 DONTCOMPILE = bindings.el mail/blessmail.el play/bruce.el cus-load.el \
26 cus-start.el forms-d2.el forms-pass.el \
27 international/latin-1.el international/latin-2.el \
28 international/latin-3.el international/latin-4.el \
29 international/latin-5.el \
30 loaddefs.el loadup.el international/mule-conf.el patcomp.el \
31 paths.el mail/sc.el subdirs.el version.el \
32 generic-x.el international/latin-8.el international/latin-9.el \
33 emacs-lisp/cl-specs.el finder-inf.el term/internal.el
34
35 # The actual Emacs command run in the targets below.
36
37 emacs = $(EMACS) $(EMACSOPT)
38
39 # Common command to find subdirectories
40
41 setwins=subdirs=`find $$wd -type d -print`; \
42 for file in $$subdirs; do \
43 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
44 *) wins="$$wins $$file" ;; \
45 esac; \
46 done
47
48 doit:
49
50 cus-load.el:
51 touch $@
52 custom-deps: cus-load.el doit
53 wd=.; $(setwins); \
54 echo Directories: $$wins; \
55 $(emacs) -l cus-dep -f custom-make-dependencies $$wins
56
57 finder-inf.el:
58 echo "(provide 'finder-inf)" >> $@
59 finder-data: finder-inf.el doit
60 wd=.; $(setwins); \
61 echo Directories: $$wins; \
62 $(emacs) -l finder -f finder-compile-keywords-make-dist $$wins
63
64 loaddefs.el:
65 echo ";;; loaddefs.el --- automatically extracted autoloads" >> $@
66 echo ";;" >> $@; echo ";;; Code:" >> $@
67 echo "\f" >> $@
68 echo ";;; Local Variables:" >> $@
69 echo ";;; version-control: never" >> $@
70 echo ";;; no-byte-compile: t" >> $@
71 echo ";;; no-update-autoloads: t" >> $@
72 echo ";;; End:" >> $@
73 echo ";;; loaddefs.el ends here" >> $@
74 autoloads: loaddefs.el doit
75 wd=.; $(setwins); \
76 echo Directories: $$wins; \
77 $(emacs) --eval '(setq generated-autoload-file "'`pwd`'/loaddefs.el")' -f batch-update-autoloads $$wins
78
79 subdirs.el:
80 $(MAKE) $(MFLAGS) update-subdirs
81 update-subdirs: doit
82 wd=.; $(setwins); \
83 for file in $$wins; do \
84 ../update-subdirs $$file; \
85 done;
86
87 updates: update-subdirs autoloads finder-data custom-deps
88
89 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
90 ${ETAGS} $(lisptagsfiles1) $(lisptagsfiles2)
91
92 TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
93 ${ETAGS} -o TAGS-LISP \
94 $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
95
96 .el.elc: subdirs.el
97 -EMACSLOADPATH=`pwd` $(emacs) -f batch-byte-compile $<
98
99 $(DONTCOMPILE:.el=.elc):
100 -rm -f $@
101
102 # Compile all Lisp files, except those from DONTCOMPILE. This
103 # compiles files unconditionally. All .elc files are made writable
104 # before compilation in case we checked out read-only (CVS option -r).
105 # Files must be compiled one by one, otherwise apparently
106 # eval-when-compile's in some Lisp files make problems in files being
107 # compiled later. We also set the load-path of the Emacs used for
108 # compilation to the current directory and its subdirectories, to
109 # make sure require's and load's in the files being compiled find
110 # the right files.
111
112 compile-files: subdirs.el doit
113 find . -name "*.elc" -print | xargs chmod +w; \
114 wd=.; $(setwins); \
115 elpat=`echo $$wins | tr ' ' '\012\012' | \
116 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
117 els=`echo $$elpat $(DONTCOMPILE) | tr ' ' '\012\012' | sort | uniq -u`; \
118 echo $$els; \
119 EMACSLOADPATH=`pwd` $(emacs) -f batch-byte-compile $$els
120
121 # Backup compiled Lisp files in elc.tar.gz. If that file already
122 # exists, make a backup of it.
123
124 backup-compiled-files:
125 -mv elc.tar.gz elc.tar.gz~
126 tar czf elc.tar.gz *.elc */*.elc
127
128 # Compile Lisp files, but save old compiled files first.
129
130 compile: backup-compiled-files compile-files
131
132 # Recompile all Lisp files which are newer than their .elc files.
133 # Note that this doesn't create .elc files. It only recompiles if an
134 # .elc is present.
135
136 recompile: doit
137 $(emacs) -f batch-byte-recompile-directory .
138
139 # Remove files for a bootstrap. Compiled Lisp files must be removed
140 # because otherwise `bootstrap-emacs' would not be built from sources.
141
142 bootstrap-clean:
143 -rm -f *.elc */*.elc
144
145 # Generate/update files for the bootstrap process.
146
147 bootstrap: compile-files autoloads custom-deps
148
149 # Makefile ends here.