removed glib.def from EXTRA_DIST ... ... and added it here.
[platform/upstream/glib.git] / tests / makefile.mingw.in
1 ## Makefile for building the GLib test programs with gcc for mingw.
2 ## Use: make -f makefile.mingw check
3
4 TOP = ../..
5
6 include ../build/win32/make.mingw
7
8 # Possibly override GLib version in build\win32\module.defs
9 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
10
11 ################################################################
12
13 # Nothing much configurable below
14
15 INCLUDES = -I .. -I ../gmodule
16 DEFINES = -DHAVE_CONFIG_H
17
18 BUILD_DLL = ../build-dll
19
20 TESTS = \
21         array-test.exe  \
22         date-test.exe   \
23         dirname-test.exe\
24         gio-test.exe    \
25         hash-test.exe   \
26         list-test.exe   \
27         mainloop-test.exe\
28         markup-test.exe \
29         module-test.exe \
30         node-test.exe   \
31         queue-test.exe  \
32         rand-test.exe   \
33         relation-test.exe\
34         shell-test.exe  \
35         slist-test.exe  \
36         spawn-test.exe  \
37         strfunc-test.exe\
38         string-test.exe \
39         thread-test.exe \
40         threadpool-test.exe\
41         tree-test.exe   \
42         type-test.exe   \
43         unicode-encoding.exe \
44         libmoduletestplugin_a.dll \
45         libmoduletestplugin_b.dll
46
47 all:    $(TESTS)
48
49 ifeq ($(wildcard makefile.mingw.in),makefile.mingw.in)
50 makefile.mingw: makefile.mingw.in
51         sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
52             -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
53 endif
54
55 .SUFFIXES: .c .i .exe
56
57 .c.exe:
58         $(CC) $(CFLAGS) -o $@ $< -L ../gthread -lgthread-$(GLIB_VER) -L .. -lglib-$(GLIB_VER) 
59
60 module-test.exe : module-test.o
61         $(CC) $(CFLAGS) -Wl,--base-file,module-test.base -o module-test.exe module-test.o -L .. -lglib-$(GLIB_VER) -L ../gmodule -lgmodule-$(GLIB_VER) $(LDFLAGS)
62         $(DLLTOOL) --base-file module-test.base --output-exp module-test.exp module-test.o
63         $(CC) $(CFLAGS) -Wl,--base-file,module-test.base,module-test.exp -o module-test.exe module-test.o -L .. -lglib-$(GLIB_VER) -L ../gmodule -lgmodule-$(GLIB_VER) $(LDFLAGS)
64         $(DLLTOOL) --base-file module-test.base --output-exp module-test.exp module-test.o
65         $(CC) $(CFLAGS) -Wl,module-test.exp -o module-test.exe module-test.o -L .. -lglib-$(GLIB_VER) -L ../gmodule -lgmodule-$(GLIB_VER) $(LDFLAGS)
66
67 libmoduletestplugin_a.dll : libmoduletestplugin_a.o
68         $(BUILD_DLL) libmoduletestplugin_a - - libmoduletestplugin_a.o -L .. -lglib-$(GLIB_VER) -L ../gmodule -lgmodule-$(GLIB_VER)
69
70 libmoduletestplugin_b.dll : libmoduletestplugin_b.o
71         $(BUILD_DLL) libmoduletestplugin_b - - libmoduletestplugin_b.o -L .. -lglib-$(GLIB_VER) -L ../gmodule -lgmodule-$(GLIB_VER)
72
73 check:  all
74         @for P in $(TESTS) ; do echo $$P; ./$$P; done
75         @echo All tests successful.