Commit | Line | Data |
---|---|---|
f7dbcf3c JB |
1 | # DIST: This is the distribution Makefile for Emacs. configure can |
2 | # DIST: make most of the changes to this file you might want, so try | |
3 | # DIST: that first. | |
4 | ||
5 | # add -DUSG for SysV movemail and timer | |
6 | # For Xenix, add the following for movemail: | |
7 | # LOADLIBES= -lx | |
8 | # For Mips, the following is needed for who knows what. | |
9 | # LOADLIBES = -lmld /usr/bsd43/usr/lib/libc.a | |
10 | ||
11 | # Avoid trouble on systems where the `SHELL' variable might be | |
12 | # inherited from the environment. | |
13 | SHELL = /bin/sh | |
14 | ||
b93f2493 | 15 | # ==================== Things `configure' will edit ==================== |
c71beb75 | 16 | |
b93f2493 BF |
17 | CC=@CC@ |
18 | CFLAGS=@CFLAGS@ | |
19 | ALLOCA=@ALLOCA@ | |
20 | C_SWITCH_SYSTEM=@c_switch_system@ | |
21 | LOADLIBES=@libsrc_libs@ | |
22 | YACC=@YACC@ | |
23 | version=@version@ | |
24 | configname=@configuration@ | |
c71beb75 JB |
25 | |
26 | # ==================== Where To Install Things ==================== | |
27 | ||
28 | # The default location for installation. Everything is placed in | |
29 | # subdirectories of this directory. The default values for many of | |
30 | # the variables below are expressed in terms of this one, so you may | |
b93f2493 | 31 | # not need to change them. This is set with the --prefix option to |
63be7fb7 | 32 | # `../configure'. |
b93f2493 | 33 | prefix=@prefix@ |
c71beb75 | 34 | |
b93f2493 BF |
35 | # Like `prefix', but used for architecture-specific files. This is |
36 | # set with the --exec-prefix option to `../configure'. | |
37 | exec_prefix=@exec_prefix@ | |
c71beb75 JB |
38 | |
39 | # Where to install Emacs and other binaries that people will want to | |
b93f2493 BF |
40 | # run directly (like etags). This is set with the --bindir option |
41 | # to `../configure'. | |
42 | bindir=@bindir@ | |
c71beb75 JB |
43 | |
44 | # Where to install and expect executable files to be run by Emacs | |
45 | # rather than directly by users, and other architecture-dependent | |
b93f2493 BF |
46 | # data. ${archlibdir} is usually below this. This is set with the |
47 | # --libdir option to `../configure'. | |
48 | libdir=@libdir@ | |
c71beb75 | 49 | |
b93f2493 BF |
50 | # Where to find the source code. This is set by the configure |
51 | # script's `--srcdir' option. However, the value of ${srcdir} in | |
52 | # this makefile is not identical to what was specified with --srcdir, | |
53 | # since the variable here has `/lib-src' added at the end. | |
54 | srcdir=@srcdir@ | |
55 | VPATH=@srcdir@ | |
c71beb75 JB |
56 | |
57 | # ==================== Emacs-specific directories ==================== | |
58 | ||
59 | # These variables hold the values Emacs will actually use. They are | |
60 | # based on the values of the standard Make variables above. | |
61 | ||
62 | # Where to put executables to be run by Emacs rather than the user. | |
63 | # This path usually includes the Emacs version and configuration name, | |
64 | # so that multiple configurations for multiple versions of Emacs may | |
b93f2493 BF |
65 | # be installed at once. This can be set with the --archlibdir option |
66 | # to `../configure'. | |
67 | archlibdir=@archlibdir@ | |
41f86d5a | 68 | |
c71beb75 JB |
69 | # ==================== Utility Programs for the Build ==================== |
70 | ||
63be7fb7 | 71 | # ../configure figures out the correct values for these. |
b93f2493 | 72 | INSTALL = @INSTALL@ |
b93f2493 BF |
73 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
74 | INSTALL_DATA = @INSTALL_DATA@ | |
c71beb75 JB |
75 | |
76 | # ============================= Targets ============================== | |
f7dbcf3c | 77 | |
b7cceaf1 | 78 | # Things that a user might actually run, which should be installed in bindir. |
0d73e8e3 JB |
79 | INSTALLABLES = etags ctags emacsclient b2m |
80 | INSTALLABLE_SCRIPTS = rcs-checkin | |
f7dbcf3c | 81 | |
b7cceaf1 JB |
82 | # Things that Emacs runs internally, or during the build process, |
83 | # which should not be installed in bindir. | |
c71beb75 | 84 | UTILITIES= test-distrib make-path wakeup make-docfile digest-doc sorted-doc \ |
b7cceaf1 | 85 | movemail cvtmail fakemail yow env emacsserver hexl timer |
f7dbcf3c | 86 | |
b7cceaf1 JB |
87 | # Like UTILITIES, but they're not system-dependent, and should not be |
88 | # deleted by the distclean target. | |
89 | SCRIPTS= rcs2log vcdiff | |
90 | ||
0d73e8e3 | 91 | EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} |
f7dbcf3c | 92 | |
41f86d5a ER |
93 | SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \ |
94 | makedoc.com *.[chy] rcs2log vcdiff | |
95 | ||
c71beb75 JB |
96 | ### We need to #define emacs to get the right versions of some files. |
97 | ### Some other files - those shared with other GNU utilities - need | |
98 | ### HAVE_CONFIG_H #defined before they know they can take advantage of | |
99 | ### the information in ../src/config.h. | |
c93341d5 | 100 | ALL_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \ |
3e883207 RS |
101 | -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS} |
102 | LINK_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \ | |
103 | -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS} | |
5293b432 | 104 | CPP_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \ |
b2d7a9c7 | 105 | -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS} |
5293b432 RS |
106 | # This is the default compilation command. |
107 | # But we should never rely on it, because some make version | |
108 | # failed to find it for getopt.o. Using an explicit command made it work. | |
c38a040d | 109 | .c.o: |
5293b432 | 110 | ${CC} -c ${CPP_CFLAGS} $< |
c71beb75 | 111 | |
4eda59a9 | 112 | all: ${UTILITIES} ${INSTALLABLES} |
c71beb75 JB |
113 | |
114 | ### Install the internal utilities. Until they are installed, we can | |
115 | ### just run them directly from lib-src. | |
116 | ${archlibdir}: all | |
117 | @echo | |
118 | @echo "Installing utilities run internally by Emacs." | |
119 | ./make-path ${archlibdir} | |
f7d3e7d0 | 120 | if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \ |
544d556f BF |
121 | for file in ${UTILITIES}; do \ |
122 | $(INSTALL_PROGRAM) $$file ${archlibdir}/$$file ; \ | |
544d556f BF |
123 | done ; \ |
124 | for file in ${SCRIPTS}; do \ | |
8ff3d703 | 125 | $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file ; \ |
c71beb75 | 126 | done ; \ |
0268f19b | 127 | fi |
f7dbcf3c JB |
128 | |
129 | # We don't need to install `wakeup' explicitly, because it will be copied when | |
130 | # this whole directory is copied. | |
c71beb75 JB |
131 | install: ${archlibdir} |
132 | @echo | |
133 | @echo "Installing utilities for users to run." | |
b70cff71 | 134 | for file in ${INSTALLABLES} ; do \ |
80fce268 | 135 | $(INSTALL_PROGRAM) $${file} ${bindir}/$${file} ; \ |
0268f19b | 136 | done |
b70cff71 | 137 | for file in ${INSTALLABLE_SCRIPTS} ; do \ |
80fce268 | 138 | $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file} ; \ |
0268f19b | 139 | done |
f7dbcf3c | 140 | |
39b649dd JB |
141 | uninstall: |
142 | (cd ${bindir}; \ | |
143 | rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}) | |
144 | (cd ${archlibdir}; \ | |
145 | rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) | |
146 | ||
a17d2c25 RS |
147 | mostlyclean: |
148 | -rm -f core *.o | |
149 | ||
150 | clean: mostlyclean | |
151 | -rm -f ${INSTALLABLES} ${UTILITIES} | |
f7dbcf3c | 152 | |
39b649dd JB |
153 | distclean: clean |
154 | -rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS | |
f7dbcf3c JB |
155 | |
156 | realclean: distclean | |
39b649dd | 157 | true |
c71beb75 JB |
158 | |
159 | extraclean: realclean | |
160 | -rm -f *~ \#* | |
f7dbcf3c | 161 | |
41f86d5a ER |
162 | unlock: |
163 | chmod u+w $(SOURCES) | |
164 | ||
165 | relock: | |
166 | chmod u-w $(SOURCES) | |
167 | ||
f7dbcf3c JB |
168 | # Test the contents of the directory. |
169 | check: | |
170 | @echo "We don't have any tests for GNU Emacs yet." | |
171 | ||
172 | TAGS: etags | |
173 | etags *.[ch] | |
174 | ||
175 | # This verifies that the non-ASCII characters in the file `testfile' | |
176 | # have not been clobbered by whatever means were used to copy and | |
177 | # distribute Emacs. If they were clobbered, all the .elc files were | |
178 | # clobbered too. | |
0d73e8e3 JB |
179 | test-distrib: ${srcdir}/test-distrib.c |
180 | $(CC) -o test-distrib ${srcdir}/test-distrib.c | |
181 | ./test-distrib ${srcdir}/testfile | |
f7dbcf3c | 182 | |
c38a040d | 183 | GETOPTOBJS = getopt.o getopt1.o $(ALLOCA) |
0d73e8e3 | 184 | GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h |
b90589d8 | 185 | getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h |
0268f19b | 186 | ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c |
b90589d8 | 187 | getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h |
0268f19b | 188 | ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c |
f7dbcf3c | 189 | |
755f5c87 | 190 | etags: ${srcdir}/etags.c $(GETOPTDEPS) ../src/config.h |
3e883207 | 191 | $(CC) ${ALL_CFLAGS} -DETAGS ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags |
f7dbcf3c | 192 | |
4348b379 JB |
193 | # We depend on etags to assure that parallel makes don't write two |
194 | # etags.o files on top of each other. | |
195 | ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags | |
3e883207 | 196 | $(CC) ${ALL_CFLAGS} -DCTAGS ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags |
f7dbcf3c | 197 | |
0d73e8e3 | 198 | wakeup: ${srcdir}/wakeup.c |
3e883207 | 199 | $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup |
f7dbcf3c | 200 | |
0d73e8e3 | 201 | make-docfile: ${srcdir}/make-docfile.c |
3e883207 | 202 | $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile |
f7dbcf3c | 203 | |
0d73e8e3 | 204 | digest-doc: ${srcdir}/digest-doc.c |
3e883207 | 205 | $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc |
f7dbcf3c | 206 | |
1e3255d8 | 207 | sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA} |
3e883207 | 208 | $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc |
f7dbcf3c | 209 | |
0d73e8e3 | 210 | b2m: ${srcdir}/b2m.c ../src/config.h |
3e883207 | 211 | $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m |
f7dbcf3c | 212 | |
0d73e8e3 | 213 | movemail: ${srcdir}/movemail.c ../src/config.h |
3e883207 | 214 | $(CC) ${ALL_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail |
f7dbcf3c | 215 | |
0d73e8e3 | 216 | cvtmail: ${srcdir}/cvtmail.c |
3e883207 | 217 | $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail |
f7dbcf3c | 218 | |
0d73e8e3 | 219 | fakemail: ${srcdir}/fakemail.c ../src/config.h |
3e883207 | 220 | $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail |
f7dbcf3c | 221 | |
0d73e8e3 | 222 | yow: ${srcdir}/yow.c ../src/paths.h |
3e883207 | 223 | $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow |
f7dbcf3c | 224 | |
0d73e8e3 | 225 | env: ${srcdir}/env.c ../src/config.h |
3e883207 | 226 | $(CC) -DEMACS ${ALL_CFLAGS} ${srcdir}/env.c $(LOADLIBES) -o env |
f7dbcf3c | 227 | |
0d73e8e3 | 228 | emacsserver: ${srcdir}/emacsserver.c ../src/config.h |
3e883207 | 229 | $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver |
f7dbcf3c | 230 | |
0d73e8e3 | 231 | emacsclient: ${srcdir}/emacsclient.c ../src/config.h |
3e883207 | 232 | $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient |
f7dbcf3c | 233 | |
0d73e8e3 | 234 | hexl: ${srcdir}/hexl.c |
3e883207 | 235 | $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl |
f7dbcf3c | 236 | |
9ff5de07 | 237 | TIMEROBJS=getdate.o timer.o $(ALLOCA) |
0d73e8e3 JB |
238 | getdate.o: ${srcdir}/getdate.y ../src/config.h |
239 | ${YACC} ${YFLAGS} ${srcdir}/getdate.y | |
eab5f4fd | 240 | $(CC) $(CPP_CFLAGS) -c y.tab.c |
43bf8b0e | 241 | mv y.tab.o getdate.o |
0d73e8e3 | 242 | timer.o: ${srcdir}/timer.c ../src/config.h |
eab5f4fd | 243 | $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c |
9ff5de07 | 244 | timer: ${TIMEROBJS} |
3e883207 | 245 | $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer |
f7dbcf3c | 246 | |
a0697435 | 247 | make-path: ${srcdir}/make-path.c ../src/config.h |
3e883207 | 248 | $(CC) $(ALL_CFLAGS) ${srcdir}/make-path.c -o make-path |
ecc798b0 | 249 | |
f7dbcf3c JB |
250 | # These are NOT included in INSTALLABLES or UTILITIES. |
251 | # See ../src/ymakefile. | |
0d73e8e3 | 252 | emacstool: ${srcdir}/emacstool.c |
3e883207 | 253 | $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \ |
f7dbcf3c JB |
254 | -lsuntool -lsunwindow -lpixrect $(LOADLIBES) |
255 | ||
256 | # For SUN Japanese Language Environment | |
0d73e8e3 | 257 | nemacstool: ${srcdir}/emacstool.c |
3e883207 | 258 | $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \ |
f7dbcf3c JB |
259 | -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES) |
260 | ||
0d73e8e3 | 261 | xvetool: ${srcdir}/emacstool.c |
3e883207 | 262 | $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \ |
f7dbcf3c JB |
263 | -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \ |
264 | $(LOADLIBES) | |
265 | ||
0d73e8e3 | 266 | xveterm: ${srcdir}/emacstool.c |
3e883207 | 267 | $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \ |
f7dbcf3c JB |
268 | -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \ |
269 | $(LOADLIBES) | |
270 | ||
0d73e8e3 | 271 | aixcc: ${srcdir}/aixcc.c |
3e883207 | 272 | $(CC) $(ALL_CFLAGS) -o aixcc ${srcdir}/aixcc.c |
f7dbcf3c | 273 | |
0d73e8e3 JB |
274 | aixcc.c: ${srcdir}/aixcc.lex |
275 | lex ${srcdir}/aixcc.lex | |
f7dbcf3c | 276 | mv lex.yy.c aixcc.c |