Makefile.in 2.43 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
CFLAGS=-g
12 13
srcdir=@srcdir@/src
VPATH=@srcdir@/src
14
LN_S=ln -s
15 16

# ============================= Targets ==============================
17

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

21 22 23
# Just to avoid uncertainty.
SHELL = /bin/sh

24
SUBMAKEFLAGS = CC='${CC}' LN_S='${LN_S}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
25

26
all: doall
Joseph Arceneaux's avatar
Joseph Arceneaux committed
27

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

#This is used in making a distribution.
#Do not use it on development directories!
distclean:
34
	-rm -f paths.h config.h emacs-* temacs emacs xmakefile core *.o
Joseph Arceneaux's avatar
Joseph Arceneaux committed
35 36

clean:
37
	-rm -f temacs emacs prefix-args xmakefile* core \#* *.o libXMenu11.a
Joseph Arceneaux's avatar
Joseph Arceneaux committed
38

39 40 41
versionclean:
	-rm -f emacs emacs-* ../etc/DOC*

42 43 44
extraclean: distclean
	-rm -f *~ \#* m/*~ s/*~

45
emacs: doemacs
46
	@true
Joseph Arceneaux's avatar
Joseph Arceneaux committed
47

48
doemacs: xmakefile
49
	$(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} emacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
50

51
temacs: dotemacs
52
	@true
Joseph Arceneaux's avatar
Joseph Arceneaux committed
53

54
dotemacs: xmakefile
55
	$(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} temacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
56

Eric S. Raymond's avatar
Eric S. Raymond committed
57 58 59 60 61 62 63 64 65
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
66 67 68 69 70 71 72 73
### 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.
74 75 76

# 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
77
	-rm -f xmakefile xmakefile.new junk.c junk.cpp
78
	cp ${srcdir}/ymakefile junk.c
79
	${CPP} -I${srcdir} ${CFLAGS} junk.c > junk.cpp
Jim Blandy's avatar
Jim Blandy committed
80 81 82 83
	< junk.cpp					\
	sed	-e 's/^#.*//'				\
		-e 's/^[ \f\t][ \f\t]*$$//'		\
		-e 's/^ /	/' 			\
84 85
		-e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|'	\
		-e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'|'	\
Jim Blandy's avatar
Jim Blandy committed
86 87 88
	| sed -n -e '/^..*$$/p' 			\
	> xmakefile.new
	mv -f xmakefile.new xmakefile
89
	chmod 444 xmakefile
90
	rm -f junk.c junk.cpp
Joseph Arceneaux's avatar
Joseph Arceneaux committed
91

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