Makefile.in 2.01 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 emacs xmakefile core *.o
Joseph Arceneaux's avatar
Joseph Arceneaux committed
33 34

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

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

40
emacs: doemacs
Joseph Arceneaux's avatar
Joseph Arceneaux committed
41

42 43
doemacs: xmakefile
	$(MAKE) CC='${CC}' -f xmakefile ${MFLAGS} emacs
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

Jim Blandy's avatar
Jim Blandy committed
50 51 52 53 54 55 56 57
### 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.
Joseph Arceneaux's avatar
Joseph Arceneaux committed
58
xmakefile: ymakefile config.h
Jim Blandy's avatar
Jim Blandy committed
59
	-rm -f xmakefile xmakefile.new junk.c junk.cpp
Joseph Arceneaux's avatar
Joseph Arceneaux committed
60
	cp ymakefile junk.c
61 62 63 64
	$(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
65 66 67 68 69 70 71
	< junk.cpp					\
	sed	-e 's/^#.*//'				\
		-e 's/^[ \f\t][ \f\t]*$$//'		\
		-e 's/^ /	/' 			\
	| sed -n -e '/^..*$$/p' 			\
	> xmakefile.new
	mv -f xmakefile.new xmakefile
72
	chmod 444 xmakefile
73
	rm -f junk.c junk.cpp
Joseph Arceneaux's avatar
Joseph Arceneaux committed
74

Roland McGrath's avatar
Roland McGrath committed
75 76 77 78 79 80
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