makefiles: Generate rules from makedep for running tests.

oldstable
Alexandre Julliard 2013-11-16 11:57:14 +01:00
parent 29d08186c9
commit a6fd273a90
5 changed files with 30 additions and 25 deletions

View File

@ -32,10 +32,7 @@ ALLCROSSCFLAGS = $(INCLUDES) $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS)
# Implicit rules
.SUFFIXES: .ok .man.in .man @MAINTAINER_MODE@ .sfd .ttf .svg .ico .bmp
.c.ok:
$(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
.SUFFIXES: .man.in .man @MAINTAINER_MODE@ .sfd .ttf .svg .ico .bmp
.sfd.ttf:
$(FONTFORGE) -script $(top_srcdir)/fonts/genttf.ff $< $@
@ -106,11 +103,6 @@ $(CROSSTESTMODULE): $(CROSSOBJS) Makefile.in
$(WINETEST_RES): $(TESTMODULE_STRIPPED)
echo "$(TESTMODULE) TESTRES \"$(TESTMODULE_STRIPPED)\"" | $(WRC) $(RCFLAGS) -o $@
testclean::
$(RM) *.ok
.PHONY: check test testclean
# Rules for man pages
MANPAGES = $(MANPAGE) $(EXTRA_MANPAGES)

View File

@ -58,7 +58,7 @@ uninstall:: __uninstall__
# dependencies needed to build any dll or program
__tooldeps__: libs/port libs/wine libs/wpp
__builddeps__: __tooldeps__ include
.PHONY: test crosstest __tooldeps__ __builddeps__
.PHONY: check test testclean crosstest __tooldeps__ __builddeps__
loader server: libs/port libs/wine tools
fonts: tools

4
configure vendored
View File

@ -16161,9 +16161,7 @@ all: \$(TESTMODULE)$DLLEXT \$(WINETEST_RES)
\$(C_SRCS:.c=.ok): \$(TESTMODULE)$DLLEXT \$(TESTDLL:%=../%$DLLEXT)
check test: \$(C_SRCS:.c=.ok)
.PHONY: check test crosstest
.PHONY: check test testclean crosstest
"
if test -n "$CROSSTARGET"

View File

@ -2647,9 +2647,7 @@ all: \$(TESTMODULE)$DLLEXT \$(WINETEST_RES)
\$(C_SRCS:.c=.ok): \$(TESTMODULE)$DLLEXT \$(TESTDLL:%=../%$DLLEXT)
check test: \$(C_SRCS:.c=.ok)
.PHONY: check test crosstest
.PHONY: check test testclean crosstest
")
if test -n "$CROSSTARGET"
then

View File

@ -1149,6 +1149,7 @@ static void output_sources(void)
struct incl_file *source;
struct strarray clean_files;
int i, column, po_srcs = 0, mc_srcs = 0;
int is_test = find_src_file( "testlist.o" ) != NULL;
strarray_init( &clean_files );
@ -1247,12 +1248,12 @@ static void output_sources(void)
}
else
{
struct object_extension *ext;
LIST_FOR_EACH_ENTRY( ext, &object_extensions, struct object_extension, entry )
struct object_extension *obj_ext;
LIST_FOR_EACH_ENTRY( obj_ext, &object_extensions, struct object_extension, entry )
{
strarray_add( &clean_files, strmake( "%s.%s", obj, ext->extension ));
output( "%s.%s: %s\n", obj, ext->extension, source->filename );
if (strstr( ext->extension, "cross" ))
strarray_add( &clean_files, strmake( "%s.%s", obj, obj_ext->extension ));
output( "%s.%s: %s\n", obj, obj_ext->extension, source->filename );
if (strstr( obj_ext->extension, "cross" ))
output( "\t$(CROSSCC) -c $(ALLCROSSCFLAGS) -o $@ %s\n", source->filename );
else
output( "\t$(CC) -c $(ALLCFLAGS) -o $@ %s\n", source->filename );
@ -1263,8 +1264,13 @@ static void output_sources(void)
output( "%s.cross.o: %s\n", obj, source->filename );
output( "\t$(CROSSCC) -c $(ALLCROSSCFLAGS) -o $@ %s\n", source->filename );
}
LIST_FOR_EACH_ENTRY( ext, &object_extensions, struct object_extension, entry )
column += output( "%s.%s ", obj, ext->extension );
if (is_test && !strcmp( ext, "c" ) && !is_generated_idl( source ))
{
output( "%s.ok:\n", obj );
output( "\t$(RUNTEST) $(RUNTESTFLAGS) %s && touch $@\n", obj );
}
LIST_FOR_EACH_ENTRY( obj_ext, &object_extensions, struct object_extension, entry )
column += output( "%s.%s ", obj, obj_ext->extension );
if (source->flags & FLAG_C_IMPLIB) column += output( "%s.cross.o", obj );
column += output( ":" );
}
@ -1313,13 +1319,24 @@ static void output_sources(void)
strarray_add( &clean_files, "dlldata.c" );
}
if (find_src_file( "testlist.o" ))
if (is_test)
{
output( "testlist.c: $(MAKECTESTS) Makefile.in\n" );
column = output( "\t$(MAKECTESTS) -o $@" );
LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
if (strendswith( source->name, ".c" ) && !is_generated_idl( source ))
output_filename( source->filename, &column );
output_filename( source->name, &column );
output( "\n" );
column = output( "check test:" );
LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
if (strendswith( source->name, ".c" ) && !is_generated_idl( source ))
output_filename( replace_extension( source->name, 2, ".ok" ), &column );
output( "\n" );
output( "clean testclean::\n" );
column = output( "\t$(RM)" );
LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
if (strendswith( source->name, ".c" ) && !is_generated_idl( source ))
output_filename( replace_extension( source->name, 2, ".ok" ), &column );
output( "\n" );
strarray_add( &clean_files, "testlist.c" );
}