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
|
|
|
|
#
|
|
|
|
|
2002-10-03 21:42:45 +02:00
|
|
|
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(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-10-30 21:36:21 +01:00
|
|
|
EXTRA_OBJS = $(TESTLIST:.c=.o)
|
2002-08-09 03:22:40 +02:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
|
|
|
|
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@
|
|
|
|
|
|
|
|
# Rule for main module spec file
|
|
|
|
|
|
|
|
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(OBJS) $(WINEBUILD)
|
|
|
|
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe $(MODULE) -mcui $(RC_SRCS:%.rc=-res %.res) $(OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
|
|
|
|
|
|
|
|
# Rules for .so main module
|
|
|
|
|
|
|
|
$(MODULE).so: $(MODULE).spec.o $(OBJS) Makefile.in
|
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(OBJS) -o $@ $(ALL_LIBS)
|
|
|
|
|
|
|
|
# Rules for .exe main module
|
|
|
|
|
|
|
|
$(MODULE): $(OBJS) $(RCOBJS) Makefile.in
|
|
|
|
$(CC) $(OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
|
|
|
|
|
|
|
# Rules for building test list
|
|
|
|
|
|
|
|
$(TESTLIST): Makefile.in
|
|
|
|
$(TOPSRCDIR)/programs/winetest/make_ctests $(CTESTS) >$(TESTLIST) || $(RM) $(TESTLIST)
|
|
|
|
|
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
|
2002-09-25 05:29:55 +02:00
|
|
|
CHECKLINK_RPATH = library
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
checklink:: $(MODULE).so $(SUBDIRS:%=%/__checklink__)
|
|
|
|
$(CC) -o checklink $(CHECKLINK_RPATH:%=-Wl,-rpath,$(TOPOBJDIR)/%) $(TOPSRCDIR)/library/checklink.c $(MODULE).so && $(RM) checklink
|
|
|
|
|
|
|
|
# Rules for testing
|
|
|
|
|
|
|
|
check test:: $(TESTRESULTS) $(SUBDIRS:%=%/__test__)
|
|
|
|
|
2002-08-10 02:03:25 +02:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT) $(TOPOBJDIR)/dlls/$(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
|
|
|
|
$(CROSSCC) $(CROSSOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(LIBS)
|
|
|
|
|
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)
|