Commit d3b23034 authored by Glenn Morris's avatar Glenn Morris
Browse files

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.
parent acddf8ae
ttn 2003-04-09 ttn 2003-04-09
we use a C preprocesor not only in the normal compilation of .c files we use a C preprocesor not only in the normal compilation of .c files
into object files, but also for creating into object files, but also for creating src/Makefile.
src/Makefile
lib-src/Makefile
(delimited by comment "start of cpp stuff"). some cpp implementations (delimited by comment "start of cpp stuff"). some cpp implementations
insert whitespace in between tokens. insert whitespace in between tokens.
......
...@@ -221,16 +221,12 @@ cd .. ...@@ -221,16 +221,12 @@ cd ..
rem ---------------------------------------------------------------------- rem ----------------------------------------------------------------------
Echo Configuring the library source directory... Echo Configuring the library source directory...
cd lib-src cd lib-src
rem Create "makefile" from "makefile.in".
sed -e "1,/== start of cpp stuff ==/s@^##*[ ].*$@@" <Makefile.in >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 If "%DJGPP_VER%" == "2" goto libsrc-v2
sed -f ../msdos/sed3.inp <makefile.new >Makefile sed -f ../msdos/sed3.inp <Makefile.in >Makefile
Goto libsrc2 Goto libsrc2
:libsrc-v2 :libsrc-v2
sed -f ../msdos/sed3v2.inp <makefile.new >Makefile sed -f ../msdos/sed3v2.inp <Makefile.in >Makefile
:libsrc2 :libsrc2
rm -f makefile.new junk.c
if "%X11%" == "" goto libsrc2a if "%X11%" == "" goto libsrc2a
mv Makefile makefile.tmp mv Makefile makefile.tmp
sed -f ../msdos/sed3x.inp <makefile.tmp >Makefile sed -f ../msdos/sed3x.inp <makefile.tmp >Makefile
......
...@@ -3595,7 +3595,7 @@ AC_EGREP_CPP(yes..yes, ...@@ -3595,7 +3595,7 @@ AC_EGREP_CPP(yes..yes,
CPP_NEED_TRADITIONAL=no, CPP_NEED_TRADITIONAL=no,
CPP_NEED_TRADITIONAL=yes) 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/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
doc/lispref/Makefile src/Makefile.c:src/Makefile.in \ doc/lispref/Makefile src/Makefile.c:src/Makefile.in \
lwlib/Makefile lisp/Makefile leim/Makefile, [ lwlib/Makefile lisp/Makefile leim/Makefile, [
...@@ -3619,22 +3619,6 @@ if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then ...@@ -3619,22 +3619,6 @@ if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then
CPPFLAGS="$CPPFLAGS -traditional" CPPFLAGS="$CPPFLAGS -traditional"
fi 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 echo creating src/Makefile
( cd src ( cd src
rm -f junk.c junk1.c junk2.c rm -f junk.c junk1.c junk2.c
......
2010-05-11 Glenn Morris <rgm@gnu.org> 2010-05-11 Glenn Morris <rgm@gnu.org>
* Makefile.in: Convert comments to makefile format.
* Makefile.in (LIBS_SYSTEM) [MSDOS]: Do not reset. * Makefile.in (LIBS_SYSTEM) [MSDOS]: Do not reset.
(config.h) [MSDOS]: Do not include. (config.h) [MSDOS]: Do not include.
......
...@@ -31,6 +31,7 @@ EMACSOPT = -batch --no-site-file --multibyte ...@@ -31,6 +31,7 @@ EMACSOPT = -batch --no-site-file --multibyte
CC=@CC@ CC=@CC@
CFLAGS=@CFLAGS@ CFLAGS=@CFLAGS@
version=@version@ version=@version@
## Used in $archlibdir.
configuration=@configuration@ configuration=@configuration@
EXEEXT=@EXEEXT@ EXEEXT=@EXEEXT@
C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
...@@ -127,8 +128,8 @@ EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} ...@@ -127,8 +128,8 @@ EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
# Specify additional -D flags for movemail. Options: # Specify additional -D flags for movemail. Options:
# -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking). # -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 # 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. # set by configure should be correct and you should not need to do anything.
# If neither flag is set, blessmail is used. # If neither flag is set, you need to use blessmail.
MOVE_FLAGS= MOVE_FLAGS=
## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail. ## 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 ...@@ -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} 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} 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) LOADLIBES=$(LIBS_SYSTEM)
.SUFFIXES: .m .SUFFIXES: .m
/* This is the default compilation command. ## This is the default compilation command.
But we should never rely on it, because some make version ## But we should never rely on it, because some make version failed to
failed to find it for getopt.o. ## find it for getopt.o.
Using an explicit command made it work. */ ## Using an explicit command made it work.
.c.o: .c.o:
${CC} -c ${CPP_CFLAGS} $< ${CC} -c ${CPP_CFLAGS} $<
...@@ -184,11 +182,10 @@ LOADLIBES=$(LIBS_SYSTEM) ...@@ -184,11 +182,10 @@ LOADLIBES=$(LIBS_SYSTEM)
all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
/* These targets copy the scripts into the build directory ## These targets copy the scripts into the build directory so that
so that they can be run from there in an uninstalled Emacs. ## they can be run from there in an uninstalled Emacs.
The "-" is prepended because some versions of cp barf when ## The "-" is prepended because some versions of cp barf when srcdir
srcdir is the current directory, and thus the file will be ## is the current directory, and thus the file will be copied into itself.
copied into itself. */
rcs2log: $(srcdir)/rcs2log rcs2log: $(srcdir)/rcs2log
-cp -p $(srcdir)/rcs2log rcs2log -cp -p $(srcdir)/rcs2log rcs2log
...@@ -201,16 +198,15 @@ grep-changelog: $(srcdir)/grep-changelog ...@@ -201,16 +198,15 @@ grep-changelog: $(srcdir)/grep-changelog
vcdiff: $(srcdir)/vcdiff vcdiff: $(srcdir)/vcdiff
-cp -p $(srcdir)/vcdiff vcdiff -cp -p $(srcdir)/vcdiff vcdiff
/* Only used if we need blessmail, but no harm in always defining. ## Only used if we need blessmail, but no harm in always defining.
This makes the actual blessmail executable. */ ## This makes the actual blessmail executable.
blessmail: blessmail:
$(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
chmod +x blessmail 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 need-blessmail: blessmail
/* Don\'t charge ahead and do it! Let the installer decide.
./blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT} */
@if [ `wc -l <blessmail` != 2 ] ; then \ @if [ `wc -l <blessmail` != 2 ] ; then \
dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \ dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
echo Assuming $$dir is really the mail spool directory, you should; \ echo Assuming $$dir is really the mail spool directory, you should; \
...@@ -219,11 +215,14 @@ need-blessmail: blessmail ...@@ -219,11 +215,14 @@ need-blessmail: blessmail
echo Do that after running make install.; \ echo Do that after running make install.; \
fi fi
/* This is the target invoked by the top-level Makefile. */ ## This is the target invoked by the top-level Makefile.
maybe-blessmail: $(BLESSMAIL_TARGET) maybe-blessmail: $(BLESSMAIL_TARGET)
/* Install the internal utilities. Until they are installed, we can ## Install the internal utilities. Until they are installed, we can
just run them directly from lib-src. */ ## just run them directly from lib-src.
## If the chown/chmod commands fail, that is not a big deal.
## update-game-score will detect at runtime that it is not setuid,
## and handle things accordingly.
$(DESTDIR)${archlibdir}: all $(DESTDIR)${archlibdir}: all
@echo @echo
@echo "Installing utilities run internally by Emacs." @echo "Installing utilities run internally by Emacs."
...@@ -236,9 +235,6 @@ $(DESTDIR)${archlibdir}: all ...@@ -236,9 +235,6 @@ $(DESTDIR)${archlibdir}: all
umask 022; $(top_srcdir)/mkinstalldirs $(DESTDIR)${gamedir}; \ umask 022; $(top_srcdir)/mkinstalldirs $(DESTDIR)${gamedir}; \
touch $(DESTDIR)${gamedir}/snake-scores; \ touch $(DESTDIR)${gamedir}/snake-scores; \
touch $(DESTDIR)${gamedir}/tetris-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} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \ -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
chown ${gameuser} $(DESTDIR)${gamedir}; \ chown ${gameuser} $(DESTDIR)${gamedir}; \
chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \ chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
...@@ -289,7 +285,7 @@ maintainer-clean: distclean ...@@ -289,7 +285,7 @@ maintainer-clean: distclean
extraclean: maintainer-clean extraclean: maintainer-clean
-rm -f *~ \#* -rm -f *~ \#*
/* Test the contents of the directory. */ ## Test the contents of the directory.
check: check:
@echo "We don't have any tests for GNU Emacs yet." @echo "We don't have any tests for GNU Emacs yet."
...@@ -297,16 +293,16 @@ tags: TAGS ...@@ -297,16 +293,16 @@ tags: TAGS
TAGS: etags${EXEEXT} TAGS: etags${EXEEXT}
etags *.[ch] etags *.[ch]
/* This verifies that the non-ASCII characters in the file \`testfile\' ## This verifies that the non-ASCII characters in the file \`testfile\'
have not been clobbered by whatever means were used to copy and ## have not been clobbered by whatever means were used to copy and
distribute Emacs. If they were clobbered, all the .elc files were ## distribute Emacs. If they were clobbered, all the .elc files were
clobbered too. */ ## clobbered too.
test-distrib${EXEEXT}: ${srcdir}/test-distrib.c test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
$(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
./test-distrib ${srcdir}/testfile ./test-distrib ${srcdir}/testfile
/* We need the following in order to create a <getopt.h> when the system ## We need the following in order to create a <getopt.h> when the system
does not have one that works with the given compiler. */ ## does not have one that works with the given compiler.
GETOPT_H = @GETOPT_H@ GETOPT_H = @GETOPT_H@
getopt.h: getopt_.h getopt.h: getopt_.h
cp $(srcdir)/getopt_.h $@-t cp $(srcdir)/getopt_.h $@-t
...@@ -331,8 +327,8 @@ etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h ...@@ -331,8 +327,8 @@ etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse $(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 ## We depend on etags to assure that parallel makes do not write two
etags.o files on top of each other. */ ## etags.o files on top of each other.
ctags${EXEEXT}: etags${EXEEXT} ctags${EXEEXT}: etags${EXEEXT}
$(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" -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
...@@ -355,7 +351,7 @@ b2m${EXEEXT}: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS) ...@@ -355,7 +351,7 @@ b2m${EXEEXT}: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS) movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
$(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail $(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) movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c
...@@ -379,3 +375,5 @@ update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS) ...@@ -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) update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
$(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \ $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
-DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\""
## Makefile ends here.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment