Makefile.in 1.89 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 12 13 14
CONFIG_CFLAGS=-g
srcdir=.

# ============================= Targets ==============================
15

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

19 20 21
# Just to avoid uncertainty.
SHELL = /bin/sh

22 23
CFLAGS=${CONFIG_CFLAGS}

24
all: doall
Joseph Arceneaux's avatar
Joseph Arceneaux committed
25

26
doall: xmakefile
Roland McGrath's avatar
Roland McGrath committed
27
	$(MAKE) CC='${CC}' -f xmakefile ${MFLAGS} all
Joseph Arceneaux's avatar
Joseph Arceneaux committed
28 29 30 31

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

clean:
35
	-rm -f temacs xemacs prefix-args xmakefile* core \#* *.o
Joseph Arceneaux's avatar
Joseph Arceneaux committed
36

37 38 39
extraclean: distclean
	-rm -f *~ \#* m/*~ s/*~

40
xemacs: doxemacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
41

42
doxemacs: xmakefile
43
	$(MAKE) CC='${CC}' -f xmakefile ${MFLAGS} xemacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
44

45
temacs: dotemacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
46

47
dotemacs: xmakefile
48
	$(MAKE) CC='${CC}' -f xmakefile ${MFLAGS} temacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
49 50 51 52

# If you have a problem with cc -E here, changing
# the definition of CPP above may fix it.
xmakefile: ymakefile config.h
Jim Blandy's avatar
Jim Blandy committed
53
	-rm -f xmakefile xmakefile.new junk.c junk.cpp
Joseph Arceneaux's avatar
Joseph Arceneaux committed
54
	cp ymakefile junk.c
55 56 57 58 59 60 61
	## 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.
	$(CPP) junk.c > junk.cpp \
	-DC_SWITCH_SITE="`echo ${CFLAGS}' ' \
			  | sed -e 's/-g /C_DEBUG_SWITCH /' \
				-e 's/-O /C_OPTIMIZE_SWITCH /`"
Jim Blandy's avatar
Jim Blandy committed
62 63 64 65 66 67 68
	< junk.cpp					\
	sed	-e 's/^#.*//'				\
		-e 's/^[ \f\t][ \f\t]*$$//'		\
		-e 's/^ /	/' 			\
	| sed -n -e '/^..*$$/p' 			\
	> xmakefile.new
	mv -f xmakefile.new xmakefile
69
	chmod 444 xmakefile
70
	rm -f junk.c junk.cpp
Joseph Arceneaux's avatar
Joseph Arceneaux committed
71

Roland McGrath's avatar
Roland McGrath committed
72 73 74 75 76 77
tagsfiles = [a-z]*.h [a-z]*.c ../lisp/[a-z]*.el ../lisp/term/[a-z]*.el \
	    ../external-lisp/*.el
TAGS: $(tagsfiles)
	etags $(tagsfiles)
tags: TAGS
.PHONY: tags