makefiles: Always create dependencies from the top-level directory.

This commit is contained in:
Alexandre Julliard 2014-01-07 11:36:12 +01:00
parent 0d533cf0bd
commit 3dfcec768d
2 changed files with 8 additions and 7 deletions

View File

@ -20,13 +20,6 @@ OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(OBJC_SRCS:
ALLCROSSCFLAGS = $(CPPFLAGS) $(CFLAGS) ALLCROSSCFLAGS = $(CPPFLAGS) $(CFLAGS)
# Rules for dependencies
depend: dummy
$(MAKEDEP) -M .
.PHONY: depend
# Rules for cleaning # Rules for cleaning
clean:: clean::

View File

@ -1944,6 +1944,7 @@ static struct strarray output_sources(void)
output( "\t$(RM)" ); output( "\t$(RM)" );
output_filenames( clean_files ); output_filenames( clean_files );
output( "\n" ); output( "\n" );
strarray_add( &phony_targets, "clean" );
} }
if (subdirs.count) if (subdirs.count)
@ -1953,6 +1954,13 @@ static struct strarray output_sources(void)
output( "\t$(MKDIR_P) -m 755 $@\n" ); 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) if (phony_targets.count)
{ {
output( ".PHONY:" ); output( ".PHONY:" );