JimB's changes since January 18th
[bpt/emacs.git] / src / Makefile.in
index 04a0831..5e19aa0 100644 (file)
@@ -5,13 +5,22 @@
 MAKE = make
 # BSD doesn't have it as a default.
 
-CC =gcc
+# ==================== Things `configure' might edit ====================
+
+CC=cc
+CONFIG_CFLAGS=-g
+srcdir=.
+
+# ============================= Targets ==============================
+
 CPP = $(CC) -E -Is -Im
 #Note: an alternative is  CPP = /lib/cpp
 
 # Just to avoid uncertainty.
 SHELL = /bin/sh
 
+CFLAGS=${CONFIG_CFLAGS}
+
 all: doall
 
 doall: xmakefile
@@ -20,27 +29,39 @@ doall: xmakefile
 #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 *~ m/*~ s/*~ \#* *.o
+       -rm -f paths.h config.h emacs-* temacs emacs xmakefile core *.o
 
 clean:
-       -rm -f temacs xemacs prefix-args xmakefile* core \#* *.o
+       -rm -f temacs emacs prefix-args xmakefile* core \#* *.o
+
+extraclean: distclean
+       -rm -f *~ \#* m/*~ s/*~
 
-xemacs: doxemacs
+emacs: doemacs
 
-doxemacs: xmakefile
-       $(MAKE) CC='${CC}' -f xmakefile ${MFLAGS} xemacs
+doemacs: xmakefile
+       $(MAKE) CC='${CC}' -f xmakefile ${MFLAGS} emacs
 
 temacs: dotemacs
 
 dotemacs: xmakefile
        $(MAKE) CC='${CC}' -f xmakefile ${MFLAGS} temacs
 
-# If you have a problem with cc -E here, changing
-# the definition of CPP above may fix it.
+### 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.
 xmakefile: ymakefile config.h
        -rm -f xmakefile xmakefile.new junk.c junk.cpp
        cp ymakefile junk.c
-       $(CPP) junk.c > junk.cpp
+       $(CPP) junk.c > junk.cpp \
+       -DC_SWITCH_SITE="`echo ${CFLAGS}' ' \
+                         | sed -e 's/-g /C_DEBUG_SWITCH /' \
+                               -e 's/-O /C_OPTIMIZE_SWITCH /`"
        < junk.cpp                                      \
        sed     -e 's/^#.*//'                           \
                -e 's/^[ \f\t][ \f\t]*$$//'             \
@@ -48,8 +69,12 @@ xmakefile: ymakefile config.h
        | 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 \
-             ../external-lisp/*.el
+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