Maketest.rules.in 1.5 KB
Newer Older
1 2 3
# Global rules for building dll unit tests     -*-Makefile-*-
#
# Each individual makefile should define the following variables:
4
# TESTDLL      : the dll to test
5
# C_SRCS       : list of C test programs
6 7 8 9 10 11
# EXTRALIBS    : extra libraries to link in (optional)
# EXTRADEFS    : extra symbol definitions, like -DWINELIB (optional)
#
# plus all variables required by the global Make.rules.in
#

12
DLLFLAGS     = @DLLFLAGS@
13
DEFS         = -DWINE_STRICT_PROTOTYPES $(EXTRADEFS)
14 15

MODULE       = $(TESTDLL:%.dll=%)_test.exe
16
TESTRESULTS  = $(C_SRCS:.c=.ok)
17 18 19
TESTPROGRAM  = $(MODULE)$(DLLEXT)
RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM)

20
ALL_LIBS     = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
21
EXTRA_OBJS   = testlist.o
22

23
CROSSTEST    = $(TESTDLL:%.dll=%)_crosstest.exe
24
MAKEDEPFLAGS = -xo -xcross.o
25

26 27
@MAKE_RULES@

28 29
all: $(TESTPROGRAM)

30 31
$(MODULE) $(MODULE).so: $(OBJS) Makefile.in
	$(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
32

33 34
.PHONY: check test testclean crosstest

35 36
# Rules for building test list

37
testlist.c: Makefile.in $(MAKECTESTS)
38
	$(MAKECTESTS) -o $@ $(C_SRCS)
39

40
testlist.o: testlist.c $(TOPSRCDIR)/include/wine/test.h
41

42 43
# Rules for testing

44
check test: $(TESTRESULTS)
45

46
$(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
47

48 49
# Rules for cross-compiling tests

50
crosstest: @CROSSTEST@
51 52

$(CROSSTEST): $(CROSSOBJS) Makefile.in
53
	$(CROSSWINEGCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
54

55 56 57 58 59 60
# Rules for cleaning

testclean::
	$(RM) $(TESTRESULTS)

clean::
61
	$(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)