Commit 5cf75e61 authored by Alexandre Julliard's avatar Alexandre Julliard

makefiles: Only run test and documentation targets in directories that need them.

parent 27959beb
......@@ -225,18 +225,13 @@ depend: $(IDL_SRCS:.idl=.h) $(SUBDIRS:%=%/__depend__)
$(SUBDIRS:%=%/__clean__): dummy
@cd `dirname $@` && $(MAKE) clean
$(SUBDIRS:%=%/__testclean__): dummy
@cd `dirname $@` && $(MAKE) testclean
$(EXTRASUBDIRS:%=%/__clean__): dummy
-cd `dirname $@` && $(RM) $(CLEAN_FILES)
testclean:: $(SUBDIRS:%=%/__testclean__)
clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
$(RM) $(CLEAN_FILES) $(IDL_SRCS:.idl=.h) $(IDL_SRCS:.idl=_c.c) $(IDL_SRCS:.idl=_i.c) $(IDL_SRCS:.idl=_p.c) $(IDL_SRCS:.idl=_s.c) $(IDL_TLB_SRCS:.idl=.tlb) $(PROGRAMS) $(RC_BINARIES) $(MANPAGES)
.PHONY: clean testclean $(SUBDIRS:%=%/__clean__) $(SUBDIRS:%=%/__testclean__) $(EXTRASUBDIRS:%=%/__clean__)
.PHONY: clean $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
# Rules for installing
......@@ -265,13 +260,39 @@ $(INSTALLDIRS):
# Rules for testing
$(SUBDIRS:%=%/__test__): dummy
$(TESTSUBDIRS:%=%/__test__): dummy
@cd `dirname $@` && $(MAKE) test
$(SUBDIRS:%=%/__crosstest__): dummy
$(TESTSUBDIRS:%=%/__crosstest__): dummy
@cd `dirname $@` && $(MAKE) crosstest
.PHONY: check test crosstest $(SUBDIRS:%=%/__test__) $(SUBDIRS:%=%/__crosstest__)
$(TESTSUBDIRS:%=%/__testclean__): dummy
@cd `dirname $@` && $(MAKE) testclean
check test:: $(TESTSUBDIRS:%=%/__test__)
crosstest:: $(TESTSUBDIRS:%=%/__crosstest__)
testclean:: $(TESTSUBDIRS:%=%/__testclean__)
.PHONY: check test testclean crosstest $(TESTSUBDIRS:%=%/__test__) $(TESTSUBDIRS:%=%/__crosstest__) $(TESTSUBDIRS:%=%/__testclean__)
# Rules for auto documentation
$(DOCSUBDIRS:%=%/__man__): dummy
@cd `dirname $@` && $(MAKE) man
$(DOCSUBDIRS:%=%/__doc_html__): dummy
@cd `dirname $@` && $(MAKE) doc-html
$(DOCSUBDIRS:%=%/__doc_sgml__): dummy
@cd `dirname $@` && $(MAKE) doc-sgml
man: $(DOCSUBDIRS:%=%/__man__)
doc-html: $(DOCSUBDIRS:%=%/__doc_html__)
doc-sgml: $(DOCSUBDIRS:%=%/__doc_sgml__)
.PHONY: man doc-html doc-sgml $(DOCSUBDIRS:%=%/__man__) $(DOCSUBDIRS:%=%/__doc_html__) $(DOCSUBDIRS:%=%/__doc_sgml__)
# Misc. rules
......
......@@ -107,10 +107,7 @@ $(SUBDIRS:%=%/__depend__): tools include
# Test rules
check test:: $(TESTSUBDIRS:%=%/__test__)
$(TESTSUBDIRS:%=%/__test__): wine
crosstest:: $(TESTSUBDIRS:%=%/__crosstest__)
$(TESTSUBDIRS:%=%/__crosstest__): tools include
# Misc rules
......
......@@ -207,18 +207,73 @@ IMPLIBSUBDIRS = \
uuid \
winecrt0
TESTSUBDIRS = \
advapi32/tests \
advpack/tests \
cabinet/tests \
comcat/tests \
comctl32/tests \
comdlg32/tests \
crypt32/tests \
d3d8/tests \
d3d9/tests \
ddraw/tests \
dinput/tests \
dnsapi/tests \
dsound/tests \
gdi/tests \
hlink/tests \
infosoft/tests \
iphlpapi/tests \
kernel/tests \
lz32/tests \
mapi32/tests \
mlang/tests \
msacm32/tests \
mscms/tests \
mshtml/tests \
msi/tests \
msvcrt/tests \
msvcrtd/tests \
msxml3/tests \
netapi32/tests \
ntdll/tests \
ole32/tests \
oleaut32/tests \
psapi/tests \
quartz/tests \
riched20/tests \
rpcrt4/tests \
rsabase/tests \
rsaenh/tests \
secur32/tests \
setupapi/tests \
shdocvw/tests \
shell32/tests \
shlwapi/tests \
urlmon/tests \
user/tests \
usp10/tests \
uxtheme/tests \
version/tests \
wininet/tests \
winmm/tests \
winspool.drv/tests \
ws2_32/tests
SUBDIRS = \
$(BASEDIRS) \
$(IMPLIBSUBDIRS) \
$(TESTSUBDIRS) \
glu32 \
glut32 \
opengl32 \
wined3d \
winex11.drv
BUILDSUBDIRS = $(BASEDIRS) $(EXTRADIRS)
INSTALLSUBDIRS = $(BUILDSUBDIRS) $(IMPLIBSUBDIRS)
BUILDSUBDIRS = $(BASEDIRS) $(EXTRADIRS) $(TESTSUBDIRS)
INSTALLSUBDIRS = $(BASEDIRS) $(EXTRADIRS) $(IMPLIBSUBDIRS)
DOCSUBDIRS = $(BASEDIRS) $(EXTRADIRS)
@MAKE_RULES@
......@@ -946,25 +1001,6 @@ strmiids/libstrmiids.a: strmiids
uuid/libuuid.a: uuid
winecrt0/libwinecrt0.a: winecrt0
# Rules for auto documentation
$(SUBDIRS:%=%/__man__): dummy
cd `dirname $@` && $(MAKE) man
man: $(SUBDIRS:%=%/__man__)
$(SUBDIRS:%=%/__doc_html__): dummy
cd `dirname $@` && $(MAKE) doc-html
doc-html: $(SUBDIRS:%=%/__doc_html__)
$(SUBDIRS:%=%/__doc_sgml__): dummy
cd `dirname $@` && $(MAKE) doc-sgml
doc-sgml: $(SUBDIRS:%=%/__doc_sgml__)
.PHONY: man doc-html doc-sgml $(SUBDIRS:%=%/__man__) $(SUBDIRS:%=%/__doc_html__) $(SUBDIRS:%=%/__doc_sgml__)
# Misc rules
install-lib:: $(INSTALLSUBDIRS:%=%/__install-lib__)
......@@ -977,8 +1013,4 @@ uninstall::
clean::
$(RM) $(IMPORT_SYMLINKS) $(WIN16_FILES)
check test:: $(BUILDSUBDIRS:%=%/__test__)
crosstest:: $(BUILDSUBDIRS:%=%/__crosstest__)
### Dependencies:
......@@ -31,10 +31,4 @@ install-lib::
uninstall::
$(RM) $(DESTDIR)$(dlldir)/$(MODULE)
# Misc. rules
.PHONY: man doc-html doc-sgml
man doc-html doc-sgml:
# End of global library rules
......@@ -49,7 +49,7 @@ depend: $(TESTLIST)
# Rules for testing
check test:: $(TESTRESULTS) $(SUBDIRS:%=%/__test__)
check test:: $(TESTRESULTS)
$(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
......
......@@ -22,8 +22,6 @@ C_SRCS = \
security.c \
service.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -12,8 +12,6 @@ C_SRCS = \
install.c \
reg.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -13,8 +13,6 @@ C_SRCS = \
RC_SRCS = cabinet.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -17,8 +17,6 @@ C_SRCS = \
RC_SRCS = \
version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -64,8 +64,6 @@ RC_BINARIES = \
idi_tt_warn_sm.ico \
idt_check.bmp
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -44,8 +44,6 @@ RC_BINARIES = \
pd32_nocollate.ico \
pd32_portrait.ico
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -25,8 +25,6 @@ C_SRCS = \
RC_SRCS = crypt32.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -27,8 +27,6 @@ C_SRCS = \
RC_SRCS = version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -29,8 +29,6 @@ C_SRCS = \
RC_SRCS = version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -31,8 +31,6 @@ C_SRCS = \
RC_SRCS = version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -22,8 +22,6 @@ IMPLIB_SRCS = data_formats.c
RC_SRCS = version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -15,8 +15,6 @@ C_SRCS = \
query.c \
record.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -21,8 +21,6 @@ C_SRCS = \
RC_SRCS = version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -62,8 +62,6 @@ C_SRCS16 = \
RC_SRCS = version.rc
RC_SRCS16 = version16.rc
SUBDIRS = tests
EXTRASUBDIRS = \
enhmfdrv \
mfdrv
......
......@@ -13,8 +13,6 @@ C_SRCS = \
hlink_main.c \
link.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -11,8 +11,6 @@ C_SRCS = \
infosoft_main.c \
wordbreaker.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -12,8 +12,6 @@ C_SRCS = \
iphlpapi_main.c \
ipstats.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -93,7 +93,7 @@ MC_SRCS = \
messages/winerr_enu.mc
EXTRA_OBJS = relay16asm.o
SUBDIRS = tests
EXTRASUBDIRS = messages nls
@MAKE_DLL_RULES@
......
......@@ -10,8 +10,6 @@ C_SRCS = lzexpand_main.c
C_SRCS16 = lzexpand16.c
SPEC_SRCS16 = lzexpand.spec
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -56,6 +56,10 @@ sub update_file($)
{
rename "$file.new", "$file";
print "$file updated\n";
if (-x "./config.status" && $file =~ /(.*Makefile)\.in$/)
{
system "./config.status", $1;
}
}
}
......@@ -63,17 +67,17 @@ sub update_file($)
if (! -f "configure.ac" && -f "../configure.ac") { chdir(".."); }
my @args = @ARGV;
if (!@args) { @args = split /\s/, `find dlls -name Makefile.in -print`; }
if (!@args) { @args = map { s/^(.*)\.in/$1/; $_; } split(/\s/,`find dlls -name Makefile.in -print`); }
foreach my $i (@args)
{
if ($i =~ /dlls\/(.*)\/tests\/Makefile.in/)
if ($i =~ /dlls\/(.*)\/tests\/Makefile/)
{
$testdirs{$1} = "$1/tests";
next;
}
open MAKE, $i or die "cannot open $i\n";
open MAKE, "$i.in" or die "cannot open $i.in\n";
my $module = undef;
my $dir = $i;
......@@ -165,23 +169,21 @@ foreach my $dir (sort values %directories)
printf NEWMAKE " \\\n\t%s", $dir;
}
printf NEWMAKE "\n\nIMPLIBSUBDIRS =";
foreach my $dir (sort values %staticlib_dirs)
{
printf NEWMAKE " \\\n\t%s", $dir;
}
print NEWMAKE "\n\nIMPLIBSUBDIRS = \\\n\t";
print NEWMAKE join " \\\n\t", sort values %staticlib_dirs;
printf NEWMAKE "\n\nSUBDIRS = \\\n\t\$(BASEDIRS) \\\n\t\$(IMPLIBSUBDIRS)";
foreach my $dir (sort keys %special_dlls)
{
printf NEWMAKE " \\\n\t%s", $dir;
}
printf NEWMAKE <<EOF;
print NEWMAKE "\n\nTESTSUBDIRS = \\\n\t";
print NEWMAKE join " \\\n\t", sort values %testdirs;
print NEWMAKE "\n\nSUBDIRS = \\\n\t";
print NEWMAKE join " \\\n\t", "\$(BASEDIRS)", "\$(IMPLIBSUBDIRS)", "\$(TESTSUBDIRS)",
sort keys %special_dlls;
print NEWMAKE <<EOF;
BUILDSUBDIRS = \$(BASEDIRS) \$(EXTRADIRS)
INSTALLSUBDIRS = \$(BUILDSUBDIRS) \$(IMPLIBSUBDIRS)
BUILDSUBDIRS = \$(BASEDIRS) \$(EXTRADIRS) \$(TESTSUBDIRS)
INSTALLSUBDIRS = \$(BASEDIRS) \$(EXTRADIRS) \$(IMPLIBSUBDIRS)
DOCSUBDIRS = \$(BASEDIRS) \$(EXTRADIRS)
EOF
################################################################
......@@ -331,25 +333,6 @@ foreach my $mod (sort keys %staticlib_dirs)
print NEWMAKE <<EOF;
# Rules for auto documentation
\$(SUBDIRS:%=%/__man__): dummy
cd `dirname \$@` && \$(MAKE) man
man: \$(SUBDIRS:%=%/__man__)
\$(SUBDIRS:%=%/__doc_html__): dummy
cd `dirname \$@` && \$(MAKE) doc-html
doc-html: \$(SUBDIRS:%=%/__doc_html__)
\$(SUBDIRS:%=%/__doc_sgml__): dummy
cd `dirname \$@` && \$(MAKE) doc-sgml
doc-sgml: \$(SUBDIRS:%=%/__doc_sgml__)
.PHONY: man doc-html doc-sgml \$(SUBDIRS:%=%/__man__) \$(SUBDIRS:%=%/__doc_html__) \$(SUBDIRS:%=%/__doc_sgml__)
# Misc rules
install-lib:: \$(INSTALLSUBDIRS:%=%/__install-lib__)
......@@ -362,10 +345,6 @@ uninstall::
clean::
\$(RM) \$(IMPORT_SYMLINKS) \$(WIN16_FILES)
check test:: \$(BUILDSUBDIRS:%=%/__test__)
crosstest:: \$(BUILDSUBDIRS:%=%/__crosstest__)
### Dependencies:
EOF
......
......@@ -14,8 +14,6 @@ C_SRCS = \
sendmail.c \
util.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -12,8 +12,6 @@ C_SRCS = \
mlang.c \
regsvr.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -22,8 +22,6 @@ SPEC_SRCS16 = msacm.spec
RC_SRCS = msacm.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -17,8 +17,6 @@ C_SRCS = \
RC_SRCS = version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -42,8 +42,6 @@ RC_SRCS = rsrc.rc
IDL_SRCS = nsiface.idl
SUBDIRS = tests
@MAKE_DLL_RULES@
rsrc.res: mshtml.inf blank.htm
......
......@@ -55,8 +55,6 @@ RC_BINARIES = \
EXTRA_SRCS = sql.y cond.y
EXTRA_OBJS = sql.tab.o cond.tab.o
SUBDIRS = tests
@MAKE_DLL_RULES@
sql.tab.c sql.tab.h: sql.y
......
......@@ -38,8 +38,6 @@ C_SRCS = \
RC_SRCS = \
rsrc.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -11,8 +11,6 @@ EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt
C_SRCS = \
debug.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -22,8 +22,6 @@ C_SRCS = \
regsvr.c \
text.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -21,8 +21,6 @@ C_SRCS = \
share.c \
wksta.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -54,8 +54,6 @@ C_SRCS = \
EXTRA_OBJS = relay32.o
SUBDIRS = tests
@MAKE_DLL_RULES@
relay32.o: $(WINEBUILD)
......
......@@ -71,8 +71,6 @@ RC_BINARIES = \
IDL_SRCS = \
dcom.idl
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......
......@@ -39,8 +39,6 @@ SPEC_SRCS16 = \
RC_SRCS = oleaut32.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -9,8 +9,6 @@ IMPORTS = kernel32 ntdll
C_SRCS = \
psapi_main.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -33,8 +33,6 @@ C_SRCS = \
RC_SRCS = version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -26,8 +26,6 @@ C_SRCS = \
wrap.c \
writer.c
SUBDIRS = tests
RC_SRCS = version.rc
@MAKE_DLL_RULES@
......
......@@ -26,8 +26,6 @@ C_SRCS = \
rpcrt4_main.c \
rpcss_np_client.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -6,8 +6,6 @@ VPATH = @srcdir@
MODULE = rsabase.dll
IMPORTS = rsaenh kernel32
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -18,8 +18,6 @@ C_SRCS = \
rsa.c \
rsaenh.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -18,8 +18,6 @@ C_SRCS = \
util.c \
wrapper.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -33,8 +33,6 @@ SPEC_SRCS16 = setupx.spec
RC_SRCS= setupapi.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -30,8 +30,6 @@ C_SRCS = \
RC_SRCS = shdocvw.rc
IDL_TLB_SRCS = shdocvw_v1.tlb
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -78,8 +78,6 @@ C_SRCS16 = shell.c
RC_SRCS16 = version16.rc
SPEC_SRCS16 = shell.spec
SUBDIRS = tests
@MAKE_DLL_RULES@
# Special rules for 16-bit resource files
......
......@@ -28,8 +28,6 @@ C_SRCS = \
RC_SRCS = \
shlwapi.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -23,8 +23,6 @@ C_SRCS = \
RC_SRCS = rsrc.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
rsrc.res: urlmon.inf
......
......@@ -144,8 +144,6 @@ RC_SRCS16 = \
resources/mouse.rc \
resources/version16.rc
SUBDIRS = tests
EXTRASUBDIRS = resources
@MAKE_DLL_RULES@
......
......@@ -9,8 +9,6 @@ IMPORTS = gdi32 kernel32
C_SRCS = \
usp10.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -19,8 +19,6 @@ C_SRCS = \
RC_SRCS = version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -16,8 +16,6 @@ C_SRCS16 = \
SPEC_SRCS16 = ver.spec
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -25,8 +25,6 @@ RC_SRCS = \
rsrc.rc \
version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -28,8 +28,6 @@ SPEC_SRCS16 = \
RC_SRCS = winmm_res.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
......@@ -13,8 +13,6 @@ C_SRCS = \
RC_SRCS = winspool.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
$(IMPORTLIB): $(MAINSPEC)
......
......@@ -20,8 +20,6 @@ SPEC_SRCS16 = winsock.spec
RC_SRCS = version.rc
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment