Revamp to be like makefile.mingw.in, make the MSVC build actually work
[platform/upstream/glib.git] / makefile.msc.in
1 ## Makefile for building the GLib dlls with Microsoft C
2 ## Use: nmake -f makefile.msc install
3
4 # Change this to wherever you want to install the DLLs. This directory
5 # should be in your PATH.
6 BIN = C:\bin
7
8 TOP = ..
9
10 !INCLUDE $(TOP)\build\win32\make.msc
11
12 # Possibly override GLib version in build\win32\module.defs
13 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
14
15 ################################################################
16
17 # Nothing much configurable below
18
19 INCLUDES = -I .
20 DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
21 DEPCFLAGS = $(LIBICONV_CFLAGS)
22
23 DLLS_TO_BUILD = \
24         glib-$(GLIB_VER).dll \
25         sub-gmodule \
26         sub-gthread \
27         sub-gobject
28
29 all : \
30         config.h        \
31         glibconfig.h    \
32         $(DLLS_TO_BUILD) \
33         testglib.exe    \
34         testgdate.exe   \
35         testgdateparser.exe
36
37 install : all
38         copy glib-$(GLIB_VER).dll $(BIN)
39
40 glib_OBJECTS = \
41         garray.obj      \
42         gasyncqueue.obj \
43         gbacktrace.obj  \
44         gcache.obj      \
45         gcompletion.obj \
46         gdataset.obj    \
47         gdate.obj       \
48         gerror.obj      \
49         gconvert.obj    \
50         ghash.obj       \
51         ghook.obj       \
52         giochannel.obj  \
53         giowin32.obj    \
54         glist.obj       \
55         gmain.obj       \
56         gmem.obj        \
57         gmessages.obj   \
58         gnode.obj       \
59         gprimes.obj     \
60         gqueue.obj      \
61         grand.obj       \
62         grel.obj        \
63         gscanner.obj    \
64         gslist.obj      \
65         gstrfuncs.obj   \
66         gstring.obj     \
67         gthread.obj     \
68         gthreadpool.obj \
69         gtimer.obj      \
70         gtree.obj       \
71         gunidecomp.obj  \
72         guniprop.obj    \
73         gutf8.obj       \
74         gutils.obj      \
75         gwin32.obj
76
77 glibconfig.h: glibconfig.h.win32
78         copy glibconfig.h.win32 glibconfig.h
79
80 config.h: config.h.win32
81         copy config.h.win32 config.h
82
83 makefile.msc: makefile.msc.in
84         $(SED) -e s,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@, \
85                -e s,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@, <makefile.msc.in >$@
86
87 ################ glib
88
89 glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
90         $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
91
92 ################ subdirectories
93
94 sub-gmodule :
95         cd gmodule
96         -$(MAKE) -f makefile.msc all
97         cd ..
98
99 sub-gthread :
100         cd gthread
101         -$(MAKE) -f makefile.msc all
102         cd ..
103
104 sub-gobject :
105         cd gobject
106         -$(MAKE) -f makefile.msc all
107         cd ..
108
109 ################ test progs
110
111 testglib.obj : testglib.c
112         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" testglib.c
113
114 testglib.exe : glib-$(GLIB_VER).dll testglib.obj
115         $(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
116
117 testgdate.obj : testgdate.c
118         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" testgdate.c
119
120 testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj
121         $(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
122
123 testgdateparser.obj : testgdateparser.c
124         $(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" testgdateparser.c
125
126 testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.obj
127         $(CC) $(CFLAGS) -Fetestgdateparser.exe testgdateparser.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
128
129 ################ other stuff
130
131 clean::
132         del config.h
133         del glibconfig.h
134         cd gmodule
135         $(MAKE) -f makefile.msc clean
136         cd ..
137         cd gthread
138         $(MAKE) -f makefile.msc clean
139         cd ..
140         cd gobject
141         $(MAKE) -f makefile.msc clean
142         cd ..