intial implementation of new API functions. Not sure if it behaves as
[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 TOP = ../..
7
8 include $(TOP)/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 . -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 all :                           \
22         ../config.h             \
23         ../glibconfig.h         \
24         glib-$(GLIB_VER).dll \
25         gspawn-win32-helper.exe
26
27 glib_OBJECTS =                  \
28         garray.o                \
29         gasyncqueue.o           \
30         gbacktrace.o            \
31         gcache.o                \
32         gcompletion.o           \
33         gconvert.o              \
34         gdataset.o              \
35         gdate.o                 \
36         gerror.o                \
37         gfileutils.o            \
38         ghash.o                 \
39         ghook.o                 \
40         giochannel.o            \
41         giowin32.o              \
42         glist.o                 \
43         gmain.o                 \
44         gmarkup.o               \
45         gmem.o                  \
46         gmessages.o             \
47         gnode.o                 \
48         gpattern.o              \
49         gprimes.o               \
50         gqsort.o                \
51         gqueue.o                \
52         grand.o                 \
53         grel.o                  \
54         gscanner.o              \
55         gshell.o                \
56         gslist.o                \
57         gspawn-win32.o          \
58         gstrfuncs.o             \
59         gstring.o               \
60         gthread.o               \
61         gthreadpool.o           \
62         gtimer.o                \
63         gtree.o                 \
64         gunibreak.o             \
65         gunicollate.o           \
66         gunidecomp.o            \
67         guniprop.o              \
68         gutf8.o                 \
69         gutils.o                \
70         gwin32.o
71
72 ../glibconfig.h: ../glibconfig.h.win32
73         cp $< $@
74
75 ../config.h: ../config.h.win32
76         cp $< $@
77
78 ifeq ($(wildcard makefile.mingw.in),makefile.mingw.in)
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 endif
83
84 ################ glib
85
86 #glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
87 #       ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) $(INTL_LIBS) $(LIBICONV_LIBS) -luser32 -lwsock32
88
89 glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
90         dllwrap --mno-cygwin --dllname glib-$(GLIB_VER).dll --implib glib-$(GLIB_VER).lib --def glib.def $(glib_OBJECTS) $(INTL_LIBS) $(LIBICONV_LIBS) -luser32 -lwsock32
91
92 gspawn-win32-helper.exe : gspawn-win32-helper.c
93         $(CC) $(CFLAGS) -mwindows -DG_LOG_DOMAIN=\"gspawn-win32-helper\" -o $@ $< -L . -lglib-$(GLIB_VER)
94
95 ################ subdirectories
96
97 sub-gmodule :
98         cd gmodule && $(MAKE) -f makefile.mingw all
99
100 sub-gthread :
101         cd gthread && $(MAKE) -f makefile.mingw all
102
103 sub-gobject :
104         cd gobject && $(MAKE) -f makefile.mingw all
105
106 ################ test progs
107
108 testglib.o : testglib.c
109         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" $<
110
111 testglib.exe : glib-$(GLIB_VER).dll testglib.o
112         $(CC) $(CFLAGS) -o testglib testglib.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
113
114 testgdate.o : testgdate.c
115         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" $<
116
117 testgdate.exe : glib-$(GLIB_VER).dll testgdate.o
118         $(CC) $(CFLAGS) -o testgdate.exe testgdate.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
119
120 testgdateparser.o : testgdateparser.c
121         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" $<
122
123 testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.o
124         $(CC) $(CFLAGS) -o testgdateparser.exe testgdateparser.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
125
126
127 ################ other stuff
128
129 clean::
130         -rm config.h glibconfig.h gmodule/gmoduleconf.h