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