# Makefile for lib-src subdirectory in GNU Emacs.
-# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003, 2004,
-# 2005 Free Software Foundation, Inc.
+# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007 Free Software Foundation, Inc.
# This file is part of GNU Emacs.
# GNU Emacs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
+# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# GNU Emacs is distributed in the hope that it will be useful,
# inherited from the environment.
SHELL = /bin/sh
+# Following ../lisp/Makefile.in.
+EMACS = ../src/emacs
+EMACSOPT = -batch --no-site-file --multibyte
+
# ==================== Things `configure' will edit ====================
CC=@CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
# By default, we uphold the dignity of our programs.
INSTALL_STRIP =
# Things that Emacs runs internally, or during the build process,
# which should not be installed in bindir.
UTILITIES= profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} movemail${EXEEXT} cvtmail${EXEEXT} fakemail${EXEEXT} \
- yow${EXEEXT} hexl${EXEEXT} update-game-score${EXEEXT}
+ hexl${EXEEXT} update-game-score${EXEEXT}
DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
-SOURCES = COPYING ChangeLog Makefile.in README emacs.csh \
- makedoc.com *.[chy] rcs2log vcdiff
-
# Additional -D flags for movemail (add to MOVE_FLAGS if desired):
# MAIL_USE_POP Support mail retrieval from a POP mailbox.
# MAIL_USE_MMDF Support MMDF mailboxes.
all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
/* These targets copy the scripts into the build directory
-so that they can be run from there in an uninstalled Emacs. */
+so that they can be run from there in an uninstalled Emacs.
+The "-" is prepended because some versions of cp barf when
+srcdir is the current directory, and thus the file will be
+copied into itself. */
rcs2log: $(srcdir)/rcs2log
- cp -p $(srcdir)/rcs2log rcs2log
+ -cp -p $(srcdir)/rcs2log rcs2log
rcs-checkin: $(srcdir)/rcs-checkin
- cp -p $(srcdir)/rcs-checkin rcs-checkin
+ -cp -p $(srcdir)/rcs-checkin rcs-checkin
grep-changelog: $(srcdir)/grep-changelog
- cp -p $(srcdir)/grep-changelog grep-changelog
+ -cp -p $(srcdir)/grep-changelog grep-changelog
vcdiff: $(srcdir)/vcdiff
- cp -p $(srcdir)/vcdiff vcdiff
+ -cp -p $(srcdir)/vcdiff vcdiff
#ifdef MOVEMAIL_NEEDS_BLESSING
blessmail:
- ../src/emacs -batch -l $(srcdir)/../lisp/mail/blessmail.el
+ $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
chmod +x blessmail
#endif
maybe-blessmail: BLESSMAIL
#ifdef MOVEMAIL_NEEDS_BLESSING
/* Don\'t charge ahead and do it! Let the installer decide.
- ./blessmail ${archlibdir}/movemail${EXEEXT} */
+ ./blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT} */
@if [ `wc -l <blessmail` != 2 ] ; then \
dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
echo Assuming $$dir is really the mail spool directory, you should; \
- echo run lib-src/blessmail ${archlibdir}/movemail${EXEEXT}; \
+ echo run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}; \
echo as root, to give movemail${EXEEXT} appropriate permissions.; \
echo Do that after running make install.; \
fi
/* Install the internal utilities. Until they are installed, we can
just run them directly from lib-src. */
-${archlibdir}: all
+$(DESTDIR)${archlibdir}: all
@echo
@echo "Installing utilities run internally by Emacs."
- $(top_srcdir)/mkinstalldirs ${archlibdir}
- if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)${archlibdir}
+ if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
for file in ${UTILITIES}; do \
- $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file ${archlibdir}/$$file ; \
+ $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
done ; \
fi
- $(top_srcdir)/mkinstalldirs ${gamedir}
- touch ${gamedir}/snake-scores
- touch ${gamedir}/tetris-scores
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)${gamedir}
+ touch $(DESTDIR)${gamedir}/snake-scores
+ touch $(DESTDIR)${gamedir}/tetris-scores
/* If the following commands fail, that is not a big deal.
update-game-score will detect at runtime that it is not setuid,
and handle things accordingly. */
- -if chown ${gameuser} ${archlibdir}/update-game-score && chmod u+s ${archlibdir}/update-game-score; then \
- chown ${gameuser} ${gamedir}; \
- chmod u=rwx,g=rwx,o=rx ${gamedir}; \
+ -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
+ chown ${gameuser} $(DESTDIR)${gamedir}; \
+ chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
fi
- if [ `(cd ${archlibdir} && /bin/pwd)` \
+ if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` \
!= `(cd ${srcdir} && /bin/pwd)` ]; then \
for file in ${SCRIPTS}; do \
- $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file; \
+ $(INSTALL_SCRIPT) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \
done ; \
fi
-install: ${archlibdir}
+install: $(DESTDIR)${archlibdir}
@echo
@echo "Installing utilities for users to run."
for file in ${INSTALLABLES} ; do \
- $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
- chmod a+rx ${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
+ $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
+ chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
done
for file in ${INSTALLABLE_SCRIPTS} ; do \
- $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
- chmod a+rx ${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
+ $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
+ chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
done
uninstall:
- (cd ${bindir}; \
+ (cd $(DESTDIR)${bindir}; \
for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
- rm -f ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
+ rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
done)
- (cd ${archlibdir}; \
+ (cd $(DESTDIR)${archlibdir}; \
rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
mostlyclean:
extraclean: maintainer-clean
-rm -f *~ \#*
-unlock:
- chmod u+w $(SOURCES)
-
-relock:
- chmod u-w $(SOURCES)
-
/* Test the contents of the directory. */
check:
@echo "We don't have any tests for GNU Emacs yet."
${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
- $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
+ $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs"\" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
/* We depend on etags to assure that parallel makes don\'t write two
etags.o files on top of each other. */
ctags${EXEEXT}: etags${EXEEXT}
- $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
+ $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs"\" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
$(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
fakemail${EXEEXT}: ${srcdir}/fakemail.c ../src/config.h
$(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
-yow${EXEEXT}: ${srcdir}/yow.c ../src/epaths.h
- $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
-
emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
$(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
-DVERSION="\"${version}\"" \
hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
$(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
-update-game-score${EXEEXT}: ${srcdir}/update-game-score.c ../src/config.h
- $(CC) ${ALL_CFLAGS} ${srcdir}/update-game-score.c \
- -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
- $(LOADLIBES) -o update-game-score
-
-/* These are NOT included in INSTALLABLES or UTILITIES.
- See ../src/Makefile.in. */
-emacstool${EXEEXT}: ${srcdir}/emacstool.c
- $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
- -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
-
-/* For SUN Japanese Language Environment. */
-nemacstool${EXEEXT}: ${srcdir}/emacstool.c
- $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
- -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
-
-xvetool${EXEEXT}: ${srcdir}/emacstool.c
- $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
- -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
- $(LOADLIBES)
-
-xveterm${EXEEXT}: ${srcdir}/emacstool.c
- $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
- -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
- $(LOADLIBES)
+update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS)
+ $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} update-game-score.o $(GETOPTOBJS) $(LOADLIBES) -o update-game-score
+
+update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
+ $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
+ -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\""
+
+
+### Makefile ends here