Sweden-Number/dlls/Maketest.rules.in

76 lines
2.2 KiB
Plaintext
Raw Normal View History

# 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
#
2002-12-10 23:49:15 +01:00
DEFS = @DLLFLAGS@ -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
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)
EXTRA_SRCS = $(TESTLIST)
EXTRA_OBJS = $(TESTLIST:.c=.o)
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
2002-12-13 21:45:39 +01:00
IMPORTLIBS = $(DELAYIMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT)) $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
CROSSOBJS = $(C_SRCS:.c=.cross.o) $(TESTLIST:.c=.cross.o)
@MAKE_RULES@
all: $(TESTPROGRAM)
# Rule for main module spec file
2002-12-13 21:45:39 +01:00
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(OBJS) $(IMPORTLIBS) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe $(MODULE) -mcui $(RC_SRCS:.rc=.res) $(OBJS) -L$(DLLDIR) -L.. $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
# Rules for .so main module
$(MODULE).so: $(MODULE).spec.o $(OBJS) Makefile.in
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(OBJS) -o $@ $(ALL_LIBS) -lc
# Rules for .exe main module
2002-12-13 21:45:39 +01:00
$(MODULE): $(OBJS) $(RCOBJS) $(IMPORTLIBS) Makefile.in
$(CC) $(OBJS) $(RCOBJS) -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
# Rules for building test list
$(TESTLIST): Makefile.in
$(TOPSRCDIR)/tools/make_ctests $(CTESTS) >$(TESTLIST) || $(RM) $(TESTLIST)
depend: $(TESTLIST)
# Rules for testing
check test:: $(TESTRESULTS) $(SUBDIRS:%=%/__test__)
2002-12-13 21:45:39 +01:00
$(TESTRESULTS): $(MODULE)$(DLLEXT) $(DLLDIR)/$(TESTDLL)$(DLLEXT)
# Rules for cross-compiling tests
crosstest:: @CROSSTEST@
$(CROSSTEST): $(CROSSOBJS) Makefile.in
$(CROSSCC) $(CROSSOBJS) -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(LIBS)
# Rules for cleaning
testclean::
$(RM) $(TESTRESULTS)
clean::
$(RM) $(MODULE) $(TESTLIST) $(TESTRESULTS) $(CROSSTEST)