From 3dfcec768d93d3b332ff2402066e808c52f08c13 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 7 Jan 2014 11:36:12 +0100 Subject: [PATCH] makefiles: Always create dependencies from the top-level directory. --- Make.rules.in | 7 ------- tools/makedep.c | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Make.rules.in b/Make.rules.in index 7e6a09d2e57..947419e2cb8 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -20,13 +20,6 @@ OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(OBJC_SRCS: ALLCROSSCFLAGS = $(CPPFLAGS) $(CFLAGS) -# Rules for dependencies - -depend: dummy - $(MAKEDEP) -M . - -.PHONY: depend - # Rules for cleaning clean:: diff --git a/tools/makedep.c b/tools/makedep.c index 7f8e51872a1..20b10644af2 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -1944,6 +1944,7 @@ static struct strarray output_sources(void) output( "\t$(RM)" ); output_filenames( clean_files ); output( "\n" ); + strarray_add( &phony_targets, "clean" ); } if (subdirs.count) @@ -1953,6 +1954,13 @@ static struct strarray output_sources(void) output( "\t$(MKDIR_P) -m 755 $@\n" ); } + if (top_obj_dir) + { + output( "depend:\n" ); + output( "\t@cd %s && $(MAKE) %s/depend\n", top_obj_dir, base_dir ); + strarray_add( &phony_targets, "depend" ); + } + if (phony_targets.count) { output( ".PHONY:" );