fixed SIZEOF_LONG==4 assumption with ENABLE_MEM_CHECK, from Art Haas
[platform/upstream/glib.git] / makefile.mingw.in
1 ## Makefile for building the GLib DLL with gcc for mingw. The build
2 ## uses tools running on cygwin, however.
3
4 ## Use: make -f makefile.mingw
5
6 # Change this to wherever you want to install the DLLs. This directory
7 # should be in your PATH.
8 BIN = /bin
9
10 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
11
12 TOP = ..
13
14 include $(TOP)/build/win32/make.mingw
15
16 ################################################################
17
18 # Nothing much configurable below
19
20 INCLUDES = -I .
21 DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
22
23 DLLS_TO_BUILD = \
24         glib-$(GLIB_VER).dll \
25         gmodule/gmodule-$(GLIB_VER).dll \
26         gthread/gthread-$(GLIB_VER).dll \
27         gobject/gobject-$(GLIB_VER).dll \
28
29
30 all : \
31         config.h \
32         glibconfig.h \
33         $(DLLS_TO_BUILD) \
34         testglib.exe \
35         testgdate.exe \
36         testgdateparser.exe
37
38 install : all
39         $(INSTALL) $(DLLS_TO_BUILD) $(BIN)
40
41 glib_OBJECTS = \
42         garray.o \
43         gasyncqueue.o \
44         gcache.o \
45         gcompletion.o \
46         gdataset.o \
47         gdate.o \
48         gerror.o \
49         ghook.o \
50         ghash.o \
51         giochannel.o \
52         giowin32.o \
53         glist.o \
54         gmain.o \
55         gmem.o \
56         gmessages.o \
57         gnode.o \
58         gprimes.o \
59         gqueue.o \
60         grand.o \
61         gslist.o \
62         gthread.o \
63         gthreadpool.o \
64         gtimer.o \
65         gtree.o \
66         grel.o \
67         gstring.o \
68         gstrfuncs.o \
69         gscanner.o \
70         gutils.o \
71         gwin32.o
72
73 glibconfig.h: glibconfig.h.win32
74         cp $< $@
75
76 config.h: config.h.win32
77         cp $< $@
78
79 makefile.mingw: makefile.mingw.in
80         sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
81             -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
82
83 ################ glib
84
85 glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
86         ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) -luser32 -lwsock32
87
88 ################ subdirectories
89
90 gmodule/gmodule-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
91         cd gmodule && $(MAKE) -f makefile.mingw all
92
93 gthread/gthread-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
94         cd gthread && $(MAKE) -f makefile.mingw all
95
96 gobject/gobject-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
97         cd gobject && $(MAKE) -f makefile.mingw all
98
99 ################ test progs
100
101 testglib.o : testglib.c
102         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" $<
103
104 testglib.exe : glib-$(GLIB_VER).dll testglib.o
105         $(CC) $(CFLAGS) -o testglib testglib.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
106
107 testgdate.o : testgdate.c
108         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" $<
109
110 testgdate.exe : glib-$(GLIB_VER).dll testgdate.o
111         $(CC) $(CFLAGS) -o testgdate.exe testgdate.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
112
113 testgdateparser.o : testgdateparser.c
114         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" $<
115
116 testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.o
117         $(CC) $(CFLAGS) -o testgdateparser.exe testgdateparser.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
118
119
120 ################ other stuff
121
122 clean::
123         -rm config.h glibconfig.h gmodule/gmoduleconf.h