2002-08-09 01:22:40 +00:00
|
|
|
# Global rules for building dll unit tests -*-Makefile-*-
|
|
|
|
#
|
|
|
|
# Each individual makefile should define the following variables:
|
|
|
|
# DLLTEST : the dll to test
|
|
|
|
# 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
|
|
|
DEFS = $(EXTRADEFS)
|
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2002-08-09 01:22:40 +00:00
|
|
|
|
|
|
|
MODULE = $(TESTDLL:%.dll=%)_test.exe
|
|
|
|
TESTLIST = testlist.c
|
|
|
|
TESTRESULTS = $(CTESTS:.c=.ok)
|
|
|
|
TESTPROGRAM = $(MODULE)$(DLLEXT)
|
|
|
|
RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM)
|
|
|
|
|
|
|
|
C_SRCS = $(CTESTS)
|
2002-12-11 01:29:36 +00:00
|
|
|
EXTRA_SRCS = $(TESTLIST)
|
2002-10-30 20:36:21 +00:00
|
|
|
EXTRA_OBJS = $(TESTLIST:.c=.o)
|
2003-06-13 23:26:01 +00:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
|
2003-04-21 22:52:31 +00:00
|
|
|
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
|
2002-08-09 01:22:40 +00:00
|
|
|
|
2002-09-06 19:46:00 +00:00
|
|
|
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
|
2003-04-21 22:52:31 +00:00
|
|
|
CROSSOBJS = $(C_SRCS:.c=.cross.o) $(RC_SRCS:.rc=.res.cross.o) $(TESTLIST:.c=.cross.o)
|
|
|
|
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
|
|
|
|
|
2004-03-02 06:58:21 +00:00
|
|
|
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) $(IMPORTLIBS) Makefile.in
|
|
|
|
WINEBUILD=$(WINEBUILD) $(WINEGCC) -mconsole $(OBJS) $(RC_SRCS:.rc=.res) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS) -lc
|
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
|
|
|
|
$(CC) $(OBJS) $(RCOBJS) -o $@ $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
|
2002-08-09 01:22:40 +00:00
|
|
|
|
|
|
|
# Rules for building test list
|
|
|
|
|
2003-09-06 02:30:30 +00:00
|
|
|
$(TESTLIST): Makefile.in $(TOPSRCDIR)/tools/make_ctests
|
2002-11-11 20:25:54 +00:00
|
|
|
$(TOPSRCDIR)/tools/make_ctests $(CTESTS) >$(TESTLIST) || $(RM) $(TESTLIST)
|
2002-08-09 01:22:40 +00:00
|
|
|
|
2002-12-11 01:29:36 +00:00
|
|
|
depend: $(TESTLIST)
|
|
|
|
|
2002-08-09 01:22:40 +00:00
|
|
|
# Rules for testing
|
|
|
|
|
|
|
|
check test:: $(TESTRESULTS) $(SUBDIRS:%=%/__test__)
|
|
|
|
|
2002-12-13 20:45:39 +00:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT) $(DLLDIR)/$(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-01-26 21:29:05 +00:00
|
|
|
$(CROSSCC) $(CROSSOBJS) -o $@ $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
|
2002-09-06 19:46:00 +00:00
|
|
|
|
2002-08-09 01:22:40 +00:00
|
|
|
# Rules for cleaning
|
|
|
|
|
|
|
|
testclean::
|
|
|
|
$(RM) $(TESTRESULTS)
|
|
|
|
|
|
|
|
clean::
|
2002-09-06 19:46:00 +00:00
|
|
|
$(RM) $(MODULE) $(TESTLIST) $(TESTRESULTS) $(CROSSTEST)
|