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