# Makefile for lib-src subdirectory in GNU Emacs.
-# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003, 2004,
+# 2005, 2006 Free Software Foundation, Inc.
# This file is part of GNU Emacs.
# You should have received a copy of the GNU General Public License
# along with GNU Emacs; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
# Avoid trouble on systems where the `SHELL' variable might be
# inherited from the environment.
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_PROGRAM) ${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_PROGRAM) ${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:
- -rm -f core *.o
+ -rm -f core *.o getopt.h getopt.h-t
clean: mostlyclean
-rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
$(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
./test-distrib ${srcdir}/testfile
-GETOPTOBJS = getopt.o getopt1.o
-GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
-getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
+/* We need the following in order to create a <getopt.h> when the system
+ doesn't have one that works with the given compiler. */
+GETOPT_H = @GETOPT_H@
+getopt.h: getopt_.h
+ cp $(srcdir)/getopt_.h $@-t
+ mv $@-t $@
+
+GETOPTOBJS = @GETOPTOBJS@
+GETOPTDEPS = $(GETOPTOBJS) $(GETOPT_H)
+getopt.o: ${srcdir}/getopt.c $(GETOPT_H) ${srcdir}/gettext.h
${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
-getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
+getopt1.o: ${srcdir}/getopt1.c $(GETOPT_H)
${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
#ifdef REGEXP_IN_LIBC
movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
$(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail
-movemail.o: ${srcdir}/movemail.c ../src/config.h
+movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
$(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
pop.o: ${srcdir}/pop.c ../src/config.h
emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
$(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
- -DVERSION=`sed -n -e '/(defconst emacs-version/ s/^[^"]*\("[^"]*"\).*/\1/p' ${srcdir}/../lisp/version.el` \
+ -DVERSION="\"${version}\"" \
$(LOADLIBES) -o emacsclient
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
+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)\""
/* These are NOT included in INSTALLABLES or UTILITIES.
See ../src/Makefile.in. */
$(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
-lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
$(LOADLIBES)
-
-# arch-tag: cc40144d-fbd2-436b-9a22-dcb5b5b6a2af