Commit | Line | Data |
---|---|---|
ec558adc 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 | ||
4ddcbb51 RS |
5 | MAKE = make |
6 | # BSD doesn't have it as a default. | |
7 | ||
9e012fc3 JB |
8 | # ==================== Things `configure' might edit ==================== |
9 | ||
0c22fbca | 10 | CC=cc |
a84281e7 | 11 | CPP=cc -E |
d70fd7d6 | 12 | CFLAGS=-g |
331636c4 | 13 | C_SWITCH_SYSTEM= |
3ce7a076 JB |
14 | srcdir=@srcdir@/src |
15 | VPATH=@srcdir@/src | |
d70fd7d6 | 16 | LN_S=ln -s |
9e012fc3 JB |
17 | |
18 | # ============================= Targets ============================== | |
0c22fbca | 19 | |
e5d77022 | 20 | CPP = $(CC) -E -Is -Im |
c8ff0e1b JA |
21 | #Note: an alternative is CPP = /lib/cpp |
22 | ||
5627d72e RS |
23 | # Just to avoid uncertainty. |
24 | SHELL = /bin/sh | |
25 | ||
dad2fc01 | 26 | SUBMAKEFLAGS = CC='${CC}' LN_S='${LN_S}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' |
9e012fc3 | 27 | |
43a904c1 | 28 | all: doall |
c8ff0e1b | 29 | |
43a904c1 | 30 | doall: xmakefile |
d70fd7d6 | 31 | $(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} all |
c8ff0e1b | 32 | |
bfb7b570 | 33 | mostlyclean: |
9d11b9a1 | 34 | rm -f temacs prefix-args xmakefile* core \#* *.o libXMenu11.a |
bfb7b570 JB |
35 | rm -f ../etc/DOC |
36 | clean: mostlyclean | |
21ed4461 | 37 | rm -f emacs-* emacs |
c8ff0e1b JA |
38 | #This is used in making a distribution. |
39 | #Do not use it on development directories! | |
bfb7b570 | 40 | distclean: clean |
9d11b9a1 | 41 | rm -f paths.h config.h ../etc/DOC-* |
bfb7b570 JB |
42 | realclean: distclean |
43 | rm -f TAGS | |
c3d80a47 ER |
44 | versionclean: |
45 | -rm -f emacs emacs-* ../etc/DOC* | |
9e012fc3 JB |
46 | extraclean: distclean |
47 | -rm -f *~ \#* m/*~ s/*~ | |
48 | ||
307436bb | 49 | emacs: doemacs |
75cf385a | 50 | @true |
c8ff0e1b | 51 | |
307436bb | 52 | doemacs: xmakefile |
d70fd7d6 | 53 | $(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} emacs |
c8ff0e1b | 54 | |
43a904c1 | 55 | temacs: dotemacs |
75cf385a | 56 | @true |
c8ff0e1b | 57 | |
43a904c1 | 58 | dotemacs: xmakefile |
d70fd7d6 | 59 | $(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} temacs |
c8ff0e1b | 60 | |
a6af8696 ER |
61 | SOURCES = *.[ch] [sm]/* COPYING Makefile.in ymakefile \ |
62 | config.h.in README COPYING ChangeLog vms.pp-trans | |
63 | unlock: | |
64 | chmod u+w $(SOURCES) | |
65 | ||
66 | relock: | |
67 | chmod -w $(SOURCES) | |
68 | chmod +w paths.h | |
69 | ||
dbc4e1c1 JB |
70 | ### Some makes, like Ultrix's make, complain if you put a comment in |
71 | ### the middle of a rule's command list! Dummies. | |
72 | ||
73 | ### The flags for optimization and debugging depend on the | |
74 | ### system, so take an ordinary CFLAGS value and choose the | |
75 | ### appropriate CPP symbols to use in ymakefile. | |
76 | ### If you have a problem with cc -E here, changing | |
77 | ### the definition of CPP above may fix it. | |
691d8b2c RS |
78 | |
79 | # Remake xmakefile whenever we reconfigure even if config.h didn't change. | |
80 | xmakefile: ymakefile config.h ../config.status | |
e5d77022 | 81 | -rm -f xmakefile xmakefile.new junk.c junk.cpp |
3ce7a076 | 82 | cp ${srcdir}/ymakefile junk.c |
21ed4461 | 83 | ${CPP} -I. -I${srcdir} ${C_SWITCH_SYSTEM} ${CFLAGS} junk.c > junk.cpp |
e5d77022 JB |
84 | < junk.cpp \ |
85 | sed -e 's/^#.*//' \ | |
86 | -e 's/^[ \f\t][ \f\t]*$$//' \ | |
87 | -e 's/^ / /' \ | |
3ce7a076 JB |
88 | -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \ |
89 | -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'|' \ | |
e5d77022 JB |
90 | | sed -n -e '/^..*$$/p' \ |
91 | > xmakefile.new | |
92 | mv -f xmakefile.new xmakefile | |
9e012fc3 | 93 | chmod 444 xmakefile |
0c22fbca | 94 | rm -f junk.c junk.cpp |
c8ff0e1b | 95 | |
5f1a4d41 | 96 | tagsfiles = [a-z]*.h [a-z]*.c ../lisp/[a-z]*.el ../lisp/term/[a-z]*.el |
ac21ec40 RM |
97 | TAGS: $(tagsfiles) |
98 | etags $(tagsfiles) | |
99 | tags: TAGS | |
100 | .PHONY: tags |