aboutsummaryrefslogtreecommitdiffstats
path: root/lwlib
diff options
context:
space:
mode:
authorGlenn Morris2014-06-28 15:57:23 -0700
committerGlenn Morris2014-06-28 15:57:23 -0700
commit93160ec3928b5efd654824dfc727d1bbec3c0aec (patch)
treedbca945901d1ff3d2d21e5b20f18ae76d6b134f7 /lwlib
parente0d9c3c9a26ba2982595ec2ec4a1167ee7e39ddb (diff)
downloademacs-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/ChangeLog12
-rw-r--r--lwlib/Makefile.in28
-rw-r--r--lwlib/autodeps.mk5
-rw-r--r--lwlib/deps.mk43
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 @@
12014-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
12014-06-17 Paul Eggert <eggert@cs.ucla.edu> 132014-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
42AR = @AR@ 42AR = @AR@
43ARFLAGS = @ARFLAGS@ 43ARFLAGS = @ARFLAGS@
44MKDIR_P = @MKDIR_P@
44 45
45LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o 46LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o
46MOTIF_OBJS = lwlib-Xm.o 47MOTIF_OBJS = lwlib-Xm.o
@@ -50,13 +51,19 @@ TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS)
50 51
51OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o 52OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o
52 53
54DEPDIR = deps
55## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty.
56DEPFLAGS = @DEPFLAGS@
57## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'.
58MKDEPDIR = @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.
58ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ 65ALL_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
70liblw.a: $(OBJS) 78liblw.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.
76config_h = ../src/config.h $(srcdir)/../src/conf_post.h
77lisp_h = $(srcdir)/../src/lisp.h
78## lisp.h includes this.
79globals_h = ../src/globals.h 83globals_h = ../src/globals.h
80src_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
85lwlib-utils.o: $(src_h) lwlib-utils.c lwlib-utils.h lwlib.h 87## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
86lwlib.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
88lwlib-Xlw.o: $(src_h) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.h
89lwlib-Xaw.o: $(src_h) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h
90lwlib-Xm.o: $(src_h) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
91xlwmenu.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
97clean mostlyclean: 92clean mostlyclean:
98 rm -f *.o liblw.a \#* 93 rm -f *.o liblw.a \#*
94 -rm -rf ${DEPDIR}
99 95
100distclean: clean 96distclean: 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.
29config_h = ../src/config.h $(srcdir)/../src/conf_post.h
30lisp_h = $(srcdir)/../src/lisp.h
31## lisp.h includes this.
32src_h = $(config_h) $(lisp_h) $(globals_h)
33
34lwlib-utils.o: $(src_h) lwlib-utils.c lwlib-utils.h lwlib.h
35lwlib.o: $(src_h) lwlib.c lwlib.h lwlib-int.h lwlib-utils.h \
36 lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h
37lwlib-Xlw.o: $(src_h) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.h
38lwlib-Xaw.o: $(src_h) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h
39lwlib-Xm.o: $(src_h) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
40xlwmenu.o: $(src_h) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h \
41 $(srcdir)/../src/xterm.h
42
43### deps.mk ends here