Commit 93160ec3 authored by Glenn Morris's avatar Glenn Morris

Use gcc auto-dependency information for lwlib and oldXMenu

* configure.ac (lwlib_deps_frag, oldxmenu_deps_frag): New output files.

* make-dist (lwlib, oldXMenu): Distribute *.mk.

* lwlib/Makefile.in: Move old dependency information to new file deps.mk.
(MKDIR_P, DEPFLAGS, MKDEPDIR, lwlib_deps_frag):
New, set by configure.
(DEPDIR): New variable.
(ALL_CFLAGS): Add DEPFLAGS.
(.c.o): Add MKDEPDIR.
(clean, mostlyclean): Delete DEPDIR.

* lwlib/deps.mk, lwlib/autodeps.mk: New files.

* oldXMenu/Makefile.in: Move old dependency information to new file deps.mk.
(MKDIR_P, DEPFLAGS, MKDEPDIR, oldxmenu_deps_frag):
New, set by configure.
(DEPDIR): New variable.
(ALL_CFLAGS): Add DEPFLAGS.
(.c.o): Add MKDEPDIR.
(clean, mostlyclean): Delete DEPDIR.

* oldXMenu/deps.mk, oldXMenu/autodeps.mk: New files.

* src/deps.mk: Comment update.

* .bzrignore: Ignore lwlib/deps, oldXMenu/deps.
parent e0d9c3c9
2014-06-28 Glenn Morris <rgm@gnu.org>
* configure.ac (lwlib_deps_frag, oldxmenu_deps_frag): New output files.
* make-dist (lwlib, oldXMenu): Distribute *.mk.
2014-06-27 Glenn Morris <rgm@gnu.org> 2014-06-27 Glenn Morris <rgm@gnu.org>
* Makefile.in (src): No more need to pass BOOTSTRAPEMACS. * Makefile.in (src): No more need to pass BOOTSTRAPEMACS.
......
...@@ -1590,11 +1590,14 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then ...@@ -1590,11 +1590,14 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
deps_frag=autodeps.mk deps_frag=autodeps.mk
fi fi
fi fi
lwlib_deps_frag=$srcdir/lwlib/$deps_frag
oldxmenu_deps_frag=$srcdir/oldXMenu/$deps_frag
deps_frag=$srcdir/src/$deps_frag deps_frag=$srcdir/src/$deps_frag
AC_SUBST(MKDEPDIR) AC_SUBST(MKDEPDIR)
AC_SUBST(DEPFLAGS) AC_SUBST(DEPFLAGS)
AC_SUBST_FILE(deps_frag) AC_SUBST_FILE(deps_frag)
AC_SUBST_FILE(lwlib_deps_frag)
AC_SUBST_FILE(oldxmenu_deps_frag)
lisp_frag=$srcdir/src/lisp.mk lisp_frag=$srcdir/src/lisp.mk
AC_SUBST_FILE(lisp_frag) AC_SUBST_FILE(lisp_frag)
......
2014-06-28 Glenn Morris <rgm@gnu.org>
* Makefile.in: Use gcc auto-dependency information.
Move old dependency information to new file deps.mk.
(MKDIR_P, DEPFLAGS, MKDEPDIR, lwlib_deps_frag):
New, set by configure.
(DEPDIR): New variable.
(ALL_CFLAGS): Add DEPFLAGS.
(.c.o): Add MKDEPDIR.
(clean, mostlyclean): Delete DEPDIR.
* deps.mk, autodeps.mk: New files.
2014-06-17 Paul Eggert <eggert@cs.ucla.edu> 2014-06-17 Paul Eggert <eggert@cs.ucla.edu>
Omit redundant extern decls. Omit redundant extern decls.
......
...@@ -41,6 +41,7 @@ RANLIB=@RANLIB@ ...@@ -41,6 +41,7 @@ RANLIB=@RANLIB@
AR = @AR@ AR = @AR@
ARFLAGS = @ARFLAGS@ ARFLAGS = @ARFLAGS@
MKDIR_P = @MKDIR_P@
LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o
MOTIF_OBJS = lwlib-Xm.o MOTIF_OBJS = lwlib-Xm.o
...@@ -50,13 +51,19 @@ TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS) ...@@ -50,13 +51,19 @@ TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS)
OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o
DEPDIR = deps
## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty.
DEPFLAGS = @DEPFLAGS@
## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'.
MKDEPDIR = @MKDEPDIR@
## ../src is where the generated file (config.h, globals.h) are. ## ../src is where the generated file (config.h, globals.h) are.
## $(srcdir)/../src is where the non-generated files (lisp.h) are. ## $(srcdir)/../src is where the non-generated files (lisp.h) are.
## (In an out-of-tree build, these two are not the same.) ## (In an out-of-tree build, these two are not the same.)
## $(srcdir) is where the lwlib sources are. ## $(srcdir) is where the lwlib sources are.
## There are no generated lwlib files, hence no need for -I. ## There are no generated lwlib files, hence no need for -I.
ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
$(C_SWITCH_MACHINE) \ $(C_SWITCH_MACHINE) $(DEPFLAGS) \
$(WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \ $(WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \
-Demacs -I../src \ -Demacs -I../src \
-I$(srcdir) -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib -I$(srcdir) -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib
...@@ -65,6 +72,7 @@ all: liblw.a ...@@ -65,6 +72,7 @@ all: liblw.a
.PHONY: all .PHONY: all
.c.o: .c.o:
@$(MKDEPDIR)
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
liblw.a: $(OBJS) liblw.a: $(OBJS)
...@@ -72,30 +80,18 @@ liblw.a: $(OBJS) ...@@ -72,30 +80,18 @@ liblw.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
## Generated files in ../src, non-generated in $(srcdir)/../src.
config_h = ../src/config.h $(srcdir)/../src/conf_post.h
lisp_h = $(srcdir)/../src/lisp.h
## lisp.h includes this.
globals_h = ../src/globals.h globals_h = ../src/globals.h
src_h = $(config_h) $(lisp_h) $(globals_h)
$(globals_h): $(globals_h):
$(MAKE) -C ../src globals.h $(MAKE) -C ../src globals.h
lwlib-utils.o: $(src_h) lwlib-utils.c lwlib-utils.h lwlib.h ## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
lwlib.o: $(src_h) lwlib.c lwlib.h lwlib-int.h lwlib-utils.h \ @lwlib_deps_frag@
lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h
lwlib-Xlw.o: $(src_h) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.h
lwlib-Xaw.o: $(src_h) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h
lwlib-Xm.o: $(src_h) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
xlwmenu.o: $(src_h) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h \
$(srcdir)/../src/xterm.h
.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
clean mostlyclean: clean mostlyclean:
rm -f *.o liblw.a \#* rm -f *.o liblw.a \#*
-rm -rf ${DEPDIR}
distclean: clean distclean: clean
rm -f Makefile rm -f Makefile
......
### autodeps.mk --- lwlib/Makefile fragment for GNU Emacs
## This is inserted in lwlib/Makefile if AUTO_DEPEND=yes.
-include $(ALLOBJS:%.o=${DEPDIR}/%.d)
### deps.mk --- lwlib/Makefile fragment for GNU Emacs
# Copyright (C) 1992, 1993 Lucid, Inc.
# Copyright (C) 1994, 2001-2014 Free Software Foundation, Inc.
#
# This file is part of the Lucid Widget Library.
#
# The Lucid Widget Library 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 1, or (at your option)
# any later version.
#
# The Lucid Widget Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
### Commentary:
## This file is inserted in lwlib/Makefile if AUTO_DEPEND=no.
## It defines static dependencies between the various source files.
### Code:
## Generated files in ../src, non-generated in $(srcdir)/../src.
config_h = ../src/config.h $(srcdir)/../src/conf_post.h
lisp_h = $(srcdir)/../src/lisp.h
## lisp.h includes this.
src_h = $(config_h) $(lisp_h) $(globals_h)
lwlib-utils.o: $(src_h) lwlib-utils.c lwlib-utils.h lwlib.h
lwlib.o: $(src_h) lwlib.c lwlib.h lwlib-int.h lwlib-utils.h \
lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h
lwlib-Xlw.o: $(src_h) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.h
lwlib-Xaw.o: $(src_h) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h
lwlib-Xm.o: $(src_h) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
xlwmenu.o: $(src_h) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h \
$(srcdir)/../src/xterm.h
### deps.mk ends here
...@@ -438,12 +438,12 @@ echo "Making links to \`nextstep/GNUstep/Emacs.base/Resources'" ...@@ -438,12 +438,12 @@ echo "Making links to \`nextstep/GNUstep/Emacs.base/Resources'"
echo "Making links to \`oldXMenu'" echo "Making links to \`oldXMenu'"
(cd oldXMenu (cd oldXMenu
ln *.[ch] *.in ../${tempdir}/oldXMenu ln *.[ch] *.in *.mk ../${tempdir}/oldXMenu
ln README ChangeLog ../${tempdir}/oldXMenu) ln README ChangeLog ../${tempdir}/oldXMenu)
echo "Making links to \`lwlib'" echo "Making links to \`lwlib'"
(cd lwlib (cd lwlib
ln *.[ch] *.in ../${tempdir}/lwlib ln *.[ch] *.in *.mk ../${tempdir}/lwlib
ln README ChangeLog ../${tempdir}/lwlib) ln README ChangeLog ../${tempdir}/lwlib)
## It is important to distribute admin/ because it contains sources ## It is important to distribute admin/ because it contains sources
......
2014-06-28 Glenn Morris <rgm@gnu.org>
* Makefile.in: Use gcc auto-dependency information.
Move old dependency information to new file deps.mk.
(MKDIR_P, DEPFLAGS, MKDEPDIR, oldxmenu_deps_frag):
New, set by configure.
(DEPDIR): New variable.
(ALL_CFLAGS): Add DEPFLAGS.
(.c.o): Add MKDEPDIR.
(clean, mostlyclean): Delete DEPDIR.
* deps.mk, autodeps.mk: New files.
2014-06-15 Glenn Morris <rgm@gnu.org> 2014-06-15 Glenn Morris <rgm@gnu.org>
* Makefile.in (CPPFLAGS): Explicitly set via configure. * Makefile.in (CPPFLAGS): Explicitly set via configure.
......
...@@ -63,6 +63,7 @@ RM = rm -f ...@@ -63,6 +63,7 @@ RM = rm -f
RANLIB = @RANLIB@ RANLIB = @RANLIB@
AR = @AR@ AR = @AR@
ARFLAGS = @ARFLAGS@ ARFLAGS = @ARFLAGS@
MKDIR_P = @MKDIR_P@
OBJS = Activate.o \ OBJS = Activate.o \
AddPane.o \ AddPane.o \
...@@ -92,13 +93,20 @@ OBJS = Activate.o \ ...@@ -92,13 +93,20 @@ OBJS = Activate.o \
all: libXMenu11.a all: libXMenu11.a
.PHONY: all .PHONY: all
DEPDIR = deps
## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty.
DEPFLAGS = @DEPFLAGS@
## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'.
MKDEPDIR = @MKDEPDIR@
ALL_CFLAGS=$(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \ ALL_CFLAGS=$(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
$(C_SWITCH_X_SITE) \ $(C_SWITCH_X_SITE) $(DEPFLAGS) \
$(WARN_CFLAGS) $(WERROR_CFLAGS) ${PROFILING_CFLAGS} \ $(WARN_CFLAGS) $(WERROR_CFLAGS) ${PROFILING_CFLAGS} \
$(CPPFLAGS) $(CFLAGS) -DEMACS_BITMAP_FILES \ $(CPPFLAGS) $(CFLAGS) -DEMACS_BITMAP_FILES \
-I../src -I../lib -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib -I../src -I../lib -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib
.c.o: .c.o:
@$(MKDEPDIR)
$(CC) -c ${ALL_CFLAGS} $< $(CC) -c ${ALL_CFLAGS} $<
libXMenu11.a: $(OBJS) $(EXTRA) libXMenu11.a: $(OBJS) $(EXTRA)
...@@ -106,42 +114,14 @@ libXMenu11.a: $(OBJS) $(EXTRA) ...@@ -106,42 +114,14 @@ libXMenu11.a: $(OBJS) $(EXTRA)
$(AR) $(ARFLAGS) $@ $(OBJS) $(EXTRA) $(AR) $(ARFLAGS) $@ $(OBJS) $(EXTRA)
$(RANLIB) $@ $(RANLIB) $@
Activate.o: Activate.c XMenuInt.h XMenu.h X10.h ## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
AddPane.o: AddPane.c XMenuInt.h XMenu.h X10.h @oldxmenu_deps_frag@
AddSel.o: AddSel.c XMenuInt.h XMenu.h X10.h
ChgPane.o: ChgPane.c XMenuInt.h XMenu.h X10.h
ChgSel.o: ChgSel.c XMenuInt.h XMenu.h X10.h
Create.o: Create.c XMenuInt.h XMenu.h X10.h
DelPane.o: DelPane.c XMenuInt.h XMenu.h X10.h
DelSel.o: DelSel.c XMenuInt.h XMenu.h X10.h
Destroy.o: Destroy.c XMenuInt.h XMenu.h X10.h
Error.o: Error.c XMenuInt.h XMenu.h X10.h
EvHand.o: EvHand.c XMenuInt.h XMenu.h X10.h
FindPane.o: FindPane.c XMenuInt.h XMenu.h X10.h
FindSel.o: FindSel.c XMenuInt.h XMenu.h X10.h
InsPane.o: InsPane.c XMenuInt.h XMenu.h X10.h
InsSel.o: InsSel.c XMenuInt.h XMenu.h X10.h
Internal.o: Internal.c XMenuInt.h XMenu.h X10.h
Locate.o: Locate.c XMenuInt.h XMenu.h X10.h
Post.o: Post.c XMenuInt.h XMenu.h X10.h
Recomp.o: Recomp.c XMenuInt.h XMenu.h X10.h
SetAEQ.o: SetAEQ.c XMenuInt.h XMenu.h X10.h
SetFrz.o: SetFrz.c XMenuInt.h XMenu.h X10.h
SetPane.o: SetPane.c XMenuInt.h XMenu.h X10.h
SetSel.o: SetSel.c XMenuInt.h XMenu.h X10.h
XDelAssoc.o: XDelAssoc.c X10.h
XLookAssoc.o: XLookAssoc.c X10.h
XCrAssoc.o: XCrAssoc.c X10.h
XDestAssoc.o: XDestAssoc.c X10.h
XMakeAssoc.o: XMakeAssoc.c X10.h
insque.o: insque.c
.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
mostlyclean: clean mostlyclean:
rm -f libXMenu11.a ${OBJS} ${EXTRA} rm -f libXMenu11.a ${OBJS} ${EXTRA}
-rm -rf ${DEPDIR}
clean: mostlyclean
bootstrap-clean maintainer-clean distclean: clean bootstrap-clean maintainer-clean distclean: clean
rm -f Makefile rm -f Makefile
...@@ -150,3 +130,4 @@ bootstrap-clean maintainer-clean distclean: clean ...@@ -150,3 +130,4 @@ bootstrap-clean maintainer-clean distclean: clean
tags: tags:
$(TAGS) -t *.[ch] $(TAGS) -t *.[ch]
### Makefile.in ends here
### autodeps.mk --- lwlib/Makefile fragment for GNU Emacs
## This is inserted in lwlib/Makefile if AUTO_DEPEND=yes.
-include $(ALLOBJS:%.o=${DEPDIR}/%.d)
### deps.mk --- oldXMenu/Makefile fragment for GNU Emacs
## Copyright 1985, 1986, 1987 by the Massachusetts Institute of Technology
## Permission to use, copy, modify, and distribute this
## software and its documentation for any purpose and without
## fee is hereby granted, provided that the above copyright
## notice appear in all copies and that both that copyright
## notice and this permission notice appear in supporting
## documentation, and that the name of M.I.T. not be used in
## advertising or publicity pertaining to distribution of the
## software without specific, written prior permission.
## M.I.T. makes no representations about the suitability of
## this software for any purpose. It is provided "as is"
## without express or implied warranty.
## Copyright (C) 2001-2014 Free Software Foundation, Inc.
## This program 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 3 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
### Commentary:
## This file is inserted in oldXMenu/Makefile if AUTO_DEPEND=no.
## It defines static dependencies between the various source files.
### Code:
Activate.o: Activate.c XMenuInt.h XMenu.h X10.h
AddPane.o: AddPane.c XMenuInt.h XMenu.h X10.h
AddSel.o: AddSel.c XMenuInt.h XMenu.h X10.h
ChgPane.o: ChgPane.c XMenuInt.h XMenu.h X10.h
ChgSel.o: ChgSel.c XMenuInt.h XMenu.h X10.h
Create.o: Create.c XMenuInt.h XMenu.h X10.h
DelPane.o: DelPane.c XMenuInt.h XMenu.h X10.h
DelSel.o: DelSel.c XMenuInt.h XMenu.h X10.h
Destroy.o: Destroy.c XMenuInt.h XMenu.h X10.h
Error.o: Error.c XMenuInt.h XMenu.h X10.h
EvHand.o: EvHand.c XMenuInt.h XMenu.h X10.h
FindPane.o: FindPane.c XMenuInt.h XMenu.h X10.h
FindSel.o: FindSel.c XMenuInt.h XMenu.h X10.h
InsPane.o: InsPane.c XMenuInt.h XMenu.h X10.h
InsSel.o: InsSel.c XMenuInt.h XMenu.h X10.h
Internal.o: Internal.c XMenuInt.h XMenu.h X10.h
Locate.o: Locate.c XMenuInt.h XMenu.h X10.h
Post.o: Post.c XMenuInt.h XMenu.h X10.h
Recomp.o: Recomp.c XMenuInt.h XMenu.h X10.h
SetAEQ.o: SetAEQ.c XMenuInt.h XMenu.h X10.h
SetFrz.o: SetFrz.c XMenuInt.h XMenu.h X10.h
SetPane.o: SetPane.c XMenuInt.h XMenu.h X10.h
SetSel.o: SetSel.c XMenuInt.h XMenu.h X10.h
XDelAssoc.o: XDelAssoc.c X10.h
XLookAssoc.o: XLookAssoc.c X10.h
XCrAssoc.o: XCrAssoc.c X10.h
XDestAssoc.o: XDestAssoc.c X10.h
XMakeAssoc.o: XMakeAssoc.c X10.h
insque.o: insque.c
### deps.mk ends here
### deps.mk --- src/Makefile fragment for GNU Emacs ### deps.mk --- src/Makefile fragment for GNU Emacs
## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014 Free Software ## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014
## Foundation, Inc. ## Free Software Foundation, Inc.
## This file is part of GNU Emacs. ## This file is part of GNU Emacs.
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
## Eg callproc.c only depends on w32.h for WINDOWSNT builds. ## Eg callproc.c only depends on w32.h for WINDOWSNT builds.
## One way to fix this would be to replace w32.h (etc) by $(W32_H), ## One way to fix this would be to replace w32.h (etc) by $(W32_H),
## a variable set by configure. Does not seem worth the trouble. ## a variable set by configure. Does not seem worth the trouble.
## Since the w32 build does not even use this file, you might ask
## why these dependencies are here at all...
## nsgui.h: In fact, every .o file depends directly or indirectly on ## nsgui.h: In fact, every .o file depends directly or indirectly on
## dispextern.h and hence nsgui.h under NS. But the ones that actually ## dispextern.h and hence nsgui.h under NS. But the ones that actually
......
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