Commit | Line | Data |
---|---|---|
c7685c8d PA |
1 | # |
2 | # Maintenance productions for the Lisp directory | |
3 | # | |
7ec641b8 GM |
4 | |
5 | # You can specify a different executable on the make command line, | |
6 | # e.g. "make EMACS=../src/emacs ...". | |
7 | ||
e3384ae7 | 8 | EMACS = ../src/emacs |
7ec641b8 GM |
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 | ||
c7685c8d | 15 | SOURCES = *.el COPYING Makefile |
7ab2c289 RS |
16 | lisptagsfiles1 = [a-zA-Z]*.el |
17 | lisptagsfiles2 = [a-zA-Z]*/[a-zA-Z]*.el | |
3975988b | 18 | ETAGS = ../lib-src/etags |
c7685c8d | 19 | |
7ec641b8 GM |
20 | # Files which should not be compiled. All file names must be relative |
21 | # to the `lisp' directory. | |
cc953d27 SM |
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. | |
a9b67cf4 | 24 | |
7ec641b8 GM |
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 term-nasty.el version.el \ | |
cc953d27 | 32 | generic-x.el international/latin-8.el international/latin-9.el \ |
4678c844 | 33 | emacs-lisp/cl-specs.el finder-inf.el term/internal.el |
7ec641b8 GM |
34 | |
35 | # The actual Emacs command run in the targets below. | |
36 | ||
37 | emacs = $(EMACS) $(EMACSOPT) | |
38 | ||
80c382e5 | 39 | # Common command to find subdirectories |
7ec641b8 | 40 | |
3f4c23f9 | 41 | setwins=subdirs=`find $$wd -type d -print`; \ |
f83a4f35 | 42 | for file in $$subdirs; do \ |
80c382e5 | 43 | case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \ |
f83a4f35 RS |
44 | *) wins="$$wins $$file" ;; \ |
45 | esac; \ | |
80c382e5 SM |
46 | done |
47 | ||
48 | doit: | |
49 | ||
cc953d27 SM |
50 | cus-load.el: |
51 | touch $@ | |
52 | custom-deps: cus-load.el doit | |
3f4c23f9 | 53 | wd=.; $(setwins); \ |
4746aeeb | 54 | echo Directories: $$wins; \ |
7ec641b8 | 55 | $(emacs) -l cus-dep -f custom-make-dependencies $$wins |
009368b9 | 56 | |
cc953d27 SM |
57 | finder-inf.el: |
58 | echo "(provide 'finder-inf)" >> $@ | |
59 | finder-data: finder-inf.el doit | |
3f4c23f9 | 60 | wd=.; $(setwins); \ |
4746aeeb | 61 | echo Directories: $$wins; \ |
7ec641b8 | 62 | $(emacs) -l finder -f finder-compile-keywords-make-dist $$wins |
009368b9 | 63 | |
cc953d27 SM |
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 | |
3f4c23f9 | 75 | wd=.; $(setwins); \ |
4746aeeb | 76 | echo Directories: $$wins; \ |
cc953d27 | 77 | $(emacs) --eval '(setq generated-autoload-file "'`pwd`'/loaddefs.el")' -f batch-update-autoloads $$wins |
f83a4f35 | 78 | |
cc953d27 SM |
79 | subdirs.el: |
80 | $(MAKE) $(MFLAGS) update-subdirs | |
98b918b6 | 81 | update-subdirs: doit |
3f4c23f9 | 82 | wd=.; $(setwins); \ |
98b918b6 RS |
83 | for file in $$wins; do \ |
84 | ../update-subdirs $$file; \ | |
85 | done; | |
86 | ||
cc953d27 | 87 | updates: update-subdirs autoloads finder-data custom-deps |
c48c3772 | 88 | |
7ab2c289 RS |
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) | |
7ec641b8 | 95 | |
cc953d27 SM |
96 | .el.elc: subdirs.el |
97 | -EMACSLOADPATH=`pwd` $(emacs) -f batch-byte-compile $< | |
98 | ||
99 | $(DONTCOMPILE:.el=.elc): | |
100 | -rm -f $@ | |
101 | ||
7ec641b8 GM |
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). | |
57f707e7 GM |
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. | |
7ec641b8 | 111 | |
a9b67cf4 | 112 | compile-files: subdirs.el doit |
cc953d27 SM |
113 | find . -name "*.elc" -print | xargs chmod +w; \ |
114 | wd=.; $(setwins); \ | |
e3384ae7 | 115 | elpat=`echo $$wins | tr ' ' '\012\012' | \ |
cc953d27 | 116 | sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \ |
e3384ae7 | 117 | els=`echo $$elpat $(DONTCOMPILE) | tr ' ' '\012\012' | sort | uniq -u`; \ |
cc953d27 SM |
118 | echo $$els; \ |
119 | EMACSLOADPATH=`pwd` $(emacs) -f batch-byte-compile $$els | |
96ff0f09 | 120 | |
a9b67cf4 GM |
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 | ||
7ec641b8 GM |
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 | ||
a9b67cf4 GM |
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 | ||
7ec641b8 | 149 | # Makefile ends here. |