Makefile.in 2.54 KB
Newer Older
Jim Blandy's avatar
Jim Blandy committed
1 2 3 4
# DIST: This is the distribution Makefile for Emacs.  configure can
# DIST: make most of the changes to this file you might want, so try
# DIST: that first.

5 6 7
MAKE = make
# BSD doesn't have it as a default.

8 9
# ==================== Things `configure' might edit ====================

10
CC=cc
11
CPP=cc -E
12
CFLAGS=-g
13
C_SWITCH_SYSTEM=
14 15
srcdir=@srcdir@/src
VPATH=@srcdir@/src
16
LN_S=ln -s
17 18

# ============================= Targets ==============================
19

Jim Blandy's avatar
Jim Blandy committed
20
CPP = $(CC) -E -Is -Im
Joseph Arceneaux's avatar
Joseph Arceneaux committed
21 22
#Note: an alternative is  CPP = /lib/cpp

23 24 25
# Just to avoid uncertainty.
SHELL = /bin/sh

26
SUBMAKEFLAGS = CC='${CC}' LN_S='${LN_S}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
27

28
all: doall
Joseph Arceneaux's avatar
Joseph Arceneaux committed
29

30
doall: xmakefile
31
	$(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} all
Joseph Arceneaux's avatar
Joseph Arceneaux committed
32

33
mostlyclean:
34
	rm -f temacs prefix-args xmakefile* core \#* *.o libXMenu11.a
35 36
	rm -f ../etc/DOC
clean: mostlyclean
Roland McGrath's avatar
Roland McGrath committed
37
	rm -f emacs-* emacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
38 39
#This is used in making a distribution.
#Do not use it on development directories!
40
distclean: clean
41
	rm -f paths.h config.h ../etc/DOC-*
42 43
realclean: distclean
	rm -f TAGS
44 45
versionclean:
	-rm -f emacs emacs-* ../etc/DOC*
46 47 48
extraclean: distclean
	-rm -f *~ \#* m/*~ s/*~

49
emacs: doemacs
50
	@true
Joseph Arceneaux's avatar
Joseph Arceneaux committed
51

52
doemacs: xmakefile
53
	$(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} emacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
54

55
temacs: dotemacs
56
	@true
Joseph Arceneaux's avatar
Joseph Arceneaux committed
57

58
dotemacs: xmakefile
59
	$(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} temacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
60

Eric S. Raymond's avatar
Eric S. Raymond committed
61 62 63 64 65 66 67 68 69
SOURCES = *.[ch] [sm]/* COPYING Makefile.in ymakefile \
	config.h.in README COPYING ChangeLog vms.pp-trans
unlock:
	chmod u+w $(SOURCES)

relock:
	chmod -w $(SOURCES)
	chmod +w paths.h

Jim Blandy's avatar
Jim Blandy committed
70 71 72 73 74 75 76 77
### Some makes, like Ultrix's make, complain if you put a comment in
### the middle of a rule's command list!  Dummies.

### The flags for optimization and debugging depend on the
### system, so take an ordinary CFLAGS value and choose the
### appropriate CPP symbols to use in ymakefile.
### If you have a problem with cc -E here, changing
### the definition of CPP above may fix it.
78 79 80

# Remake xmakefile whenever we reconfigure even if config.h didn't change.
xmakefile: ymakefile config.h ../config.status
Jim Blandy's avatar
Jim Blandy committed
81
	-rm -f xmakefile xmakefile.new junk.c junk.cpp
82
	cp ${srcdir}/ymakefile junk.c
Roland McGrath's avatar
Roland McGrath committed
83
	${CPP} -I. -I${srcdir} ${C_SWITCH_SYSTEM} ${CFLAGS} junk.c > junk.cpp
Jim Blandy's avatar
Jim Blandy committed
84 85 86 87
	< junk.cpp					\
	sed	-e 's/^#.*//'				\
		-e 's/^[ \f\t][ \f\t]*$$//'		\
		-e 's/^ /	/' 			\
88 89
		-e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|'	\
		-e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'|'	\
Jim Blandy's avatar
Jim Blandy committed
90 91 92
	| sed -n -e '/^..*$$/p' 			\
	> xmakefile.new
	mv -f xmakefile.new xmakefile
93
	chmod 444 xmakefile
94
	rm -f junk.c junk.cpp
Joseph Arceneaux's avatar
Joseph Arceneaux committed
95

Jim Blandy's avatar
Jim Blandy committed
96
tagsfiles = [a-z]*.h [a-z]*.c ../lisp/[a-z]*.el ../lisp/term/[a-z]*.el
Roland McGrath's avatar
Roland McGrath committed
97 98 99 100
TAGS: $(tagsfiles)
	etags $(tagsfiles)
tags: TAGS
.PHONY: tags