From d3b23034e8730133e23d6b51905b181f12bfb253 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 10 May 2010 20:00:32 -0700 Subject: [PATCH] Do not preprocess lib-src/Makefile.in * configure.in: Generate lib-src/Makefile directly, do not run cpp. * config.bat: Do not run cpp on lib-src/Makefile.in. * lib-src/Makefile.in: Convert comments to makefile format. * admin/notes/cpp: lib-src/Makefile not preprocessed. --- admin/notes/cpp | 6 +--- config.bat | 8 ++---- configure.in | 18 +----------- lib-src/ChangeLog | 2 ++ lib-src/Makefile.in | 68 ++++++++++++++++++++++----------------------- 5 files changed, 39 insertions(+), 63 deletions(-) diff --git a/admin/notes/cpp b/admin/notes/cpp index 275001369d..73b4b3d64f 100644 --- a/admin/notes/cpp +++ b/admin/notes/cpp @@ -1,11 +1,7 @@ ttn 2003-04-09 we use a C preprocesor not only in the normal compilation of .c files -into object files, but also for creating - - src/Makefile - lib-src/Makefile - +into object files, but also for creating src/Makefile. (delimited by comment "start of cpp stuff"). some cpp implementations insert whitespace in between tokens. diff --git a/config.bat b/config.bat index e2e57bb5ef..0482d4f15f 100644 --- a/config.bat +++ b/config.bat @@ -221,16 +221,12 @@ cd .. rem ---------------------------------------------------------------------- Echo Configuring the library source directory... cd lib-src -rem Create "makefile" from "makefile.in". -sed -e "1,/== start of cpp stuff ==/s@^##*[ ].*$@@" junk.c -gcc -E -traditional -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ ]*$/d" >makefile.new If "%DJGPP_VER%" == "2" goto libsrc-v2 -sed -f ../msdos/sed3.inp Makefile +sed -f ../msdos/sed3.inp Makefile Goto libsrc2 :libsrc-v2 -sed -f ../msdos/sed3v2.inp Makefile +sed -f ../msdos/sed3v2.inp Makefile :libsrc2 -rm -f makefile.new junk.c if "%X11%" == "" goto libsrc2a mv Makefile makefile.tmp sed -f ../msdos/sed3x.inp Makefile diff --git a/configure.in b/configure.in index c99167f205..d634262a0f 100644 --- a/configure.in +++ b/configure.in @@ -3595,7 +3595,7 @@ AC_EGREP_CPP(yes..yes, CPP_NEED_TRADITIONAL=no, CPP_NEED_TRADITIONAL=yes) -AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \ +AC_OUTPUT(Makefile lib-src/Makefile oldXMenu/Makefile \ doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ doc/lispref/Makefile src/Makefile.c:src/Makefile.in \ lwlib/Makefile lisp/Makefile leim/Makefile, [ @@ -3619,22 +3619,6 @@ if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then CPPFLAGS="$CPPFLAGS -traditional" fi -echo creating lib-src/Makefile -( cd lib-src - rm -f junk.c junk1.c junk2.c - sed -e '/start of cpp stuff/q' \ - < Makefile.c > junk1.c - sed -e '1,/start of cpp stuff/d'\ - -e 's,/\*\*/#\(.*\)$,/* \1 */,' \ - < Makefile.c > junk.c - $CPP -P $cpp_undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \ - sed -e 's/^ / /' -e '/^#/d' -e '/^[ ]*$/d' > junk2.c - cat junk1.c junk2.c > Makefile.new - rm -f junk.c junk1.c junk2.c - chmod 444 Makefile.new - mv -f Makefile.new Makefile -) - echo creating src/Makefile ( cd src rm -f junk.c junk1.c junk2.c diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 6f3879fb26..c9a054b9e2 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,7 @@ 2010-05-11 Glenn Morris + * Makefile.in: Convert comments to makefile format. + * Makefile.in (LIBS_SYSTEM) [MSDOS]: Do not reset. (config.h) [MSDOS]: Do not include. diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 683a97393d..a2773aa916 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -31,6 +31,7 @@ EMACSOPT = -batch --no-site-file --multibyte CC=@CC@ CFLAGS=@CFLAGS@ version=@version@ +## Used in $archlibdir. configuration=@configuration@ EXEEXT=@EXEEXT@ C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ @@ -127,8 +128,8 @@ EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} # Specify additional -D flags for movemail. Options: # -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking). # See the comments about locking in movemail.c. Normally the values -# in ../src/[ms]/*.h should be correct and you should not need to do anything. -# If neither flag is set, blessmail is used. +# set by configure should be correct and you should not need to do anything. +# If neither flag is set, you need to use blessmail. MOVE_FLAGS= ## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail. @@ -164,18 +165,15 @@ ALL_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src LINK_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS} CPP_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS} -# ========================== start of cpp stuff ======================= -/* From here on, comments must be done in C syntax. */ - LOADLIBES=$(LIBS_SYSTEM) .SUFFIXES: .m -/* This is the default compilation command. - But we should never rely on it, because some make version - failed to find it for getopt.o. - Using an explicit command made it work. */ +## This is the default compilation command. +## But we should never rely on it, because some make version failed to +## find it for getopt.o. +## Using an explicit command made it work. .c.o: ${CC} -c ${CPP_CFLAGS} $< @@ -184,11 +182,10 @@ LOADLIBES=$(LIBS_SYSTEM) 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. -The "-" is prepended because some versions of cp barf when -srcdir is the current directory, and thus the file will be -copied into itself. */ +## These targets copy the scripts into the build directory 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 @@ -201,16 +198,15 @@ grep-changelog: $(srcdir)/grep-changelog vcdiff: $(srcdir)/vcdiff -cp -p $(srcdir)/vcdiff vcdiff -/* Only used if we need blessmail, but no harm in always defining. - This makes the actual blessmail executable. */ +## Only used if we need blessmail, but no harm in always defining. +## This makes the actual blessmail executable. blessmail: $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el chmod +x blessmail -/* This checks if we need to run blessmail. */ +## This checks if we need to run blessmail. +## Do not charge ahead and do it! Let the installer decide. need-blessmail: blessmail -/* Don\'t charge ahead and do it! Let the installer decide. - ./blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT} */ @if [ `wc -l when the system - does not have one that works with the given compiler. */ +## We need the following in order to create a when the system +## does not have one that works with the given compiler. GETOPT_H = @GETOPT_H@ getopt.h: getopt_.h cp $(srcdir)/getopt_.h $@-t @@ -331,8 +327,8 @@ etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h 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. */ +## We depend on etags to assure that parallel makes do not write two +## etags.o files on top of each other. ctags${EXEEXT}: etags${EXEEXT} $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags @@ -355,7 +351,7 @@ b2m${EXEEXT}: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS) movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS) $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail -/* We need to define emacs to get the right version of something (what?). */ +## We need to define emacs to get the right version of something (what?). movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H) $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c @@ -379,3 +375,5 @@ update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS) 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. -- 2.20.1