makefiles: Always create dependencies from the top-level directory.
This commit is contained in:
parent
0d533cf0bd
commit
3dfcec768d
|
@ -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::
|
||||
|
|
|
@ -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:" );
|
||||
|
|
Loading…
Reference in New Issue