makedep: Output source dependency for bison files needed for parallel makes.

This commit is contained in:
Alexandre Julliard 2010-03-16 13:27:51 +01:00
parent 5eb4b094a3
commit 133d4cde26
1 changed files with 16 additions and 0 deletions

View File

@ -261,6 +261,18 @@ static INCL_FILE *find_src_file( const char *name )
return NULL;
}
/*******************************************************************
* find_include_file
*/
static INCL_FILE *find_include_file( const char *name )
{
INCL_FILE *file;
LIST_FOR_EACH_ENTRY( file, &includes, INCL_FILE, entry )
if (!strcmp( name, file->name )) return file;
return NULL;
}
/*******************************************************************
* add_include
*
@ -829,6 +841,10 @@ static int output_src( FILE *file, INCL_FILE *pFile, int *column )
*ext++ = 0;
if (!strcmp( ext, "y" )) /* yacc file */
{
/* add source file dependency for parallel makes */
char *header = strmake( "%s.tab.h", obj );
if (find_include_file( header )) fprintf( file, "%s.tab.c: %s\n", obj, header );
free( header );
*column += fprintf( file, "%s.tab.o: %s.tab.c", obj, obj );
}
else if (!strcmp( ext, "l" )) /* lex file */