Makefile.in 2.5 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 14
srcdir=@srcdir@/src
VPATH=@srcdir@/src
15
LN_S=ln -s
16 17

# ============================= Targets ==============================
18

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

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

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

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

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

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

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

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

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

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

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

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

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