makefiles: Automatically create object sub-directories when needed.
This commit is contained in:
parent
070147a034
commit
73d1fa977a
|
@ -678,13 +678,6 @@ dnl Usage: WINE_APPEND_RULE(rule)
|
|||
dnl
|
||||
AC_DEFUN([WINE_APPEND_RULE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_rule "$1"])
|
||||
|
||||
dnl **** Create nonexistent directories from config.status ****
|
||||
dnl
|
||||
dnl Usage: WINE_CONFIG_EXTRA_DIR(dirname)
|
||||
dnl
|
||||
AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
|
||||
[AC_CONFIG_COMMANDS([$1],[test -d "$1" || { AC_MSG_NOTICE([creating $1]); AS_MKDIR_P("$1"); }])])
|
||||
|
||||
dnl **** Create symlinks from config.status ****
|
||||
dnl
|
||||
dnl Usage: WINE_CONFIG_SYMLINK(target,src,files,enable,srcfile)
|
||||
|
|
|
@ -16702,21 +16702,6 @@ ac_config_links="$ac_config_links wine64:tools/winewrapper"
|
|||
wine_fn_config_symlink wine64
|
||||
fi
|
||||
|
||||
ac_config_commands="$ac_config_commands dlls/gdi32/dibdrv"
|
||||
|
||||
ac_config_commands="$ac_config_commands dlls/gdi32/enhmfdrv"
|
||||
|
||||
ac_config_commands="$ac_config_commands dlls/gdi32/mfdrv"
|
||||
|
||||
ac_config_commands="$ac_config_commands dlls/kernel32/nls"
|
||||
|
||||
ac_config_commands="$ac_config_commands dlls/user32/resources"
|
||||
|
||||
ac_config_commands="$ac_config_commands dlls/wineps.drv/data"
|
||||
|
||||
ac_config_commands="$ac_config_commands include/wine"
|
||||
|
||||
|
||||
wine_fn_config_makerules Make.rules
|
||||
MAKE_RULES=Make.rules
|
||||
ac_config_files="$ac_config_files Make.rules"
|
||||
|
@ -18294,13 +18279,6 @@ do
|
|||
"po/LINGUAS") CONFIG_LINKS="$CONFIG_LINKS po/LINGUAS:po/LINGUAS" ;;
|
||||
"wine") CONFIG_LINKS="$CONFIG_LINKS wine:tools/winewrapper" ;;
|
||||
"wine64") CONFIG_LINKS="$CONFIG_LINKS wine64:tools/winewrapper" ;;
|
||||
"dlls/gdi32/dibdrv") CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/gdi32/dibdrv" ;;
|
||||
"dlls/gdi32/enhmfdrv") CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/gdi32/enhmfdrv" ;;
|
||||
"dlls/gdi32/mfdrv") CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/gdi32/mfdrv" ;;
|
||||
"dlls/kernel32/nls") CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/kernel32/nls" ;;
|
||||
"dlls/user32/resources") CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/user32/resources" ;;
|
||||
"dlls/wineps.drv/data") CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/wineps.drv/data" ;;
|
||||
"include/wine") CONFIG_COMMANDS="$CONFIG_COMMANDS include/wine" ;;
|
||||
"Make.rules") CONFIG_FILES="$CONFIG_FILES Make.rules" ;;
|
||||
"Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
|
||||
"Make.tmp") CONFIG_FILES="$CONFIG_FILES Make.tmp:Make.vars.in:Makefile.in" ;;
|
||||
|
@ -18938,20 +18916,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
|
|||
|
||||
case $ac_file$ac_mode in
|
||||
"include/stamp-h":C) echo timestamp > include/stamp-h ;;
|
||||
"dlls/gdi32/dibdrv":C) test -d "dlls/gdi32/dibdrv" || { { $as_echo "$as_me:${as_lineno-$LINENO}: creating dlls/gdi32/dibdrv" >&5
|
||||
$as_echo "$as_me: creating dlls/gdi32/dibdrv" >&6;}; as_dir="dlls/gdi32/dibdrv"; as_fn_mkdir_p; } ;;
|
||||
"dlls/gdi32/enhmfdrv":C) test -d "dlls/gdi32/enhmfdrv" || { { $as_echo "$as_me:${as_lineno-$LINENO}: creating dlls/gdi32/enhmfdrv" >&5
|
||||
$as_echo "$as_me: creating dlls/gdi32/enhmfdrv" >&6;}; as_dir="dlls/gdi32/enhmfdrv"; as_fn_mkdir_p; } ;;
|
||||
"dlls/gdi32/mfdrv":C) test -d "dlls/gdi32/mfdrv" || { { $as_echo "$as_me:${as_lineno-$LINENO}: creating dlls/gdi32/mfdrv" >&5
|
||||
$as_echo "$as_me: creating dlls/gdi32/mfdrv" >&6;}; as_dir="dlls/gdi32/mfdrv"; as_fn_mkdir_p; } ;;
|
||||
"dlls/kernel32/nls":C) test -d "dlls/kernel32/nls" || { { $as_echo "$as_me:${as_lineno-$LINENO}: creating dlls/kernel32/nls" >&5
|
||||
$as_echo "$as_me: creating dlls/kernel32/nls" >&6;}; as_dir="dlls/kernel32/nls"; as_fn_mkdir_p; } ;;
|
||||
"dlls/user32/resources":C) test -d "dlls/user32/resources" || { { $as_echo "$as_me:${as_lineno-$LINENO}: creating dlls/user32/resources" >&5
|
||||
$as_echo "$as_me: creating dlls/user32/resources" >&6;}; as_dir="dlls/user32/resources"; as_fn_mkdir_p; } ;;
|
||||
"dlls/wineps.drv/data":C) test -d "dlls/wineps.drv/data" || { { $as_echo "$as_me:${as_lineno-$LINENO}: creating dlls/wineps.drv/data" >&5
|
||||
$as_echo "$as_me: creating dlls/wineps.drv/data" >&6;}; as_dir="dlls/wineps.drv/data"; as_fn_mkdir_p; } ;;
|
||||
"include/wine":C) test -d "include/wine" || { { $as_echo "$as_me:${as_lineno-$LINENO}: creating include/wine" >&5
|
||||
$as_echo "$as_me: creating include/wine" >&6;}; as_dir="include/wine"; as_fn_mkdir_p; } ;;
|
||||
"Makefile":C) wine_fn_output_makefile Makefile ;;
|
||||
"tools":C) as_dir=tools; as_fn_mkdir_p ;;
|
||||
|
||||
|
|
|
@ -2673,14 +2673,6 @@ WINE_CONFIG_SYMLINK(po,po,[LINGUAS])
|
|||
WINE_CONFIG_SYMLINK(,tools,[wine],,winewrapper)
|
||||
WINE_CONFIG_SYMLINK(,tools,[wine64],enable_win64,winewrapper)
|
||||
|
||||
WINE_CONFIG_EXTRA_DIR(dlls/gdi32/dibdrv)
|
||||
WINE_CONFIG_EXTRA_DIR(dlls/gdi32/enhmfdrv)
|
||||
WINE_CONFIG_EXTRA_DIR(dlls/gdi32/mfdrv)
|
||||
WINE_CONFIG_EXTRA_DIR(dlls/kernel32/nls)
|
||||
WINE_CONFIG_EXTRA_DIR(dlls/user32/resources)
|
||||
WINE_CONFIG_EXTRA_DIR(dlls/wineps.drv/data)
|
||||
WINE_CONFIG_EXTRA_DIR(include/wine)
|
||||
|
||||
WINE_CONFIG_MAKERULES([Make.rules],[MAKE_RULES])
|
||||
|
||||
WINE_CONFIG_DLL(acledit)
|
||||
|
|
|
@ -290,6 +290,18 @@ static void strarray_insert( struct strarray *array, unsigned int pos, const cha
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* strarray_add_uniq
|
||||
*/
|
||||
static void strarray_add_uniq( struct strarray *array, const char *str )
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < array->count; i++) if (!strcmp( array->str[i], str )) return;
|
||||
strarray_add( array, str );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* output_filename
|
||||
*/
|
||||
|
@ -1177,6 +1189,7 @@ static void output_sources(void)
|
|||
|
||||
LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
|
||||
{
|
||||
char *sourcedep;
|
||||
char *obj = xstrdup( source->name );
|
||||
char *ext = get_extension( obj );
|
||||
|
||||
|
@ -1184,6 +1197,15 @@ static void output_sources(void)
|
|||
*ext++ = 0;
|
||||
column = 0;
|
||||
|
||||
if (src_dir && strchr( obj, '/' ))
|
||||
{
|
||||
char *dir = xstrdup( obj );
|
||||
*strrchr( dir, '/' ) = 0;
|
||||
strarray_add_uniq( &subdirs, dir );
|
||||
sourcedep = strmake( "%s %s", dir, source->filename );
|
||||
}
|
||||
else sourcedep = xstrdup( source->filename );
|
||||
|
||||
if (!strcmp( ext, "y" )) /* yacc file */
|
||||
{
|
||||
/* add source file dependency for parallel makes */
|
||||
|
@ -1191,13 +1213,13 @@ static void output_sources(void)
|
|||
|
||||
if (find_include_file( header ))
|
||||
{
|
||||
output( "%s.tab.h: %s\n", obj, source->filename );
|
||||
output( "%s.tab.h: %s\n", obj, sourcedep );
|
||||
output( "\t$(BISON) $(BISONFLAGS) -p %s_ -o %s.tab.c -d %s\n",
|
||||
obj, obj, source->filename );
|
||||
output( "%s.tab.c: %s %s\n", obj, source->filename, header );
|
||||
strarray_add( &clean_files, strmake( "%s.tab.h", obj ));
|
||||
}
|
||||
else output( "%s.tab.c: %s\n", obj, source->filename );
|
||||
else output( "%s.tab.c: %s\n", obj, sourcedep );
|
||||
|
||||
output( "\t$(BISON) $(BISONFLAGS) -p %s_ -o $@ %s\n", obj, source->filename );
|
||||
output( "%s.tab.o: %s.tab.c\n", obj, obj );
|
||||
|
@ -1209,14 +1231,14 @@ static void output_sources(void)
|
|||
}
|
||||
else if (!strcmp( ext, "x" )) /* template file */
|
||||
{
|
||||
output( "%s.h: $(MAKEXFTMPL) %s\n", obj, source->filename );
|
||||
output( "%s.h: $(MAKEXFTMPL) %s\n", obj, sourcedep );
|
||||
output( "\t$(MAKEXFTMPL) -H -o $@ %s\n", source->filename );
|
||||
strarray_add( &clean_files, strmake( "%s.h", obj ));
|
||||
continue;
|
||||
}
|
||||
else if (!strcmp( ext, "l" )) /* lex file */
|
||||
{
|
||||
output( "%s.yy.c: %s\n", obj, source->filename );
|
||||
output( "%s.yy.c: %s\n", obj, sourcedep );
|
||||
output( "\t$(FLEX) $(LEXFLAGS) -o$@ %s\n", source->filename );
|
||||
output( "%s.yy.o: %s.yy.c\n", obj, obj );
|
||||
output( "\t$(CC) -c $(includes) $(ALLCFLAGS) -o $@ %s.yy.c\n", obj );
|
||||
|
@ -1228,14 +1250,14 @@ static void output_sources(void)
|
|||
{
|
||||
if (source->flags & FLAG_RC_PO)
|
||||
{
|
||||
output( "%s.res: $(WRC) $(ALL_MO_FILES) %s\n", obj, source->filename );
|
||||
output( "%s.res: $(WRC) $(ALL_MO_FILES) %s\n", obj, sourcedep );
|
||||
output( "\t$(WRC) $(includes) $(RCFLAGS) -o $@ %s\n", source->filename );
|
||||
column += output( "%s.res rsrc.pot:", obj );
|
||||
po_srcs++;
|
||||
}
|
||||
else
|
||||
{
|
||||
output( "%s.res: $(WRC) %s\n", obj, source->filename );
|
||||
output( "%s.res: $(WRC) %s\n", obj, sourcedep );
|
||||
output( "\t$(WRC) $(includes) $(RCFLAGS) -o $@ %s\n", source->filename );
|
||||
column += output( "%s.res:", obj );
|
||||
}
|
||||
|
@ -1243,7 +1265,7 @@ static void output_sources(void)
|
|||
}
|
||||
else if (!strcmp( ext, "mc" )) /* message file */
|
||||
{
|
||||
output( "%s.res: $(WMC) $(ALL_MO_FILES) %s\n", obj, source->filename );
|
||||
output( "%s.res: $(WMC) $(ALL_MO_FILES) %s\n", obj, sourcedep );
|
||||
output( "\t$(WMC) -U -O res $(PORCFLAGS) -o $@ %s\n", source->filename );
|
||||
strarray_add( &clean_files, strmake( "%s.res", obj ));
|
||||
mc_srcs++;
|
||||
|
@ -1269,7 +1291,7 @@ static void output_sources(void)
|
|||
column += output( "%s%c", targets[i], i < nb_targets - 1 ? ' ' : ':' );
|
||||
strarray_add( &clean_files, targets[i] );
|
||||
}
|
||||
column += output( " %s", source->filename );
|
||||
column += output( " %s", sourcedep );
|
||||
}
|
||||
else if (!strcmp( ext, "in" )) /* .in file or man page */
|
||||
{
|
||||
|
@ -1290,10 +1312,10 @@ static void output_sources(void)
|
|||
output( "\t$(RM) %s/%s.%s\n",
|
||||
dir, dest, source->sourcename );
|
||||
free( dest );
|
||||
strarray_add( &subdirs, dir );
|
||||
strarray_add_uniq( &subdirs, dir );
|
||||
}
|
||||
strarray_add( &clean_files, xstrdup(obj) );
|
||||
output( "%s: %s\n", obj, source->filename );
|
||||
output( "%s: %s\n", obj, sourcedep );
|
||||
output( "\t$(SED_CMD) %s >$@ || ($(RM) $@ && false)\n", source->filename );
|
||||
column += output( "%s:", obj );
|
||||
}
|
||||
|
@ -1306,7 +1328,7 @@ static void output_sources(void)
|
|||
for (i = 0; i < object_extensions.count; i++)
|
||||
{
|
||||
strarray_add( &clean_files, strmake( "%s.%s", obj, object_extensions.str[i] ));
|
||||
output( "%s.%s: %s\n", obj, object_extensions.str[i], source->filename );
|
||||
output( "%s.%s: %s\n", obj, object_extensions.str[i], sourcedep );
|
||||
if (strstr( object_extensions.str[i], "cross" ))
|
||||
output( "\t$(CROSSCC) -c $(includes) $(ALLCROSSCFLAGS) -o $@ %s\n", source->filename );
|
||||
else
|
||||
|
@ -1315,7 +1337,7 @@ static void output_sources(void)
|
|||
if (source->flags & FLAG_C_IMPLIB)
|
||||
{
|
||||
strarray_add( &clean_files, strmake( "%s.cross.o", obj ));
|
||||
output( "%s.cross.o: %s\n", obj, source->filename );
|
||||
output( "%s.cross.o: %s\n", obj, sourcedep );
|
||||
output( "\t$(CROSSCC) -c $(includes) $(ALLCROSSCFLAGS) -o $@ %s\n", source->filename );
|
||||
}
|
||||
if (is_test && !strcmp( ext, "c" ) && !is_generated_idl( source ))
|
||||
|
@ -1329,6 +1351,7 @@ static void output_sources(void)
|
|||
column += output( ":" );
|
||||
}
|
||||
free( obj );
|
||||
free( sourcedep );
|
||||
|
||||
for (i = 0; i < MAX_INCLUDES; i++)
|
||||
if (source->files[i]) output_include( source->files[i], source, &column );
|
||||
|
|
Loading…
Reference in New Issue