2002-08-09 03:22:40 +02:00
|
|
|
# Global rules for building dll unit tests -*-Makefile-*-
|
|
|
|
#
|
|
|
|
# Each individual makefile should define the following variables:
|
2006-07-28 20:53:52 +02:00
|
|
|
# TESTDLL : the dll to test
|
2010-02-20 19:56:55 +01:00
|
|
|
# C_SRCS : list of C test programs
|
2002-08-09 03:22:40 +02:00
|
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
|
|
|
# EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
|
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
2003-09-24 21:01:44 +02:00
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2010-12-23 16:05:29 +01:00
|
|
|
DEFS = -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION $(EXTRADEFS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
MODULE = $(TESTDLL:%.dll=%)_test.exe
|
2010-02-20 19:56:55 +01:00
|
|
|
TESTRESULTS = $(C_SRCS:.c=.ok)
|
2002-08-09 03:22:40 +02:00
|
|
|
TESTPROGRAM = $(MODULE)$(DLLEXT)
|
2011-05-24 11:11:22 +02:00
|
|
|
WINETEST_EXE = $(TESTDLL:%.dll=%)_test-stripped.exe$(DLLEXT)
|
|
|
|
WINETEST_RES = $(top_builddir)/programs/winetest/$(TESTDLL:%.dll=%)_test.res
|
2010-09-19 12:40:12 +02:00
|
|
|
RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(top_builddir) -p $(TESTPROGRAM)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2004-03-03 23:39:22 +01:00
|
|
|
ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
|
2006-09-11 15:43:38 +02:00
|
|
|
EXTRA_OBJS = testlist.o
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
|
2009-06-30 10:25:19 +02:00
|
|
|
MAKEDEPFLAGS = -xo -xcross.o
|
2002-09-06 21:46:00 +02:00
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
@MAKE_RULES@
|
|
|
|
|
2011-05-24 11:11:22 +02:00
|
|
|
all: $(TESTPROGRAM) $(WINETEST_RES)
|
2002-12-06 20:51:20 +01:00
|
|
|
|
2009-06-02 15:50:57 +02:00
|
|
|
$(MODULE) $(MODULE).so: $(OBJS) Makefile.in
|
|
|
|
$(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2011-05-24 11:11:22 +02:00
|
|
|
$(WINETEST_EXE): $(OBJS) Makefile.in
|
2011-05-25 10:24:57 +02:00
|
|
|
$(WINEGCC) -s -Wb,-F,$(MODULE) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
|
2011-05-24 11:11:22 +02:00
|
|
|
|
|
|
|
$(WINETEST_RES): $(WINETEST_EXE)
|
|
|
|
echo "$(MODULE) TESTRES \"$(WINETEST_EXE)\"" | $(LDPATH) $(WRC) $(RCFLAGS) -o $@
|
|
|
|
|
2010-02-10 20:27:52 +01:00
|
|
|
.PHONY: check test testclean crosstest
|
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for building test list
|
|
|
|
|
2006-09-11 15:43:38 +02:00
|
|
|
testlist.c: Makefile.in $(MAKECTESTS)
|
2010-02-20 19:56:55 +01:00
|
|
|
$(MAKECTESTS) -o $@ $(C_SRCS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2011-11-05 06:55:06 +01:00
|
|
|
testlist.o testlist.cross.o: testlist.c $(top_srcdir)/include/wine/test.h
|
2002-12-11 02:29:36 +01:00
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for testing
|
|
|
|
|
2010-03-25 21:42:54 +01:00
|
|
|
check test: $(TESTRESULTS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2006-03-21 12:01:31 +01:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
# Rules for cross-compiling tests
|
|
|
|
|
2010-07-26 12:13:47 +02:00
|
|
|
crosstest: @CROSSTEST_DISABLE@ $(CROSSTEST)
|
2002-09-06 21:46:00 +02:00
|
|
|
|
|
|
|
$(CROSSTEST): $(CROSSOBJS) Makefile.in
|
2009-05-30 17:08:06 +02:00
|
|
|
$(CROSSWINEGCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
|
2002-09-06 21:46:00 +02:00
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for cleaning
|
|
|
|
|
|
|
|
testclean::
|
|
|
|
$(RM) $(TESTRESULTS)
|
|
|
|
|
|
|
|
clean::
|
2006-09-11 15:43:38 +02:00
|
|
|
$(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)
|