]> Pileus Git - ~andy/gtk/blob - gdk/makefile.msc
Updated msvc build
[~andy/gtk] / gdk / makefile.msc
1 ## Makefile for building the GDK DLL with Microsoft C
2 ## Use: nmake -f makefile.msc
3
4 ## You must first build the Win32-dependent sources in the win32 subdirectory.
5
6 ## There is no install target, you have to decide where and 
7 ## how to install for yourself.
8
9 TOP = ..\..
10 !INCLUDE $(TOP)/glib/build/win32/make.msc
11
12 # Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
13 # definition should possibly go to build/win32/module.def, too.
14 !IFNDEF WTKIT
15 WTKIT = $(TOP)\wtkit126
16 !ENDIF
17
18 ###############################################################
19
20 # Nothing much configurable below
21
22 !IFNDEF DEBUG
23 # Full optimization:
24 OPTIMIZE = -Ox -MD -Zi
25 LINKDEBUG = /nodefaultlib:libc.lib
26 !ELSE
27 # Debugging:
28 OPTIMIZE = -Zi -MDd
29 LINKDEBUG = /nodefaultlib:libcd.lib /nodefaultlib:libc.lib /debug
30 !ENDIF
31
32 # cl -? describes the options
33 CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
34
35 LDFLAGS = /link $(LINKDEBUG)
36
37 # overwrite version?
38 GTK_VER=2.0
39 GDK_PIXBUF_VER=$(GTK_VER)
40
41 !IFNDEF PERL
42 PERL = perl
43 !ENDIF
44
45 CFLAGS = -FImsvc_recommended_pragmas.h -I . -I .. \
46         $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(CAIRO_CFLAGS) -I ../gdk-pixbuf \
47         $(G_DEBUGGING) -DHAVE_CONFIG_H -DGDK_ENABLE_BROKEN \
48         -DGDK_VERSION=\"$(GTK_VER)\" \
49         -DG_LOG_DOMAIN=\"Gdk\"
50
51 EXTRALIBS = \
52         $(WTKIT)\lib\i386\wntab32x.lib \
53         $(GLIB_LIBS) \
54         ..\gdk-pixbuf\gdk_pixbuf-$(GDK_PIXBUF_VER).lib \
55         $(PANGOWIN32_LIBS) $(PANGOCAIRO_LIBS) $(INTL_LIBS) $(CAIRO_LIBS) \
56         $(PANGOCAIRO_LIBS)
57
58 gdk-win32-backend :
59         cd win32
60         nmake -nologo -f makefile.msc
61         cd ..
62         
63 all: \
64         ..\config.h \
65         gdkconfig.h \
66         gdkalias.h \
67         gdkaliasdef.c \
68         gdkenumtypes.h \
69         gdkenumtypes.c \
70         gdkmarshalers.h \
71         gdkmarshalers.c \
72         gdk-win32-backend \
73         libgdk-win32-$(GTK_VER)-0.dll \
74         testgdk.exe \
75         gdk-win32-$(GTK_VER)s.lib \
76 #       gdk-x11-$(GTK_VER).dll \
77
78 gdk_OBJECTS = \
79         gdk.obj \
80         gdkapplaunchcontext.obj \
81         gdkcairo.obj \
82         gdkcolor.obj \
83         gdkcursor.obj \
84         gdkdisplay.obj \
85         gdkdisplaymanager.obj \
86         gdkdnd.obj \
87         gdkdraw.obj \
88         gdkenumtypes.obj \
89         gdkevents.obj \
90         gdkfont.obj \
91         gdkgc.obj \
92         gdkglobals.obj \
93         gdkimage.obj \
94         gdkwindowimpl.obj \
95         gdkkeynames.obj \
96         gdkkeys.obj \
97         gdkkeyuni.obj \
98         gdkmarshalers.obj \
99         gdkoffscreenwindow.obj \
100         gdkpango.obj \
101         gdkpixbuf-drawable.obj \
102         gdkpixbuf-render.obj \
103         gdkpixmap.obj \
104         gdkpolyreg-generic.obj \
105         gdkrectangle.obj \
106         gdkregion-generic.obj \
107         gdkrgb.obj \
108         gdkscreen.obj \
109         gdkselection.obj \
110         gdkvisual.obj \
111         gdkwindow.obj
112
113 gdk_public_h_sources = \
114         gdk.h           \
115         gdkcolor.h      \
116         gdkcursor.h     \
117         gdkdnd.h        \
118         gdkdrawable.h   \
119         gdkevents.h     \
120         gdkfont.h       \
121         gdkgc.h         \
122         gdkkeysyms.h    \
123         gdki18n.h       \
124         gdkimage.h      \
125         gdkinput.h      \
126         gdkkeys.h       \
127         gdkpango.h      \
128         gdkpixbuf.h     \
129         gdkpixmap.h     \
130         gdkproperty.h   \
131         gdkregion.h     \
132         gdkrgb.h        \
133         gdkselection.h  \
134         gdktypes.h      \
135         gdkvisual.h     \
136         gdkwindow.h     \
137
138 # private marshalers
139 gdkmarshalers.h : gdkmarshalers.list
140         $(GLIB)\gobject\glib-genmarshal --prefix=gdk_marshal gdkmarshalers.list --header >>gdkmarshalers.h
141
142 gdkmarshalers.c : gdkmarshalers.list
143         $(GLIB)\gobject\glib-genmarshal --prefix=gdk_marshal gdkmarshalers.list --body >gdkmarshalers.c
144
145 gdkenumtypes.h: $(gdk_public_h_sources) gdkenumtypes.h.template
146         $(PERL) $(GLIB)\gobject\glib-mkenums --template gdkenumtypes.h.template \
147                 $(gdk_public_h_sources) > gdkenumtypes.h
148
149 gdkenumtypes.c: $(gdk_public_h_sources) gdkenumtypes.c.template
150         $(PERL) $(GLIB)\gobject\glib-mkenums --template gdkenumtypes.c.template \
151                 $(gdk_public_h_sources) > gdkenumtypes.c
152
153 ..\config.h : ..\config.h.win32
154         copy ..\config.h.win32 ..\config.h
155
156 gdkconfig.h : gdkconfig.h.win32
157         copy gdkconfig.h.win32 gdkconfig.h
158
159 gdkalias.h: gdk.symbols
160         perl makegdkalias.pl < gdk.symbols > gdkalias.h
161
162 gdkaliasdef.c: gdk.symbols
163          perl makegdkalias.pl -def < gdk.symbols > gdkaliasdef.c
164
165 gdk.def: gdk.symbols
166         echo EXPORTS > gdk.def
167         cl /EP -DINCLUDE_VARIABLES -DG_OS_WIN32 -DGDK_WINDOWING_WIN32 -DALL_FILES \
168                 -DG_GNUC_CONST= \
169                 gdk.symbols >> gdk.def
170
171 libgdk-win32-$(GTK_VER)-0.dll : $(gdk_OBJECTS) gdk.def win32\gdk-win32.lib
172         $(CC) $(CFLAGS) -LD -Fe$@ $(gdk_OBJECTS) win32\gdk-win32.lib $(EXTRALIBS) \
173         gdi32.lib user32.lib imm32.lib shell32.lib ole32.lib uuid.lib win32\gdk.res \
174         $(LDFLAGS) /implib:gdk-win32-$(GTK_VER).lib /def:gdk.def
175
176 gdk-win32-$(GTK_VER)s.lib : $(gdk_OBJECTS)
177         lib /out:gdk-win32-$(GTK_VER)s.lib $(gdk_OBJECTS) win32\gdk-win32.lib
178
179 gdk-x11-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def x11\gdk-x11.lib
180         $(CC) $(CFLAGS) -LD -Fegdk-x11-$(GTK_VER).dll $(gdk_OBJECTS) \
181         $(PANGO)\pango\pangox-$(PANGO_VER).lib \
182         x11\gdk-x11.lib $(X11_LIBS) $(EXTRALIBS) user32.lib $(LDFLAGS) /def:gdk.def
183
184 testgdk.exe : libgdk-win32-$(GTK_VER)-0.dll testgdk.obj
185         $(CC) -Fetestgdk.exe testgdk.obj gdk-win32-$(GTK_VER).lib $(EXTRALIBS) $(LDFLAGS)
186
187 .c.obj :
188         $(CC) $(CFLAGS) -GD -c -DGDK_COMPILATION -DG_LOG_DOMAIN=\"Gdk\" $<
189
190 clean::
191         cd win32
192         nmake -f makefile.msc clean
193         cd ..
194         del gdkmarshalers.c
195         del gdkmarshalers.h
196         del *.dll
197         del *.obj
198         del *.lib
199         del *.err
200         del *.res