summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--Makeconf50
2 files changed, 32 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 20264676..04a6f3b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-07-24 Thomas Schwinge <tschwinge@gnu.org>
+
+ [bug #17127]
+ * Makeconf (clean): Don't remove `*.*_d' files.
+ (%.sdefsi): Add `%.sdefs.d' to the target list. Create these files by
+ specifying `-MD' as a flag for CPP and mangle the output as needed.
+ Include these `*.sdefs.d' files instead of `*.migs_d' and `*.migsh_d'
+ files.
+ (%.udefsi): Likewise for `%.udefs.d' / `*.migu_d' and `*.miguh_d'.
+ (%.migs_d, %.migu_d, %.migsh_d, %.miguh_d): Remove targets.
+
2006-03-21 Leonardo Lopes Pereira <leonardolopespereira@gmail.com>
[patch #4984]
diff --git a/Makeconf b/Makeconf
index b5cc6610..cc3d48ab 100644
--- a/Makeconf
+++ b/Makeconf
@@ -426,7 +426,7 @@ endif
# Cleaning
ifeq ($(clean),yes)
clean:
- rm -f *.d *.*_d *.o *Server.c *User.c *_S.h *_U.h *.[su]defsi \
+ rm -f *.d *.o *Server.c *User.c *_S.h *_U.h *.[su]defsi \
$(cleantarg)
relink:
rm -f $(linktarg)
@@ -512,15 +512,28 @@ MIGCOMFLAGS := -subrprefix __
# These chained rules could be (and used to be) single rules using pipes.
# But it's convenient to be able to explicitly make the intermediate
# files when you want to deal with a problem in the MiG stub generator.
+
+%.sdefsi %.sdefs.d: %.defs
+ $(CPP) $(CPPFLAGS) $(MIGSFLAGS) $($*-MIGSFLAGS) -DSERVERPREFIX=S_ \
+ -MD -MF $*.sdefs.d.new \
+ $< -o $*.sdefsi
+ sed -e 's/[^:]*:/$*Server.c $(mig-sheader-prefix)$*_S.h:/' \
+ < $*.sdefs.d.new > $*.sdefs.d
+ rm $*.sdefs.d.new
+
$(mig-sheader-prefix)%_S.h %Server.c: %.sdefsi
$(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) $($*-MIGCOMSFLAGS) \
-sheader $(mig-sheader-prefix)$*_S.h -server $*Server.c \
-user /dev/null -header /dev/null < $<
-%.sdefsi: %.defs
- $(CPP) $(CPPFLAGS) $(MIGSFLAGS) $($*-MIGSFLAGS) -DSERVERPREFIX=S_ $< -o $@
-%.udefsi: %.defs
- $(CPP) $(CPPFLAGS) $(MIGUFLAGS) $($*-MIGUFLAGS) $< -o $@
+%.udefsi %.udefs.d: %.defs
+ $(CPP) $(CPPFLAGS) $(MIGUFLAGS) $($*-MIGUFLAGS) \
+ -MD -MF $*.udefs.d.new \
+ $< -o $*.udefsi
+ sed -e 's/[^:]*:/$*User.c $*_U.h:/' \
+ < $*.udefs.d.new > $*.udefs.d
+ rm $*.udefs.d.new
+
%_U.h %User.c: %.udefsi
$(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) $($*-MIGCOMUFLAGS) < $< \
-user $*User.c -server /dev/null -header $*_U.h
@@ -554,13 +567,11 @@ FORCE:
ifneq ($(no_deps),t)
-# For each file generated by MiG we need a .d file.
+# The MIG stubs depend on their definition files.
# These lines assume that every Makefile that uses a foo_S.h or foo_U.h file
# also mentions the associated fooServer.o or fooUser.o file.
--include $(subst Server.o,.migs_d,$(filter %Server.o,$(OBJS))) /dev/null
--include $(subst User.o,.migu_d,$(filter %User.o,$(OBJS))) /dev/null
--include $(subst Server.o,.migsh_d,$(filter %Server.o,$(OBJS))) /dev/null
--include $(subst User.o,.miguh_d,$(filter %User.o,$(OBJS))) /dev/null
+-include $(subst Server.o,.sdefs.d,$(filter %Server.o,$(OBJS))) /dev/null
+-include $(subst User.o,.udefs.d,$(filter %User.o,$(OBJS))) /dev/null
ifneq ($(prof-depend),t)
ifneq ($(no_prof),t)
@@ -575,25 +586,6 @@ endif
# Here is how to build those dependency files
-# Dependencies for fooServer.c files.
-%.migs_d: %.defs
- (set -e; $(CPP) $(CPPFLAGS) $(MIGSFLAGS) $($*-MIGSFLAGS) \
- -DSERVERPREFIX=S_ -M -MG $< | \
- sed -e 's/\.defs\.o:/Server\.c $@:/' > $@)
-
-# Dependencies for fooUser.c files.
-%.migu_d: %.defs
- (set -e; $(CPP) $(CPPFLAGS) $(MIGUFLAGS) $($*-MIGUFLAGS) \
- -M -MG $< | \
- sed -e 's/\.defs\.o:/User\.c $@:/' > $@)
-
-# The associated .h files are build by the same CCP, so a simple massaging
-# of the previous two will work.
-%.migsh_d: %.migs_d
- sed -e 's/Server\.c/_S\.h/' -e 's/migs_d/migsh_d/' < $< > $@
-%.miguh_d: %.migu_d
- sed -e 's/User\.c/_U\.h/' -e 's/migu_d/miguh_d/' < $< > $@
-
%.prof_d: $(srcdir)/Makefile
$(MAKE) $* prof-depend=t