Many changes from Franc,ois
[automake.git] / depend.am
blob2ebc5d6c994d7e7c3967fbd5aa0cfa3ef1383bd2
1 # This fragment is probably only useful for maintainers.  It relies on
2 # GNU make and gcc.  It is only included in the generated Makefile.in
3 # if `automake' is not passed the `--include-deps' flag.
5 MKDEP = gcc -MM $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
7 ## Use $(kr) in case we are doing auto-deANSIfication.
8 DEP_FILES = $(patsubst %.$(kr)o, $(srcdir)/.deps/%.P,$(OBJECTS))
10 ## We use ".P" as the name of our placeholder because it can't be
11 ## duplicated by any C source file.  (Well, there could be ".c", but
12 ## no one does that in practice)
13 -include $(srcdir)/.deps/.P
14 $(srcdir)/.deps/.P:
15         cd $(srcdir) && test -d .deps || mkdir .deps
16 ## Use ":" here and not "echo timestamp".  Otherwise GNU Make barfs:
17 ## .deps/.P:1: *** missing separator.  Stop.
18         : > $@
20 -include $(DEP_FILES)
21 $(DEP_FILES): $(srcdir)/.deps/.P
23 $(srcdir)/.deps/%.P: $(srcdir)/%.c
24         @echo "mkdeps $< > $@"
25         @$(MKDEP) $< | sed 's,$(srcdir)/,,g' > $@-tmp
26         @mv $@-tmp $@
28 # End of maintainer-only section