Mercurial > emacs
comparison lisp/Makefile @ 25936:3223912646d8
(compile): Compile files one by one. Set load-path to
current directory and subdirectories when compiling.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 08 Oct 1999 21:51:14 +0000 |
parents | 663097d932a4 |
children | aff7b4b37817 |
comparison
equal
deleted
inserted
replaced
25935:d257e2f126f2 | 25936:3223912646d8 |
---|---|
113 $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) | 113 $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) |
114 | 114 |
115 # Compile all Lisp files, except those from DONTCOMPILE. This | 115 # Compile all Lisp files, except those from DONTCOMPILE. This |
116 # compiles files unconditionally. All .elc files are made writable | 116 # compiles files unconditionally. All .elc files are made writable |
117 # before compilation in case we checked out read-only (CVS option -r). | 117 # before compilation in case we checked out read-only (CVS option -r). |
118 # Files must be compiled one by one, otherwise apparently | |
119 # eval-when-compile's in some Lisp files make problems in files being | |
120 # compiled later. We also set the load-path of the Emacs used for | |
121 # compilation to the current directory and its subdirectories, to | |
122 # make sure require's and load's in the files being compiled find | |
123 # the right files. | |
118 | 124 |
119 compile: doit | 125 compile: doit |
126 wd=`pwd`; \ | |
127 find $$wd -name "*.elc" | xargs chmod +w; \ | |
128 subdirs=`find $$wd -type d -print`; \ | |
129 for dir in $$subdirs; do \ | |
130 case $$dir in \ | |
131 */Old | */RCS | */CVS | */=* ) ;; \ | |
132 *) loadpath="$$loadpath \"$$dir\"" ;; \ | |
133 esac; \ | |
134 done; \ | |
135 loadpath="(setq load-path '($$loadpath))"; \ | |
120 dont_compile=`echo $(DONTCOMPILE)`; \ | 136 dont_compile=`echo $(DONTCOMPILE)`; \ |
121 for el in $(EL); do \ | 137 for el in $(EL); do \ |
122 compile_it=y; \ | 138 compile_it=y; \ |
123 for dont in $$dont_compile; do \ | 139 for dont in $$dont_compile; do \ |
124 if test $$el = $$dont; then \ | 140 if test $$el = $$dont; then \ |
125 compile_it=n; \ | 141 compile_it=n; \ |
126 fi; \ | 142 fi; \ |
127 done; \ | 143 done; \ |
128 if test $$compile_it = y; then \ | 144 if test $$compile_it = y; then \ |
129 els="$$el $$els"; \ | 145 $(emacs) --eval "$$loadpath" -f batch-byte-compile $$el; \ |
130 echo "Compile $$el"; \ | |
131 else \ | 146 else \ |
132 echo "Don't compile $$el"; \ | 147 echo "Don't compile $$el"; \ |
133 fi; \ | 148 fi; \ |
134 done; \ | 149 done |
135 chmod +w $$els; \ | |
136 $(emacs) -f batch-byte-compile $$els; | |
137 | 150 |
138 # Recompile all Lisp files which are newer than their .elc files. | 151 # Recompile all Lisp files which are newer than their .elc files. |
139 # Note that this doesn't create .elc files. It only recompiles if an | 152 # Note that this doesn't create .elc files. It only recompiles if an |
140 # .elc is present. | 153 # .elc is present. |
141 | 154 |