Don't store address of local variable in hashtable.
[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 TOP = ..
11
12 include build/win32/make.mingw
13
14 # Possibly override GLib version in build/win32/module.defs
15 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
16
17 ################################################################
18
19 # Nothing much configurable below
20
21 INCLUDES = -I .
22 DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib -DG_ENABLE_DEBUG
23 DEPCFLAGS = $(INTL_CFLAGS) $(LIBICONV_CFLAGS)
24
25 DLLS_TO_BUILD =                         \
26         glib-$(GLIB_VER).dll            \
27         sub-gmodule                     \
28         sub-gthread                     \
29         sub-gobject
30
31 all :                           \
32         config.h                \
33         glibconfig.h            \
34         $(DLLS_TO_BUILD)        \
35         gspawn-win32-helper.exe \
36         testglib.exe            \
37         testgdate.exe           \
38         testgdateparser.exe
39
40 install : all
41         $(INSTALL) $(DLLS_TO_BUILD) $(BIN)
42
43 glib_OBJECTS =                  \
44         garray.o                \
45         gasyncqueue.o           \
46         gbacktrace.o            \
47         gcache.o                \
48         gcompletion.o           \
49         gconvert.o              \
50         gdataset.o              \
51         gdate.o                 \
52         gerror.o                \
53         gfileutils.o            \
54         ghash.o                 \
55         ghook.o                 \
56         giochannel.o            \
57         giowin32.o              \
58         glist.o                 \
59         gmain.o                 \
60         gmarkup.o               \
61         gmem.o                  \
62         gmessages.o             \
63         gnode.o                 \
64         gprimes.o               \
65         gqsort.o                \
66         gqueue.o                \
67         grand.o                 \
68         grel.o                  \
69         gscanner.o              \
70         gshell.o                \
71         gslist.o                \
72         gspawn-win32.o          \
73         gstrfuncs.o             \
74         gstring.o               \
75         gthread.o               \
76         gthreadpool.o           \
77         gtimer.o                \
78         gtree.o                 \
79         gunibreak.o             \
80         gunidecomp.o            \
81         guniprop.o              \
82         gutf8.o                 \
83         gutils.o                \
84         gwin32.o
85
86 glibconfig.h: glibconfig.h.win32
87         cp $< $@
88
89 config.h: config.h.win32
90         cp $< $@
91
92 ifeq ($(wildcard makefile.mingw.in),makefile.mingw.in)
93 makefile.mingw: makefile.mingw.in
94         sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
95             -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
96 endif
97
98 ################ glib
99
100 glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
101         ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) $(INTL_LIBS) $(LIBICONV_LIBS) -luser32 -lwsock32
102
103 gspawn-win32-helper.exe : gspawn-win32-helper.c
104         $(CC) $(CFLAGS) -mwindows -DG_LOG_DOMAIN=\"gspawn-win32-helper\" -o $@ $< -L . -lglib-$(GLIB_VER)
105
106 ################ subdirectories
107
108 sub-gmodule :
109         cd gmodule && $(MAKE) -f makefile.mingw all
110
111 sub-gthread :
112         cd gthread && $(MAKE) -f makefile.mingw all
113
114 sub-gobject :
115         cd gobject && $(MAKE) -f makefile.mingw all
116
117 ################ test progs
118
119 testglib.o : testglib.c
120         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" $<
121
122 testglib.exe : glib-$(GLIB_VER).dll testglib.o
123         $(CC) $(CFLAGS) -o testglib testglib.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
124
125 testgdate.o : testgdate.c
126         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" $<
127
128 testgdate.exe : glib-$(GLIB_VER).dll testgdate.o
129         $(CC) $(CFLAGS) -o testgdate.exe testgdate.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
130
131 testgdateparser.o : testgdateparser.c
132         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" $<
133
134 testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.o
135         $(CC) $(CFLAGS) -o testgdateparser.exe testgdateparser.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
136
137
138 ################ other stuff
139
140 clean::
141         -rm config.h glibconfig.h gmodule/gmoduleconf.h