+# 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.
+
MAKE = make
# BSD doesn't have it as a default.
-CC =gcc
+# ==================== Things `configure' might edit ====================
+
+CC=cc
+CFLAGS=-g
+srcdir=@srcdir@/src
+VPATH=@srcdir@/src
+LN_S=ln -s
+
+# ============================= Targets ==============================
+
CPP = $(CC) -E -Is -Im
#Note: an alternative is CPP = /lib/cpp
# Just to avoid uncertainty.
SHELL = /bin/sh
-all: xmakefile doall
+SUBMAKEFLAGS = CC='${CC}' LN_S='${LN_S}'
+
+all: doall
-doall:
- $(MAKE) CC=${CC} $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} all
+doall: xmakefile
+ $(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} all
#This is used in making a distribution.
#Do not use it on development directories!
distclean:
- -rm -f paths.h config.h machine.h system.h emacs-* temacs xemacs xmakefile core *~ \#* *.o
+ -rm -f paths.h config.h emacs-* temacs emacs xmakefile core *.o
clean:
- -rm -f temacs xemacs xmakefile* core \#* *.o
+ -rm -f temacs emacs prefix-args xmakefile* core \#* *.o
+
+versionclean:
+ -rm -f emacs emacs-* ../etc/DOC*
+
+extraclean: distclean
+ -rm -f *~ \#* m/*~ s/*~
+
+emacs: doemacs
+ @true
+
+doemacs: xmakefile
+ $(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} emacs
+
+temacs: dotemacs
+ @true
-xemacs: xmakefile doxemacs
+dotemacs: xmakefile
+ $(MAKE) ${SUBMAKEFLAGS} -f xmakefile ${MFLAGS} temacs
-doxemacs:
- $(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} xemacs
+SOURCES = *.[ch] [sm]/* COPYING Makefile.in ymakefile \
+ config.h.in README COPYING ChangeLog vms.pp-trans
+unlock:
+ chmod u+w $(SOURCES)
-temacs: xmakefile dotemacs
+relock:
+ chmod -w $(SOURCES)
+ chmod +w paths.h
-dotemacs:
- $(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} temacs
+### Some makes, like Ultrix's make, complain if you put a comment in
+### the middle of a rule's command list! Dummies.
-# If you have a problem with cc -E here, changing
-# the definition of CPP above may fix it.
+### 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.
xmakefile: ymakefile config.h
-rm -f xmakefile xmakefile.new junk.c junk.cpp
- cp ymakefile junk.c
- $(CPP) junk.c > junk.cpp
+ cp ${srcdir}/ymakefile junk.c
+ ${CPP} -I${srcdir} ${CFLAGS} junk.c > junk.cpp \
+ -DC_SWITCH_SITE="`echo ${CFLAGS}' ' \
+ | sed -e 's/-g /C_DEBUG_SWITCH /' \
+ -e 's/-O[0-9]* /C_OPTIMIZE_SWITCH /'`"
< junk.cpp \
sed -e 's/^#.*//' \
-e 's/^[ \f\t][ \f\t]*$$//' \
-e 's/^ / /' \
+ -e 's|^\(srcdir *=\).*$$|\1'"${srcdir}"'|' \
+ -e 's|^\(VPATH *=\).*$$|\1'"${srcdir}"'|' \
| sed -n -e '/^..*$$/p' \
> xmakefile.new
mv -f xmakefile.new xmakefile
- rm -f junk.c
+ chmod 444 xmakefile
+ rm -f junk.c junk.cpp
-tags TAGS:
- etags [a-z]*.h [a-z]*.c ../lisp/[a-z]*.el ../lisp/term/[a-z]*.el
+tagsfiles = [a-z]*.h [a-z]*.c ../lisp/[a-z]*.el ../lisp/term/[a-z]*.el
+TAGS: $(tagsfiles)
+ etags $(tagsfiles)
+tags: TAGS
+.PHONY: tags