Mercurial > emacs
comparison lisp/Makefile.in @ 107448:c34ce344379e
Use more relative file and directory names in `lisp' make rules.
* lisp/Makefile.in (EMACS): Arrange for it to work when we chdir.
(setwins, setwins_almost, setwins_for_subdirs):
Don't `cd'; output relative names.
(all, compile, compile-always, compile-last): Set emacswd.
(custom-deps, finder-data, autoloads, update-subdirs, compile-last):
Just cd to the lisp source dir so we can use relative file names.
* src/Makefile.in (bootstrap_exe): Use an absolute name.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sat, 20 Mar 2010 17:46:31 -0400 |
parents | 0a2bb00a71bd |
children | d8347f5058b6 |
comparison
equal
deleted
inserted
replaced
107447:9d443ad80849 | 107448:c34ce344379e |
---|---|
24 srcdir=@srcdir@/.. | 24 srcdir=@srcdir@/.. |
25 | 25 |
26 # You can specify a different executable on the make command line, | 26 # You can specify a different executable on the make command line, |
27 # e.g. "make EMACS=../src/emacs ...". | 27 # e.g. "make EMACS=../src/emacs ...". |
28 | 28 |
29 EMACS = ../src/emacs | 29 # We sometimes change directory before running Emacs (typically when |
30 # building out-of-tree, we chdir to the source directory), so we need | |
31 # to use an aboluste file name. But there's no standard way | |
32 # in a makefile to get the pwd, so we simply rely on a shell | |
33 # "$emacswd" var that needs to be set wherever we use $(EMACS) (or | |
34 # $(emacs)). Yet, it is setup in such a way that if you forget to set | |
35 # $emacswd, it will still work, so long as you did not | |
36 # change directory. | |
37 EMACS = $$emacswd../src/emacs | |
30 | 38 |
31 # Command line flags for Emacs. This must include --multibyte, | 39 # Command line flags for Emacs. This must include --multibyte, |
32 # otherwise some files will not compile. | 40 # otherwise some files will not compile. |
33 | 41 |
34 EMACSOPT = -batch --no-site-file --multibyte | 42 EMACSOPT = -batch --no-site-file --multibyte |
78 | 86 |
79 emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT) | 87 emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT) |
80 | 88 |
81 # Common command to find subdirectories | 89 # Common command to find subdirectories |
82 | 90 |
83 setwins=subdirs=`(cd $$wd; find . -type d -print)`; \ | 91 setwins=subdirs=`(find . -type d -print)`; \ |
84 for file in $$subdirs; do \ | 92 for file in $$subdirs; do \ |
85 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* ) ;; \ | 93 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* ) ;; \ |
86 *) wins="$$wins $$wd/$$file" ;; \ | 94 *) wins="$$wins $$file" ;; \ |
87 esac; \ | 95 esac; \ |
88 done | 96 done |
89 | 97 |
90 # Find all subdirectories except `obsolete' and `term'. | 98 # Find all subdirectories except `obsolete' and `term'. |
91 | 99 |
92 setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \ | 100 setwins_almost=subdirs=`(find . -type d -print)`; \ |
93 for file in $$subdirs; do \ | 101 for file in $$subdirs; do \ |
94 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \ | 102 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \ |
95 *) wins="$$wins $$wd/$$file" ;; \ | 103 *) wins="$$wins $$file" ;; \ |
96 esac; \ | 104 esac; \ |
97 done | 105 done |
98 | 106 |
99 # Find all subdirectories in which we might want to create subdirs.el | 107 # Find all subdirectories in which we might want to create subdirs.el |
100 | 108 |
101 setwins_for_subdirs=subdirs=`(cd $$wd; find . -type d -print)`; \ | 109 setwins_for_subdirs=subdirs=`(find . -type d -print)`; \ |
102 for file in $$subdirs; do \ | 110 for file in $$subdirs; do \ |
103 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */cedet* ) ;; \ | 111 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */cedet* ) ;; \ |
104 *) wins="$$wins $$wd/$$file" ;; \ | 112 *) wins="$$wins $$file" ;; \ |
105 esac; \ | 113 esac; \ |
106 done | 114 done |
107 | 115 |
108 # `compile-main' tends to be slower than `recompile' but can be parallelized | 116 # `compile-main' tends to be slower than `recompile' but can be parallelized |
109 # with "make -j" and results in more deterministic compilation warnings. | 117 # with "make -j" and results in more deterministic compilation warnings. |
110 # cus-load and finder-inf are not explicitly requested by anything, so | 118 # cus-load and finder-inf are not explicitly requested by anything, so |
111 # we add them here to make sure they get built. | 119 # we add them here to make sure they get built. |
112 all: compile-main $(lisp)/cus-load.el $(lisp)/finder-inf.el | 120 all: compile-main $(lisp)/cus-load.el $(lisp)/finder-inf.el |
113 @: Let us check that we byte-compiled all the files. | 121 @: Let us check that we byte-compiled all the files. |
114 $(MAKE) $(MFLAGS) compile-last EMACS=$(EMACS) | 122 emacswd=`pwd`/; $(MAKE) $(MFLAGS) compile-last EMACS=$(EMACS) |
115 | 123 |
116 doit: | 124 doit: |
117 | 125 |
118 # custom-deps and finder-data both used to scan _all_ the *.el files. | 126 # custom-deps and finder-data both used to scan _all_ the *.el files. |
119 # This could lead to problems in parallel builds if automatically | 127 # This could lead to problems in parallel builds if automatically |
130 # since they will never contain any useful information | 138 # since they will never contain any useful information |
131 # (see finder-no-scan-regexp and custom-dependencies-no-scan-regexp). | 139 # (see finder-no-scan-regexp and custom-dependencies-no-scan-regexp). |
132 $(lisp)/cus-load.el: | 140 $(lisp)/cus-load.el: |
133 $(MAKE) $(MFLAGS) custom-deps | 141 $(MAKE) $(MFLAGS) custom-deps |
134 custom-deps: doit | 142 custom-deps: doit |
135 wd=$(lisp); $(setwins_almost); \ | 143 emacswd=`pwd`/; cd $(lisp); $(setwins_almost); \ |
136 echo Directories: $$wins; \ | 144 echo Directories: $$wins; \ |
137 $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins | 145 $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins |
138 | 146 |
139 $(lisp)/finder-inf.el: | 147 $(lisp)/finder-inf.el: |
140 $(MAKE) $(MFLAGS) finder-data | 148 $(MAKE) $(MFLAGS) finder-data |
141 finder-data: doit | 149 finder-data: doit |
142 wd=$(lisp); $(setwins_almost); \ | 150 emacswd=`pwd`/; cd $(lisp); $(setwins_almost); \ |
143 echo Directories: $$wins; \ | 151 echo Directories: $$wins; \ |
144 $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins | 152 $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins |
145 | 153 |
146 # The chmod +w is to handle env var CVSREAD=1. Files named | 154 # The chmod +w is to handle env var CVSREAD=1. Files named |
147 # are identified by being the value of `generated-autoload-file'. | 155 # are identified by being the value of `generated-autoload-file'. |
148 autoloads: $(LOADDEFS) doit | 156 autoloads: $(LOADDEFS) doit |
149 chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \ | 157 chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \ |
150 $(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \ | 158 $(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \ |
151 $(lisp)/dired.el $(lisp)/ibuffer.el | 159 $(lisp)/dired.el $(lisp)/ibuffer.el |
152 wd=$(lisp); $(setwins_almost); \ | 160 emacswd=`pwd`/; cd $(lisp); $(setwins_almost); \ |
153 echo Directories: $$wins; \ | 161 echo Directories: $$wins; \ |
154 $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins | 162 $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins |
155 | 163 |
156 # This is required by the bootstrap-emacs target in ../src/Makefile, so | 164 # This is required by the bootstrap-emacs target in ../src/Makefile, so |
157 # we know that if we have an emacs executable, we also have a subdirs.el. | 165 # we know that if we have an emacs executable, we also have a subdirs.el. |
158 $(lisp)/subdirs.el: | 166 $(lisp)/subdirs.el: |
159 $(MAKE) $(MFLAGS) update-subdirs | 167 $(MAKE) $(MFLAGS) update-subdirs |
160 update-subdirs: doit | 168 update-subdirs: doit |
161 wd=$(lisp); $(setwins_for_subdirs); \ | 169 cd $(lisp); $(setwins_for_subdirs); \ |
162 for file in $$wins; do \ | 170 for file in $$wins; do \ |
163 $(srcdir)/update-subdirs $$file; \ | 171 $(srcdir)/update-subdirs $$file; \ |
164 done; | 172 done; |
165 | 173 |
166 updates: update-subdirs autoloads finder-data custom-deps | 174 updates: update-subdirs autoloads finder-data custom-deps |
1503 # local variable no-byte-compile. | 1511 # local variable no-byte-compile. |
1504 # Calling make recursively because suffix rule cannot have prerequisites. | 1512 # Calling make recursively because suffix rule cannot have prerequisites. |
1505 # Explicitly pass EMACS (sometimes ../src/bootstrap-emacs) to those | 1513 # Explicitly pass EMACS (sometimes ../src/bootstrap-emacs) to those |
1506 # sub-makes that run rules that use it, for the sake of some non-GNU makes. | 1514 # sub-makes that run rules that use it, for the sake of some non-GNU makes. |
1507 compile: $(LOADDEFS) autoloads compile-first | 1515 compile: $(LOADDEFS) autoloads compile-first |
1508 $(MAKE) $(MFLAGS) compile-main EMACS=$(EMACS) | 1516 emacswd=`pwd`/; \ |
1517 $(MAKE) $(MFLAGS) compile-main EMACS=$(EMACS); \ | |
1509 $(MAKE) $(MFLAGS) compile-last EMACS=$(EMACS) | 1518 $(MAKE) $(MFLAGS) compile-last EMACS=$(EMACS) |
1510 | 1519 |
1511 ## Doing this causes make install to dump another emacs. | 1520 ## Doing this causes make install to dump another emacs. |
1512 # $(MAKE) $(MFLAGS) update-elclist | 1521 # $(MAKE) $(MFLAGS) update-elclist |
1513 | 1522 |
1514 # Compile all Lisp files. This is like `compile' but compiles files | 1523 # Compile all Lisp files. This is like `compile' but compiles files |
1515 # unconditionally. Some files don't actually get compiled because they | 1524 # unconditionally. Some files don't actually get compiled because they |
1516 # set the local variable no-byte-compile. | 1525 # set the local variable no-byte-compile. |
1517 compile-always: doit | 1526 compile-always: doit |
1518 cd $(lisp); rm -f *.elc */*.elc */*/*.elc */*/*/*.elc | 1527 cd $(lisp); rm -f *.elc */*.elc */*/*.elc */*/*/*.elc |
1528 emacswd=`pwd`/; \ | |
1519 $(MAKE) $(MFLAGS) compile EMACS=$(EMACS) | 1529 $(MAKE) $(MFLAGS) compile EMACS=$(EMACS) |
1520 | 1530 |
1521 ## In case any files are missing from ELCFILES. | 1531 ## In case any files are missing from ELCFILES. |
1522 compile-last: | 1532 compile-last: |
1523 @wd=$(lisp); $(setwins); \ | 1533 @emacswd=`pwd`/; cd $(lisp); $(setwins); \ |
1524 els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ | 1534 els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ |
1525 for el in $$els; do \ | 1535 for el in $$els; do \ |
1526 test -f $$el || continue; \ | 1536 test -f $$el || continue; \ |
1527 test -f $${el}c && continue; \ | 1537 test -f $${el}c && continue; \ |
1528 GREP_OPTIONS= grep 'no-byte-compile: t' $$el > /dev/null && continue; \ | 1538 GREP_OPTIONS= grep 'no-byte-compile: t' $$el > /dev/null && continue; \ |