2002-08-09 01:22:40 +00:00
|
|
|
# Global rules for building dll unit tests -*-Makefile-*-
|
|
|
|
#
|
|
|
|
# Each individual makefile should define the following variables:
|
2006-07-28 18:53:52 +00:00
|
|
|
# TESTDLL : the dll to test
|
2002-08-09 01:22:40 +00:00
|
|
|
# CTESTS : list of C test programs
|
|
|
|
# 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 19:01:44 +00:00
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2006-04-17 09:17:18 +00:00
|
|
|
DEFS = $(EXTRADEFS)
|
2002-08-09 01:22:40 +00:00
|
|
|
|
|
|
|
MODULE = $(TESTDLL:%.dll=%)_test.exe
|
|
|
|
TESTRESULTS = $(CTESTS:.c=.ok)
|
|
|
|
TESTPROGRAM = $(MODULE)$(DLLEXT)
|
|
|
|
RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM)
|
|
|
|
|
2006-09-11 13:43:38 +00:00
|
|
|
C_SRCS = $(CTESTS)
|
2004-03-03 22:39:22 +00:00
|
|
|
ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
|
2006-09-11 13:43:38 +00:00
|
|
|
EXTRA_OBJS = testlist.o
|
2002-08-09 01:22:40 +00:00
|
|
|
|
2002-09-06 19:46:00 +00:00
|
|
|
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
|
2007-03-07 13:30:53 +00:00
|
|
|
CROSSOBJS = $(C_SRCS:.c=.cross.o) $(RC_SRCS:.rc=.res.cross.o) $(BISON_SRCS:.y=.tab.cross.o) $(LEX_SRCS:.l=.yy.cross.o) $(IDL_GEN_C_SRCS:.c=.cross.o) testlist.cross.o
|
2003-04-21 22:52:31 +00:00
|
|
|
CROSSCC = @CROSSCC@
|
|
|
|
CROSSWINDRES = @CROSSWINDRES@
|
2002-09-06 19:46:00 +00:00
|
|
|
|
2002-08-09 01:22:40 +00:00
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-12-06 19:51:20 +00:00
|
|
|
all: $(TESTPROGRAM)
|
|
|
|
|
2002-08-09 01:22:40 +00:00
|
|
|
# Rules for .so main module
|
|
|
|
|
2005-05-07 12:39:52 +00:00
|
|
|
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
|
2006-07-11 19:32:36 +00:00
|
|
|
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -mconsole $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(LIBPORT) $(ALL_LIBS)
|
2002-08-09 01:22:40 +00:00
|
|
|
|
|
|
|
# Rules for .exe main module
|
|
|
|
|
2004-01-26 21:29:05 +00:00
|
|
|
$(MODULE): $(OBJS) $(RCOBJS) Makefile.in
|
2004-03-03 22:39:22 +00:00
|
|
|
$(CC) $(OBJS) $(RCOBJS) -o $@ $(ALL_LIBS)
|
2002-08-09 01:22:40 +00:00
|
|
|
|
|
|
|
# Rules for building test list
|
|
|
|
|
2006-09-11 13:43:38 +00:00
|
|
|
testlist.c: Makefile.in $(MAKECTESTS)
|
2005-03-16 20:02:17 +00:00
|
|
|
$(MAKECTESTS) -o $@ $(CTESTS)
|
2002-08-09 01:22:40 +00:00
|
|
|
|
2006-09-11 13:43:38 +00:00
|
|
|
testlist.o: testlist.c $(TOPSRCDIR)/include/wine/test.h
|
2002-12-11 01:29:36 +00:00
|
|
|
|
2002-08-09 01:22:40 +00:00
|
|
|
# Rules for testing
|
|
|
|
|
2006-08-28 11:37:44 +00:00
|
|
|
check test:: $(TESTRESULTS)
|
2002-08-09 01:22:40 +00:00
|
|
|
|
2006-03-21 11:01:31 +00:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
|
2002-08-09 01:22:40 +00:00
|
|
|
|
2002-09-06 19:46:00 +00:00
|
|
|
# Rules for cross-compiling tests
|
|
|
|
|
2003-04-21 22:52:31 +00:00
|
|
|
.SUFFIXES: .cross.o .res.cross.o
|
|
|
|
|
|
|
|
.c.cross.o:
|
|
|
|
$(CROSSCC) -c $(ALLCFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
.res.res.cross.o:
|
|
|
|
$(CROSSWINDRES) -i $< -o $@
|
|
|
|
|
2002-09-06 19:46:00 +00:00
|
|
|
crosstest:: @CROSSTEST@
|
|
|
|
|
|
|
|
$(CROSSTEST): $(CROSSOBJS) Makefile.in
|
2004-03-03 22:39:22 +00:00
|
|
|
$(CROSSCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
|
2002-09-06 19:46:00 +00:00
|
|
|
|
2007-07-06 16:20:06 +00:00
|
|
|
$(CROSSOBJS): $(IDL_GEN_HEADERS)
|
|
|
|
|
2002-08-09 01:22:40 +00:00
|
|
|
# Rules for cleaning
|
|
|
|
|
|
|
|
testclean::
|
|
|
|
$(RM) $(TESTRESULTS)
|
|
|
|
|
|
|
|
clean::
|
2006-09-11 13:43:38 +00:00
|
|
|
$(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)
|