summaryrefslogtreecommitdiff
path: root/Makerules.in
diff options
context:
space:
mode:
Diffstat (limited to 'Makerules.in')
-rw-r--r--Makerules.in28
1 files changed, 12 insertions, 16 deletions
diff --git a/Makerules.in b/Makerules.in
index 271cf7c..7538834 100644
--- a/Makerules.in
+++ b/Makerules.in
@@ -94,14 +94,18 @@ ASFLAGS += -DASSEMBLER
# Building from foo.cli
.PRECIOUS: %_user.c
-%.h %_user.c: %.cli
- $(MIG) $(MIGFLAGS) -header $*.h -user $*_user.c -server /dev/null $<
+%.h %_user.c %.cli.d: %.cli
+ $(MIG) $(MIGFLAGS) -MD \
+ -header $*.h -user $*_user.c -server /dev/null $<
+ mv $*-mig.d $*.cli.d
# Building from foo.srv
.PRECIOUS: %_server.c
-%_interface.h %_server.c: %.srv
- $(MIG) $(MIGFLAGS) -sheader $*_interface.h -server $*_server.c \
- -header /dev/null -user /dev/null $<
+%_interface.h %_server.c %.srv.d: %.srv
+ $(MIG) $(MIGFLAGS) -MD \
+ -sheader $*_interface.h -server $*_server.c \
+ -header /dev/null -user /dev/null $<
+ mv $*-mig.d $*.srv.d
# gzip files
%.gz: %
@@ -123,23 +127,15 @@ endif
# Include dependency files
ifneq ($(no_deps),t)
-# For each file generated by MiG we need a .d file.
--include $(subst _server.o,.migs.d,$(servers)) /dev/null
--include $(subst _user.o,.migu.d,$(users)) /dev/null
+# The MIG stubs depend on their definition files.
+-include $(subst _server.o,.srv.d,$(servers)) /dev/null
+-include $(subst _user.o,.cli.d,$(users)) /dev/null
# For each .o file we need a .d file.
-include $(subst .o,.d,$(filter %.o,$(objfiles))) /dev/null
endif
-# Here is how to make those dependency files
-%.migs.d: %.srv
- (set -e; $(CPP) $(MIGFLAGS) -M -MG -x c $< | \
- sed -e 's/[^:]*:/$*_server.c $*_interface.h $@:/' > $@)
-%.migu.d: %.cli
- (set -e; $(CPP) $(MIGFLAGS) -M -MG -x c $< | \
- sed -e 's/[^:]*:/$*_user.c $*.h $@:/' > $@)
-
# Generic rule for $(CC) based compilation for making dependencies
define make-deps
set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \