| 1 | # -*- Makefile -*- for GNU Emacs on the Microsoft Windows API. |
| 2 | # Copyright (C) 2000-2014 Free Software Foundation, Inc. |
| 3 | |
| 4 | # This file is part of GNU Emacs. |
| 5 | |
| 6 | # GNU Emacs is free software: you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation, either version 3 of the License, or |
| 9 | # (at your option) any later version. |
| 10 | |
| 11 | # GNU Emacs is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | ALL = |
| 20 | |
| 21 | all: $(ALL) |
| 22 | |
| 23 | SQUOTE=' |
| 24 | # ' |
| 25 | |
| 26 | lisp = $(CURDIR) |
| 27 | srcdir = $(CURDIR)/.. |
| 28 | |
| 29 | # You can specify a different executable on the make command line, |
| 30 | # e.g. "make EMACS=../bin/emacs ...". |
| 31 | |
| 32 | EMACS = ../src/$(BLD)/emacs.exe |
| 33 | |
| 34 | # Command line flags for Emacs. |
| 35 | |
| 36 | EMACSOPT = -batch --no-site-file --no-site-lisp |
| 37 | |
| 38 | # Extra flags to pass to the byte compiler |
| 39 | BYTE_COMPILE_EXTRA_FLAGS = |
| 40 | # For example to not display the undefined function warnings you can use this: |
| 41 | # BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))' |
| 42 | # The example above is just for developers, it should not be used by default. |
| 43 | |
| 44 | # Set EMACSLOADPATH correctly (already defined in environment). |
| 45 | EMACSLOADPATH=$(lisp) |
| 46 | |
| 47 | # Use C locale |
| 48 | LC_ALL = C |
| 49 | |
| 50 | lisptagsfiles1 = $(lisp)/*.el |
| 51 | lisptagsfiles2 = $(lisp)/*/*.el |
| 52 | lisptagsfiles3 = $(lisp)/*/*/*.el |
| 53 | lisptagsfiles4 = $(lisp)/*/*/*/*.el |
| 54 | ETAGS = "../lib-src/$(BLD)/etags.exe" |
| 55 | ## $(DEST) is overridden by ../src/makefile.w32-in. |
| 56 | DEST=$(lisp) |
| 57 | |
| 58 | # Automatically generated autoload files, apart from lisp/loaddefs.el. |
| 59 | LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \ |
| 60 | $(lisp)/calendar/diary-loaddefs.el $(lisp)/calendar/hol-loaddefs.el \ |
| 61 | $(lisp)/mh-e/mh-loaddefs.el $(lisp)/net/tramp-loaddefs.el |
| 62 | |
| 63 | AUTOGENEL = $(lisp)/loaddefs.el $(LOADDEFS) $(lisp)/cus-load.el \ |
| 64 | $(lisp)/finder-inf.el $(lisp)/subdirs.el $(lisp)/eshell/esh-groups.el \ |
| 65 | $(lisp)/calc/calc-loaddefs.el $(lisp)/nxml/subdirs.el \ |
| 66 | $(lisp)/cedet/semantic/loaddefs.el $(lisp)/cedet/ede/loaddefs.el \ |
| 67 | $(lisp)/cedet/srecode/loaddefs.el |
| 68 | |
| 69 | # Value of max-lisp-eval-depth when compiling initially. |
| 70 | # During bootstrapping the byte-compiler is run interpreted when compiling |
| 71 | # itself, and uses more stack than usual. |
| 72 | # |
| 73 | BIG_STACK_DEPTH = 2200 |
| 74 | BIG_STACK_OPTS = --eval "(setq max-lisp-eval-depth $(BIG_STACK_DEPTH))" |
| 75 | |
| 76 | BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) $(BYTE_COMPILE_EXTRA_FLAGS) |
| 77 | |
| 78 | # Files to compile before others during a bootstrap. This is done to |
| 79 | # speed up the bootstrap process. |
| 80 | |
| 81 | COMPILE_FIRST = \ |
| 82 | $(lisp)/emacs-lisp/macroexp.el \ |
| 83 | $(lisp)/emacs-lisp/cconv.el \ |
| 84 | $(lisp)/emacs-lisp/byte-opt.el \ |
| 85 | $(lisp)/emacs-lisp/bytecomp.el \ |
| 86 | $(lisp)/emacs-lisp/autoload.el |
| 87 | |
| 88 | # The actual Emacs command run in the targets below. |
| 89 | # The quotes around $(EMACS) are here because the user could type |
| 90 | # it with forward slashes and without quotes, which will fail if |
| 91 | # the shell is cmd.exe. |
| 92 | |
| 93 | emacs = "$(EMACS)" $(EMACSOPT) |
| 94 | |
| 95 | # Have to define the list of subdirs manually when not using sh. |
| 96 | WINS_CEDET=\ |
| 97 | cedet \ |
| 98 | cedet/ede \ |
| 99 | cedet/semantic \ |
| 100 | cedet/srecode \ |
| 101 | cedet/semantic/analyze \ |
| 102 | cedet/semantic/bovine \ |
| 103 | cedet/semantic/decorate \ |
| 104 | cedet/semantic/symref \ |
| 105 | cedet/semantic/wisent |
| 106 | |
| 107 | # The list of subdirectories is subdivided into 4 more or less equal |
| 108 | # parts so that we could have 4-way parallelism while compiling Lisp |
| 109 | # files, which helps to slash bootstrap times. See the 'compile' |
| 110 | # target below. |
| 111 | WINS_BASIC1=\ |
| 112 | calc \ |
| 113 | calendar \ |
| 114 | emacs-lisp \ |
| 115 | erc \ |
| 116 | net \ |
| 117 | url |
| 118 | |
| 119 | WINS_BASIC2=\ |
| 120 | gnus \ |
| 121 | international \ |
| 122 | language \ |
| 123 | mail |
| 124 | |
| 125 | WINS_BASIC3=\ |
| 126 | emulation \ |
| 127 | mh-e \ |
| 128 | nxml \ |
| 129 | org \ |
| 130 | play \ |
| 131 | textmodes \ |
| 132 | vc |
| 133 | |
| 134 | WINS_BASIC4=\ |
| 135 | eshell \ |
| 136 | progmodes |
| 137 | |
| 138 | WINS_BASIC= $(WINS_BASIC1) $(WINS_BASIC2) $(WINS_BASIC3) $(WINS_BASIC4) |
| 139 | |
| 140 | # Directories with lisp files to compile, and to extract data from |
| 141 | # (customs, autoloads, etc.) |
| 142 | WINS_UPDATES=$(WINS_BASIC) \ |
| 143 | $(WINS_CEDET) |
| 144 | |
| 145 | # Directories to add to subdirs.el |
| 146 | WINS_SUBDIR=$(WINS_BASIC) \ |
| 147 | obsolete |
| 148 | |
| 149 | # All directories |
| 150 | WINS= $(WINS_UPDATES) \ |
| 151 | term \ |
| 152 | obsolete |
| 153 | |
| 154 | doit: |
| 155 | |
| 156 | cus-load.el-SH: |
| 157 | echo ";;; cus-load.el --- automatically extracted custom dependencies" > $@ |
| 158 | echo ";;" >> $@; echo ";;; Code:" >> $@ |
| 159 | echo "\f" >> $@ |
| 160 | echo ";; Local Variables:" >> $@ |
| 161 | echo ";; version-control: never" >> $@ |
| 162 | echo ";; no-byte-compile: t" >> $@ |
| 163 | echo ";; no-update-autoloads: t" >> $@ |
| 164 | echo ";; End:" >> $@ |
| 165 | |
| 166 | cus-load.el-CMD: |
| 167 | echo ;;; cus-load.el --- automatically extracted custom dependencies> $@ |
| 168 | echo ;;>> $@ |
| 169 | echo ;;; Code:>> $@ |
| 170 | echo.\f>> $@ |
| 171 | echo ;; Local Variables:>> $@ |
| 172 | echo ;; version-control: never>> $@ |
| 173 | echo ;; no-byte-compile: t>> $@ |
| 174 | echo ;; no-update-autoloads: t>> $@ |
| 175 | echo ;; End:>> $@ |
| 176 | |
| 177 | $(lisp)/cus-load.el: |
| 178 | $(MAKE) $(MFLAGS) cus-load.el-$(SHELLTYPE) |
| 179 | mv cus-load.el-$(SHELLTYPE) $@ |
| 180 | |
| 181 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
| 182 | # this can break with GNU Make 3.81 and later if sh.exe is used. |
| 183 | custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el $(lisp)/subdirs.el doit |
| 184 | @echo Directories: $(WINS_UPDATES) |
| 185 | -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) \ |
| 186 | -f custom-make-dependencies $(lisp) $(WINS_UPDATES) |
| 187 | |
| 188 | finder-data: $(lisp)/loaddefs.el $(lisp)/subdirs.el doit |
| 189 | @echo Directories: $(WINS_UPDATES) |
| 190 | $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_UPDATES) |
| 191 | |
| 192 | $(lisp)/loaddefs.el: |
| 193 | $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE) |
| 194 | cp loaddefs.el-$(SHELLTYPE) $@ |
| 195 | rm loaddefs.el-$(SHELLTYPE) |
| 196 | |
| 197 | loaddefs.el-SH: |
| 198 | echo ";;; loaddefs.el --- automatically extracted autoloads" > $@ |
| 199 | echo ";;" >> $@; echo ";;; Code:" >> $@ |
| 200 | echo "\f" >> $@ |
| 201 | echo ";; Local Variables:" >> $@ |
| 202 | echo ";; version-control: never" >> $@ |
| 203 | echo ";; no-byte-compile: t" >> $@ |
| 204 | echo ";; no-update-autoloads: t" >> $@ |
| 205 | echo ";; coding: utf-8" >> $@ |
| 206 | echo ";; End:" >> $@ |
| 207 | echo ";;; loaddefs.el ends here" >> $@ |
| 208 | |
| 209 | loaddefs.el-CMD: |
| 210 | echo ;;; loaddefs.el --- automatically extracted autoloads> $@ |
| 211 | echo ;;>> $@ |
| 212 | echo ;;; Code:>> $@ |
| 213 | echo.\f>> $@ |
| 214 | echo ;; Local Variables:>> $@ |
| 215 | echo ;; version-control: never>> $@ |
| 216 | echo ;; no-byte-compile: t>> $@ |
| 217 | echo ;; no-update-autoloads: t>> $@ |
| 218 | echo ;; coding: utf-8>> $@ |
| 219 | echo ;; End:>> $@ |
| 220 | echo ;;; loaddefs.el ends here>> $@ |
| 221 | |
| 222 | # Use . instead of $(lisp) because $(lisp) is an absolute file name, |
| 223 | # including a drive letter and any leading directories, so the generated |
| 224 | # loaddefs.el will mention file names that on other machine reference |
| 225 | # possibly non-existent directories. |
| 226 | # |
| 227 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
| 228 | # this can break with GNU Make 3.81 and later if sh.exe is used. |
| 229 | autoloads: $(lisp)/loaddefs.el $(LOADDEFS) doit |
| 230 | @echo Directories: . $(WINS_UPDATES) |
| 231 | $(emacs) -l autoload \ |
| 232 | --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ |
| 233 | -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" $(MAKE) . $(WINS_UPDATES) |
| 234 | |
| 235 | $(lisp)/subdirs.el: |
| 236 | $(MAKE) $(MFLAGS) update-subdirs |
| 237 | |
| 238 | # Need separate version for sh and native cmd.exe |
| 239 | update-subdirs: update-subdirs-$(SHELLTYPE) |
| 240 | |
| 241 | update-subdirs-CMD: doit |
| 242 | echo ;; In load-path, after this directory should come> $(lisp)/subdirs.el |
| 243 | echo ;; certain of its subdirectories. Here we specify them.>> $(lisp)/subdirs.el |
| 244 | echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el |
| 245 | @for %%d in ($(WINS_SUBDIR) cedet) do echo "%%d">> $(lisp)/subdirs.el |
| 246 | echo ))>> $(lisp)/subdirs.el |
| 247 | echo ;; Local Variables:>> $(lisp)/subdirs.el |
| 248 | echo ;; version-control: never>> $(lisp)/subdirs.el |
| 249 | echo ;; no-byte-compile: t>> $(lisp)/subdirs.el |
| 250 | echo ;; End:>> $(lisp)/subdirs.el |
| 251 | |
| 252 | update-subdirs-SH: doit |
| 253 | $(srcdir)/build-aux/update-subdirs $(lisp); \ |
| 254 | for file in $(WINS_SUBDIR); do \ |
| 255 | $(srcdir)/build-aux/update-subdirs $$file; \ |
| 256 | done; |
| 257 | |
| 258 | updates: $(lisp)/subdirs.el autoloads mh-autoloads finder-data custom-deps |
| 259 | |
| 260 | # This is useful after "bzr up". |
| 261 | bzr-update: recompile autoloads finder-data custom-deps |
| 262 | |
| 263 | # For backwards compatibility: |
| 264 | cvs-update: bzr-update |
| 265 | |
| 266 | # Update the AUTHORS file. |
| 267 | |
| 268 | update-authors: |
| 269 | $(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir) |
| 270 | |
| 271 | TAGS: TAGS-$(MAKETYPE) |
| 272 | |
| 273 | TAGS-LISP: TAGS-LISP-$(MAKETYPE) |
| 274 | |
| 275 | TAGS-nmake: |
| 276 | echo This target is not supported with NMake |
| 277 | exit -1 |
| 278 | |
| 279 | TAGS-LISP-nmake: |
| 280 | echo This target is not supported with NMake |
| 281 | exit -1 |
| 282 | |
| 283 | TAGS-gmake: TAGS-$(SHELLTYPE) |
| 284 | |
| 285 | TAGS-LISP-gmake: TAGS-LISP-$(SHELLTYPE) |
| 286 | |
| 287 | TAGS-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) |
| 288 | - $(DEL) TAGS |
| 289 | for dir in . $(WINS_UPDATES); do \ |
| 290 | $(ETAGS) -a $(lisp)/$$dir/*.el; \ |
| 291 | done |
| 292 | |
| 293 | TAGS-LISP-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) |
| 294 | - $(DEL) $(DEST)/TAGS-LISP |
| 295 | for dir in . $(WINS_UPDATES); do \ |
| 296 | $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/$$dir/*.el; \ |
| 297 | done |
| 298 | |
| 299 | TAGS-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) |
| 300 | - $(DEL) TAGS |
| 301 | for %%d in (. $(WINS_UPDATES)) do $(ETAGS) -a $(lisp)/%%d/*.el |
| 302 | |
| 303 | TAGS-LISP-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) |
| 304 | - $(DEL) $(DEST)/TAGS-LISP |
| 305 | for %%d in (. $(WINS_UPDATES)) do \ |
| 306 | $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/%%d/*.el |
| 307 | |
| 308 | .SUFFIXES: .elc .el |
| 309 | |
| 310 | .el.elc: |
| 311 | -$(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $< |
| 312 | |
| 313 | # Compile all Lisp files, but don't recompile those that are up to |
| 314 | # date. Some files don't actually get compiled because they set the |
| 315 | # local variable no-byte-compile. |
| 316 | |
| 317 | # All .elc files are made writable before compilation in case we |
| 318 | # checked out read-only (CVS option -r). Files MUST be compiled one by |
| 319 | # one. If we compile several files in a row we can't make sure that |
| 320 | # the compilation environment is clean. We also set the load-path of |
| 321 | # the Emacs used for compilation to the current directory and its |
| 322 | # subdirectories, to make sure require's and load's in the files being |
| 323 | # compiled find the right files. |
| 324 | |
| 325 | # Need separate version for sh and native cmd.exe |
| 326 | compile: $(lisp)/subdirs.el compile0-$(SHELLTYPE) compile1-$(SHELLTYPE) compile2-$(SHELLTYPE) compile3-$(SHELLTYPE) compile4-$(SHELLTYPE) doit |
| 327 | |
| 328 | compile0-CMD: autoloads |
| 329 | # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g |
| 330 | for %%f in ($(COMPILE_FIRST)) do \ |
| 331 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f |
| 332 | |
| 333 | compile1-CMD: autoloads compile0-CMD |
| 334 | for %%f in (. $(WINS_BASIC1)) do for %%g in (%%f/*.el) do \ |
| 335 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g |
| 336 | |
| 337 | compile2-CMD: autoloads compile0-CMD |
| 338 | for %%f in ($(WINS_BASIC2)) do for %%g in (%%f/*.el) do \ |
| 339 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g |
| 340 | |
| 341 | compile3-CMD: autoloads compile0-CMD |
| 342 | for %%f in ($(WINS_BASIC3)) do for %%g in (%%f/*.el) do \ |
| 343 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g |
| 344 | |
| 345 | compile4-CMD: autoloads compile0-CMD |
| 346 | for %%f in ($(WINS_BASIC4) $(WINS_CEDET) term obsolete) do for %%g in (%%f/*.el) do \ |
| 347 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g |
| 348 | |
| 349 | compile0-SH: autoloads |
| 350 | # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done |
| 351 | for el in $(COMPILE_FIRST); do \ |
| 352 | echo Compiling $$el; \ |
| 353 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
| 354 | done |
| 355 | |
| 356 | compile1-SH: autoloads compile0-SH |
| 357 | for dir in $(lisp) $(WINS_BASIC1); do \ |
| 358 | for el in $$dir/*.el; do \ |
| 359 | if test -f $$el; \ |
| 360 | then \ |
| 361 | echo Compiling $$el; \ |
| 362 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
| 363 | fi \ |
| 364 | done; \ |
| 365 | done |
| 366 | |
| 367 | compile2-SH: autoloads compile0-SH |
| 368 | for dir in $(WINS_BASIC2); do \ |
| 369 | for el in $$dir/*.el; do \ |
| 370 | if test -f $$el; \ |
| 371 | then \ |
| 372 | echo Compiling $$el; \ |
| 373 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
| 374 | fi \ |
| 375 | done; \ |
| 376 | done |
| 377 | |
| 378 | compile3-SH: autoloads compile0-SH |
| 379 | for dir in $(WINS_BASIC3); do \ |
| 380 | for el in $$dir/*.el; do \ |
| 381 | if test -f $$el; \ |
| 382 | then \ |
| 383 | echo Compiling $$el; \ |
| 384 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
| 385 | fi \ |
| 386 | done; \ |
| 387 | done |
| 388 | |
| 389 | compile4-SH: autoloads compile0-SH |
| 390 | for dir in $(WINS_BASIC4) $(WINS_CEDET) term obsolete; do \ |
| 391 | for el in $$dir/*.el; do \ |
| 392 | if test -f $$el; \ |
| 393 | then \ |
| 394 | echo Compiling $$el; \ |
| 395 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
| 396 | fi \ |
| 397 | done; \ |
| 398 | done |
| 399 | |
| 400 | # Compile all Lisp files. This is like `compile' but compiles files |
| 401 | # unconditionally. Some files don't actually get compiled because they |
| 402 | # set the local variable no-byte-compile. |
| 403 | |
| 404 | compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit |
| 405 | |
| 406 | compile-always-CMD: |
| 407 | # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g |
| 408 | for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f |
| 409 | for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f/%%g |
| 410 | |
| 411 | compile-always-SH: |
| 412 | # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done |
| 413 | for el in $(COMPILE_FIRST); do \ |
| 414 | echo Compiling $$el; \ |
| 415 | $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
| 416 | done |
| 417 | for dir in $(lisp) $(WINS); do \ |
| 418 | for el in $$dir/*.el; do \ |
| 419 | echo Compiling $$el; \ |
| 420 | $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
| 421 | done; \ |
| 422 | done |
| 423 | |
| 424 | compile-calc: compile-calc-$(SHELLTYPE) |
| 425 | |
| 426 | compile-calc-CMD: |
| 427 | for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f |
| 428 | |
| 429 | compile-calc-SH: |
| 430 | for el in $(lisp)/calc/*.el; do \ |
| 431 | echo Compiling $$el; \ |
| 432 | $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
| 433 | done |
| 434 | |
| 435 | # Backup compiled Lisp files in elc.tar.gz. If that file already |
| 436 | # exists, make a backup of it. |
| 437 | |
| 438 | backup-compiled-files: |
| 439 | -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~ |
| 440 | -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc |
| 441 | |
| 442 | # Compile Lisp files, but save old compiled files first. |
| 443 | |
| 444 | compile-after-backup: backup-compiled-files compile-always |
| 445 | |
| 446 | compile-first: $(lisp)/emacs-lisp/bytecomp.elc $(lisp)/emacs-lisp/byte-opt.elc \ |
| 447 | $(lisp)/emacs-lisp/autoload.elc $(lisp)/subdirs.el |
| 448 | |
| 449 | # Recompile all Lisp files which are newer than their .elc files. |
| 450 | # Note that this doesn't create .elc files. It only recompiles if an |
| 451 | # .elc is present. |
| 452 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
| 453 | # this can break with GNU Make 3.81 and later if sh.exe is used. |
| 454 | recompile: compile-first autoloads doit $(lisp)/progmodes/cc-mode.elc |
| 455 | $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp) |
| 456 | |
| 457 | $(lisp)/calendar/cal-loaddefs.el: $(lisp)/subdirs.el |
| 458 | "$(EMACS)" $(EMACSOPT) -l autoload \ |
| 459 | --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ |
| 460 | --eval "(setq find-file-suppress-same-file-warnings t)" \ |
| 461 | --eval "(setq make-backup-files nil)" \ |
| 462 | -f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \ |
| 463 | $(MAKE) ./calendar |
| 464 | |
| 465 | $(lisp)/calendar/diary-loaddefs.el: $(lisp)/subdirs.el |
| 466 | "$(EMACS)" $(EMACSOPT) -l autoload \ |
| 467 | --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ |
| 468 | --eval "(setq find-file-suppress-same-file-warnings t)" \ |
| 469 | --eval "(setq make-backup-files nil)" \ |
| 470 | -f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \ |
| 471 | $(MAKE) ./calendar |
| 472 | |
| 473 | $(lisp)/calendar/hol-loaddefs.el: $(lisp)/subdirs.el |
| 474 | "$(EMACS)" $(EMACSOPT) -l autoload \ |
| 475 | --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ |
| 476 | --eval "(setq find-file-suppress-same-file-warnings t)" \ |
| 477 | --eval "(setq make-backup-files nil)" \ |
| 478 | -f w32-batch-update-autoloads $(lisp)/calendar/hol-loaddefs.el \ |
| 479 | $(MAKE) ./calendar |
| 480 | |
| 481 | # Update MH-E internal autoloads. These are not to be confused with |
| 482 | # the autoloads for the MH-E entry points, which are already in |
| 483 | # loaddefs.el. |
| 484 | MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el \ |
| 485 | $(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-compat.el \ |
| 486 | $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-e.el \ |
| 487 | $(lisp)/mh-e/mh-folder.el $(lisp)/mh-e/mh-funcs.el \ |
| 488 | $(lisp)/mh-e/mh-gnus.el $(lisp)/mh-e/mh-identity.el \ |
| 489 | $(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-junk.el \ |
| 490 | $(lisp)/mh-e/mh-letter.el $(lisp)/mh-e/mh-limit.el \ |
| 491 | $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-print.el \ |
| 492 | $(lisp)/mh-e/mh-scan.el $(lisp)/mh-e/mh-search.el \ |
| 493 | $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-show.el \ |
| 494 | $(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-thread.el \ |
| 495 | $(lisp)/mh-e/mh-tool-bar.el $(lisp)/mh-e/mh-utils.el \ |
| 496 | $(lisp)/mh-e/mh-xface.el |
| 497 | |
| 498 | # See the commentary for autoloads above for why we use ./mh-e below |
| 499 | # instead of $(lisp)/mh-e. |
| 500 | mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el |
| 501 | $(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC) $(lisp)/subdirs.el |
| 502 | "$(EMACS)" $(EMACSOPT) \ |
| 503 | -l autoload \ |
| 504 | --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###mh-autoload$(DQUOTE))$(ARGQUOTE) \ |
| 505 | --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ |
| 506 | --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \ |
| 507 | -f w32-batch-update-autoloads \ |
| 508 | $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) $(MAKE) ./mh-e |
| 509 | |
| 510 | # Update TRAMP internal autoloads. Maybe we could move tramp*.el into |
| 511 | # an own subdirectory. OTOH, it does not hurt to keep them in |
| 512 | # lisp/net. |
| 513 | TRAMP_DIR = $(lisp)/net |
| 514 | TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-adb.el \ |
| 515 | $(TRAMP_DIR)/tramp-cache.el $(TRAMP_DIR)/tramp-cmds.el \ |
| 516 | $(TRAMP_DIR)/tramp-compat.el $(TRAMP_DIR)/tramp-ftp.el \ |
| 517 | $(TRAMP_DIR)/tramp-gvfs.el $(TRAMP_DIR)/tramp-gw.el \ |
| 518 | $(TRAMP_DIR)/tramp-sh.el $(TRAMP_DIR)/tramp-smb.el \ |
| 519 | $(TRAMP_DIR)/tramp-uu.el $(TRAMP_DIR)/trampver.el |
| 520 | |
| 521 | $(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC) $(lisp)/subdirs.el |
| 522 | "$(EMACS)" $(EMACSOPT) \ |
| 523 | -l autoload \ |
| 524 | --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###tramp-autoload$(DQUOTE))$(ARGQUOTE) \ |
| 525 | --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ |
| 526 | --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \ |
| 527 | -f w32-batch-update-autoloads \ |
| 528 | $(ARGQUOTE)$(TRAMP_DIR)/tramp-loaddefs.el$(ARGQUOTE) $(MAKE) ./net |
| 529 | |
| 530 | # Prepare a bootstrap in the lisp subdirectory. |
| 531 | # |
| 532 | # Build loaddefs.el to make sure it's up-to-date. If it's not, that |
| 533 | # might lead to errors during the bootstrap because something fails to |
| 534 | # autoload as expected. If there is no emacs binary, then we can't |
| 535 | # build autoloads yet. In that case we have to use ldefs-boot.el; |
| 536 | # bootstrap should always work with ldefs-boot.el. (Because |
| 537 | # loaddefs.el is an automatically generated file, we don't want to |
| 538 | # store it in the source repository). |
| 539 | # |
| 540 | # Remove compiled Lisp files so that bootstrap-emacs will be built from |
| 541 | # sources only. |
| 542 | |
| 543 | # Need separate version for sh and native cmd.exe |
| 544 | bootstrap-clean: |
| 545 | - $(DEL) $(lisp)/loaddefs.el |
| 546 | - $(DEL) $(lisp)/subdirs.el |
| 547 | $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE) |
| 548 | |
| 549 | bootstrap-clean-CMD: |
| 550 | # if exist "$(EMACS)" $(MAKE) $(MFLAGS) autoloads |
| 551 | -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g |
| 552 | |
| 553 | bootstrap-clean-SH: |
| 554 | # if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi |
| 555 | # -rm -f $(lisp)/*.elc $(lisp)/*/*.elc |
| 556 | -for dir in . $(WINS); do rm -f $$dir/*.elc $$dir/*/*.elc $$dir/*/*/*.elc; done |
| 557 | |
| 558 | # Generate/update files for the bootstrap process. |
| 559 | # When done, remove bootstrap-emacs from ../bin, so that |
| 560 | # it will not be mistaken for an installed binary. |
| 561 | |
| 562 | bootstrap: $(lisp)/subdirs.el compile finder-data custom-deps |
| 563 | - $(DEL) "$(EMACS)" |
| 564 | |
| 565 | # |
| 566 | # Assuming INSTALL_DIR is defined, copy the elisp files to it |
| 567 | # Windows 95 makes this harder than it should be. |
| 568 | # |
| 569 | install: |
| 570 | - mkdir "$(INSTALL_DIR)/lisp" |
| 571 | - $(DEL) ../$(DIRNAME)_same-dir.tst |
| 572 | - $(DEL) "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst" |
| 573 | echo SameDirTest > "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst" |
| 574 | #ifdef COPY_LISP_SOURCE |
| 575 | $(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) $(ENDIF) |
| 576 | #else |
| 577 | # $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF) |
| 578 | # $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF) |
| 579 | # $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF) |
| 580 | # $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF) |
| 581 | # $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF) |
| 582 | # $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF) |
| 583 | # $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) |
| 584 | # $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) |
| 585 | # $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF) |
| 586 | # $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) |
| 587 | # $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) |
| 588 | #endif |
| 589 | - $(DEL) ../$(DIRNAME)_same-dir.tst |
| 590 | - $(DEL) "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst" |
| 591 | |
| 592 | # Need to copy *.el files first, to avoid "source file is newer" annoyance |
| 593 | # since cp does not preserve time stamps |
| 594 | install-lisp-SH: |
| 595 | cp -f *.el "$(INSTALL_DIR)/lisp" |
| 596 | for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir "$(INSTALL_DIR)/lisp/$$dir"; done |
| 597 | for dir in $(WINS); do cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; done |
| 598 | for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done |
| 599 | |
| 600 | install-lisp-CMD: |
| 601 | cp -f *.el "$(INSTALL_DIR)/lisp" |
| 602 | for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir "$(INSTALL_DIR)/lisp/%%f" |
| 603 | for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f" |
| 604 | for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f" |
| 605 | |
| 606 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
| 607 | # this can break with GNU Make 3.81 and later if sh.exe is used. |
| 608 | check-declare: |
| 609 | $(emacs) -l $(lisp)/emacs-lisp/check-declare --eval $(ARGQUOTE)(check-declare-directory $(DQUOTE)$(lisp)$(DQUOTE))$(ARGQUOTE) |
| 610 | |
| 611 | # |
| 612 | # Maintenance |
| 613 | # |
| 614 | # We used to delete *~ here, but that might inadvertently remove |
| 615 | # precious files if it happens to match their short 8+3 aliases. |
| 616 | clean: |
| 617 | - $(DEL) *.el~ |
| 618 | - $(DEL) calc/calc-loaddefs.el~ |
| 619 | - $(DEL) eshell/esh-groups.el~ |
| 620 | |
| 621 | distclean: clean |
| 622 | - $(DEL) $(lisp)/Makefile |
| 623 | |
| 624 | maintainer-clean: bootstrap-clean distclean |
| 625 | - $(DEL) $(AUTOGENEL) |
| 626 | |
| 627 | # Dependencies |
| 628 | |
| 629 | # CC Mode uses a compile time macro system which causes a compile time |
| 630 | # dependency in cc-*.elc files on the macros in other cc-*.el and the |
| 631 | # version string in cc-defs.el. |
| 632 | $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-awk.elc\ |
| 633 | $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-compat.elc\ |
| 634 | $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\ |
| 635 | $(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\ |
| 636 | $(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\ |
| 637 | $(lisp)/progmodes/cc-vars.elc: \ |
| 638 | $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc |
| 639 | |
| 640 | $(lisp)/progmodes/cc-align.elc: \ |
| 641 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc |
| 642 | |
| 643 | $(lisp)/progmodes/cc-cmds.elc: \ |
| 644 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc |
| 645 | |
| 646 | $(lisp)/progmodes/cc-compat.elc: \ |
| 647 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \ |
| 648 | $(lisp)/progmodes/cc-engine.elc |
| 649 | |
| 650 | $(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc \ |
| 651 | $(lisp)/emacs-lisp/cl.elc $(lisp)/emacs-lisp/regexp-opt.elc |
| 652 | |
| 653 | $(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \ |
| 654 | $(lisp)/progmodes/cc-vars.elc |
| 655 | |
| 656 | $(lisp)/progmodes/cc-fonts.elc: $(lisp)/progmodes/cc-langs.elc \ |
| 657 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \ |
| 658 | $(lisp)/font-lock.elc |
| 659 | |
| 660 | $(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc \ |
| 661 | $(lisp)/emacs-lisp/cl.elc |
| 662 | |
| 663 | $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \ |
| 664 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \ |
| 665 | $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-cmds.elc \ |
| 666 | $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc \ |
| 667 | $(lisp)/subdirs.el |
| 668 | |
| 669 | $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \ |
| 670 | $(lisp)/progmodes/cc-align.elc |
| 671 | |
| 672 | $(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc |
| 673 | |
| 674 | # MH-E dependencies, mainly to prevent failures with parallel |
| 675 | # compilation, due to race conditions between writing a given FOO.elc |
| 676 | # file and another file being compiled that says "(require FOO)", |
| 677 | # which causes Emacs to try to read FOO.elc. |
| 678 | MH_E_DIR = ./mh-e |
| 679 | $(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc\ |
| 680 | $(MH_E_DIR)/mh-funcs.elc $(MH_E_DIR)/mh-identity.elc $(MH_E_DIR)/mh-inc.elc\ |
| 681 | $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-limit.elc\ |
| 682 | $(MH_E_DIR)/mh-mime.elc $(MH_E_DIR)/mh-print.elc $(MH_E_DIR)/mh-scan.elc\ |
| 683 | $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\ |
| 684 | $(MH_E_DIR)/mh-speed.elc $(MH_E_DIR)/mh-thread.elc $(MH_E_DIR)/mh-tool-bar.elc\ |
| 685 | $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\ |
| 686 | $(MH_E_DIR)/mh-e.elc |
| 687 | |
| 688 | $(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-e.elc $(MH_E_DIR)/mh-folder.elc\ |
| 689 | $(MH_E_DIR)/mh-inc.elc $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc\ |
| 690 | $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-speed.elc\ |
| 691 | $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\ |
| 692 | $(lisp)/emacs-lisp/cl.elc |
| 693 | |
| 694 | $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-funcs.elc\ |
| 695 | $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc $(MH_E_DIR)/mh-print.elc\ |
| 696 | $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-thread.elc:\ |
| 697 | $(MH_E_DIR)/mh-scan.elc |
| 698 | |
| 699 | $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-mime.elc\ |
| 700 | $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-speed.elc:\ |
| 701 | $(lisp)/gnus/gnus-util.elc |
| 702 | |
| 703 | $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-search.elc:\ |
| 704 | $(lisp)/progmodes/which-func.elc |
| 705 | |
| 706 | $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\ |
| 707 | $(MH_E_DIR)/mh-utils.elc:\ |
| 708 | $(lisp)/font-lock.elc |
| 709 | |
| 710 | $(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-show.elc: $(lisp)/net/goto-addr.elc |
| 711 | |
| 712 | $(MH_E_DIR)/mh-comp.elc: $(lisp)/mail/sendmail.elc |
| 713 | |
| 714 | $(MH_E_DIR)/mh-e.elc: $(MH_E_DIR)/mh-buffers.elc $(lisp)/gnus/gnus.elc \ |
| 715 | $(lisp)/cus-face.elc |
| 716 | |
| 717 | $(MH_E_DIR)/mh-letter.elc: $(lisp)/gnus/mailcap.elc $(lisp)/gnus/mm-decode.elc \ |
| 718 | $(lisp)/gnus/mm-view.elc $(lisp)/gnus/mml.elc $(lisp)/gnus/message.elc |
| 719 | |
| 720 | $(MH_E_DIR)/mh-print.elc: $(lisp)/ps-print.elc |
| 721 | |
| 722 | $(MH_E_DIR)/mh-search.elc: $(lisp)/imenu.elc |
| 723 | |
| 724 | $(MH_E_DIR)/mh-show.elc: $(lisp)/gnus/gnus-cite.elc |
| 725 | |
| 726 | $(MH_E_DIR)/mh-speed.elc: $(lisp)/speedbar.elc $(lisp)/emacs-lisp/timer.elc |
| 727 | |
| 728 | $(MH_E_DIR)/mh-tool-bar.elc: $(lisp)/tool-bar.elc |