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