2002-08-09 03:22:40 +02: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-01-09 02:56:27 +01:00
|
|
|
DEFS = @DLLFLAGS@ $(EXTRADEFS)
|
2002-08-09 03:22:40 +02:00
|
|
|
LDDLLFLAGS = @LDDLLFLAGS@
|
|
|
|
|
|
|
|
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 02:29:36 +01:00
|
|
|
EXTRA_SRCS = $(TESTLIST)
|
2002-10-30 21:36:21 +01:00
|
|
|
EXTRA_OBJS = $(TESTLIST:.c=.o)
|
2003-03-19 23:09:16 +01:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LIBS)
|
2002-12-13 21:45:39 +01:00
|
|
|
IMPORTLIBS = $(DELAYIMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT)) $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
|
2002-10-30 21:36:21 +01:00
|
|
|
CROSSOBJS = $(C_SRCS:.c=.cross.o) $(TESTLIST:.c=.cross.o)
|
2002-09-06 21:46:00 +02:00
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-12-06 20:51:20 +01:00
|
|
|
all: $(TESTPROGRAM)
|
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rule for main module spec file
|
|
|
|
|
2002-12-13 21:45:39 +01:00
|
|
|
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(OBJS) $(IMPORTLIBS) $(WINEBUILD)
|
2003-03-23 02:12:30 +01:00
|
|
|
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --exe $(MODULE) --exe-mode cui $(RC_SRCS:.rc=.res) $(OBJS) -L$(DLLDIR) -L.. $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
# Rules for .so main module
|
|
|
|
|
|
|
|
$(MODULE).so: $(MODULE).spec.o $(OBJS) Makefile.in
|
2002-11-21 04:47:45 +01:00
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(OBJS) -o $@ $(ALL_LIBS) -lc
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
# Rules for .exe main module
|
|
|
|
|
2002-12-13 21:45:39 +01:00
|
|
|
$(MODULE): $(OBJS) $(RCOBJS) $(IMPORTLIBS) Makefile.in
|
2002-12-15 02:20:54 +01:00
|
|
|
$(CC) $(OBJS) $(RCOBJS) -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
# Rules for building test list
|
|
|
|
|
|
|
|
$(TESTLIST): Makefile.in
|
2002-11-11 21:25:54 +01:00
|
|
|
$(TOPSRCDIR)/tools/make_ctests $(CTESTS) >$(TESTLIST) || $(RM) $(TESTLIST)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2002-12-11 02:29:36 +01:00
|
|
|
depend: $(TESTLIST)
|
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for testing
|
|
|
|
|
|
|
|
check test:: $(TESTRESULTS) $(SUBDIRS:%=%/__test__)
|
|
|
|
|
2002-12-13 21:45:39 +01:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT) $(DLLDIR)/$(TESTDLL)$(DLLEXT)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
# Rules for cross-compiling tests
|
|
|
|
|
|
|
|
crosstest:: @CROSSTEST@
|
|
|
|
|
|
|
|
$(CROSSTEST): $(CROSSOBJS) Makefile.in
|
2003-04-17 01:09:02 +02:00
|
|
|
$(CROSSCC) $(CROSSOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(LIBS)
|
2002-09-06 21:46:00 +02:00
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for cleaning
|
|
|
|
|
|
|
|
testclean::
|
|
|
|
$(RM) $(TESTRESULTS)
|
|
|
|
|
|
|
|
clean::
|
2002-09-06 21:46:00 +02:00
|
|
|
$(RM) $(MODULE) $(TESTLIST) $(TESTRESULTS) $(CROSSTEST)
|