diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2006-07-24 19:10:47 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2006-07-24 19:10:47 +0000 |
commit | 48a0321569769612f114b65b0df51d4fe3072739 (patch) | |
tree | 890a066e0e1d9244c181d925be2c50278524c374 /Makeconf | |
parent | 02faca19a73393d85e3875de9e4f349b4f839ee0 (diff) |
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.
Diffstat (limited to 'Makeconf')
-rw-r--r-- | Makeconf | 50 |
1 files changed, 21 insertions, 29 deletions
@@ -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 |