diff options
| author | Glenn Morris | 2014-06-28 15:57:23 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-06-28 15:57:23 -0700 |
| commit | 93160ec3928b5efd654824dfc727d1bbec3c0aec (patch) | |
| tree | dbca945901d1ff3d2d21e5b20f18ae76d6b134f7 /lwlib | |
| parent | e0d9c3c9a26ba2982595ec2ec4a1167ee7e39ddb (diff) | |
| download | emacs-93160ec3928b5efd654824dfc727d1bbec3c0aec.tar.gz emacs-93160ec3928b5efd654824dfc727d1bbec3c0aec.zip | |
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.
Diffstat (limited to 'lwlib')
| -rw-r--r-- | lwlib/ChangeLog | 12 | ||||
| -rw-r--r-- | lwlib/Makefile.in | 28 | ||||
| -rw-r--r-- | lwlib/autodeps.mk | 5 | ||||
| -rw-r--r-- | lwlib/deps.mk | 43 |
4 files changed, 72 insertions, 16 deletions
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 430add5a8b6..20ace660739 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2014-06-28 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * Makefile.in: Use gcc auto-dependency information. | ||
| 4 | Move old dependency information to new file deps.mk. | ||
| 5 | (MKDIR_P, DEPFLAGS, MKDEPDIR, lwlib_deps_frag): | ||
| 6 | New, set by configure. | ||
| 7 | (DEPDIR): New variable. | ||
| 8 | (ALL_CFLAGS): Add DEPFLAGS. | ||
| 9 | (.c.o): Add MKDEPDIR. | ||
| 10 | (clean, mostlyclean): Delete DEPDIR. | ||
| 11 | * deps.mk, autodeps.mk: New files. | ||
| 12 | |||
| 1 | 2014-06-17 Paul Eggert <eggert@cs.ucla.edu> | 13 | 2014-06-17 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 14 | ||
| 3 | Omit redundant extern decls. | 15 | Omit redundant extern decls. |
diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in index 7185aa60727..516b3286951 100644 --- a/lwlib/Makefile.in +++ b/lwlib/Makefile.in | |||
| @@ -41,6 +41,7 @@ RANLIB=@RANLIB@ | |||
| 41 | 41 | ||
| 42 | AR = @AR@ | 42 | AR = @AR@ |
| 43 | ARFLAGS = @ARFLAGS@ | 43 | ARFLAGS = @ARFLAGS@ |
| 44 | MKDIR_P = @MKDIR_P@ | ||
| 44 | 45 | ||
| 45 | LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o | 46 | LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o |
| 46 | MOTIF_OBJS = lwlib-Xm.o | 47 | MOTIF_OBJS = lwlib-Xm.o |
| @@ -50,13 +51,19 @@ TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS) | |||
| 50 | 51 | ||
| 51 | OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o | 52 | OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o |
| 52 | 53 | ||
| 54 | DEPDIR = deps | ||
| 55 | ## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty. | ||
| 56 | DEPFLAGS = @DEPFLAGS@ | ||
| 57 | ## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'. | ||
| 58 | MKDEPDIR = @MKDEPDIR@ | ||
| 59 | |||
| 53 | ## ../src is where the generated file (config.h, globals.h) are. | 60 | ## ../src is where the generated file (config.h, globals.h) are. |
| 54 | ## $(srcdir)/../src is where the non-generated files (lisp.h) are. | 61 | ## $(srcdir)/../src is where the non-generated files (lisp.h) are. |
| 55 | ## (In an out-of-tree build, these two are not the same.) | 62 | ## (In an out-of-tree build, these two are not the same.) |
| 56 | ## $(srcdir) is where the lwlib sources are. | 63 | ## $(srcdir) is where the lwlib sources are. |
| 57 | ## There are no generated lwlib files, hence no need for -I. | 64 | ## There are no generated lwlib files, hence no need for -I. |
| 58 | ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ | 65 | ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ |
| 59 | $(C_SWITCH_MACHINE) \ | 66 | $(C_SWITCH_MACHINE) $(DEPFLAGS) \ |
| 60 | $(WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \ | 67 | $(WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \ |
| 61 | -Demacs -I../src \ | 68 | -Demacs -I../src \ |
| 62 | -I$(srcdir) -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib | 69 | -I$(srcdir) -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib |
| @@ -65,6 +72,7 @@ all: liblw.a | |||
| 65 | .PHONY: all | 72 | .PHONY: all |
| 66 | 73 | ||
| 67 | .c.o: | 74 | .c.o: |
| 75 | @$(MKDEPDIR) | ||
| 68 | $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< | 76 | $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< |
| 69 | 77 | ||
| 70 | liblw.a: $(OBJS) | 78 | liblw.a: $(OBJS) |
| @@ -72,30 +80,18 @@ liblw.a: $(OBJS) | |||
| 72 | $(AR) $(ARFLAGS) $@ $(OBJS) | 80 | $(AR) $(ARFLAGS) $@ $(OBJS) |
| 73 | $(RANLIB) $@ | 81 | $(RANLIB) $@ |
| 74 | 82 | ||
| 75 | ## Generated files in ../src, non-generated in $(srcdir)/../src. | ||
| 76 | config_h = ../src/config.h $(srcdir)/../src/conf_post.h | ||
| 77 | lisp_h = $(srcdir)/../src/lisp.h | ||
| 78 | ## lisp.h includes this. | ||
| 79 | globals_h = ../src/globals.h | 83 | globals_h = ../src/globals.h |
| 80 | src_h = $(config_h) $(lisp_h) $(globals_h) | ||
| 81 | |||
| 82 | $(globals_h): | 84 | $(globals_h): |
| 83 | $(MAKE) -C ../src globals.h | 85 | $(MAKE) -C ../src globals.h |
| 84 | 86 | ||
| 85 | lwlib-utils.o: $(src_h) lwlib-utils.c lwlib-utils.h lwlib.h | 87 | ## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk. |
| 86 | lwlib.o: $(src_h) lwlib.c lwlib.h lwlib-int.h lwlib-utils.h \ | 88 | @lwlib_deps_frag@ |
| 87 | lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h | ||
| 88 | lwlib-Xlw.o: $(src_h) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.h | ||
| 89 | lwlib-Xaw.o: $(src_h) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h | ||
| 90 | lwlib-Xm.o: $(src_h) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h | ||
| 91 | xlwmenu.o: $(src_h) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h \ | ||
| 92 | $(srcdir)/../src/xterm.h | ||
| 93 | |||
| 94 | 89 | ||
| 95 | .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean | 90 | .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean |
| 96 | 91 | ||
| 97 | clean mostlyclean: | 92 | clean mostlyclean: |
| 98 | rm -f *.o liblw.a \#* | 93 | rm -f *.o liblw.a \#* |
| 94 | -rm -rf ${DEPDIR} | ||
| 99 | 95 | ||
| 100 | distclean: clean | 96 | distclean: clean |
| 101 | rm -f Makefile | 97 | rm -f Makefile |
diff --git a/lwlib/autodeps.mk b/lwlib/autodeps.mk new file mode 100644 index 00000000000..f7109295ce2 --- /dev/null +++ b/lwlib/autodeps.mk | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | ### autodeps.mk --- lwlib/Makefile fragment for GNU Emacs | ||
| 2 | |||
| 3 | ## This is inserted in lwlib/Makefile if AUTO_DEPEND=yes. | ||
| 4 | |||
| 5 | -include $(ALLOBJS:%.o=${DEPDIR}/%.d) | ||
diff --git a/lwlib/deps.mk b/lwlib/deps.mk new file mode 100644 index 00000000000..6355ec62e62 --- /dev/null +++ b/lwlib/deps.mk | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | ### deps.mk --- lwlib/Makefile fragment for GNU Emacs | ||
| 2 | |||
| 3 | # Copyright (C) 1992, 1993 Lucid, Inc. | ||
| 4 | # Copyright (C) 1994, 2001-2014 Free Software Foundation, Inc. | ||
| 5 | # | ||
| 6 | # This file is part of the Lucid Widget Library. | ||
| 7 | # | ||
| 8 | # The Lucid Widget Library is free software; you can redistribute it and/or | ||
| 9 | # modify it under the terms of the GNU General Public License as published by | ||
| 10 | # the Free Software Foundation; either version 1, or (at your option) | ||
| 11 | # any later version. | ||
| 12 | # | ||
| 13 | # The Lucid Widget Library is distributed in the hope that it will be useful, | ||
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | # GNU General Public License for more details. | ||
| 17 | # | ||
| 18 | # You should have received a copy of the GNU General Public License | ||
| 19 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 20 | |||
| 21 | ### Commentary: | ||
| 22 | |||
| 23 | ## This file is inserted in lwlib/Makefile if AUTO_DEPEND=no. | ||
| 24 | ## It defines static dependencies between the various source files. | ||
| 25 | |||
| 26 | ### Code: | ||
| 27 | |||
| 28 | ## Generated files in ../src, non-generated in $(srcdir)/../src. | ||
| 29 | config_h = ../src/config.h $(srcdir)/../src/conf_post.h | ||
| 30 | lisp_h = $(srcdir)/../src/lisp.h | ||
| 31 | ## lisp.h includes this. | ||
| 32 | src_h = $(config_h) $(lisp_h) $(globals_h) | ||
| 33 | |||
| 34 | lwlib-utils.o: $(src_h) lwlib-utils.c lwlib-utils.h lwlib.h | ||
| 35 | lwlib.o: $(src_h) lwlib.c lwlib.h lwlib-int.h lwlib-utils.h \ | ||
| 36 | lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h | ||
| 37 | lwlib-Xlw.o: $(src_h) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.h | ||
| 38 | lwlib-Xaw.o: $(src_h) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h | ||
| 39 | lwlib-Xm.o: $(src_h) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h | ||
| 40 | xlwmenu.o: $(src_h) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h \ | ||
| 41 | $(srcdir)/../src/xterm.h | ||
| 42 | |||
| 43 | ### deps.mk ends here | ||