]> Pileus Git - ~andy/gtk/blob - gdk/makefile.msc
updated
[~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 WTKIT = ..\..\wtkit126
15
16 ###############################################################
17
18 # Nothing much configurable below
19
20 !IFNDEF DEBUG
21 # Full optimization:
22 OPTIMIZE = -Ox -MD -Zi
23 LINKDEBUG = /nodefaultlib:libc.lib
24 !ELSE
25 # Debugging:
26 OPTIMIZE = -Zi -MDd
27 LINKDEBUG = /nodefaultlib:libcd.lib /nodefaultlib:libc.lib /debug
28 !ENDIF
29
30 # cl -? describes the options
31 CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
32
33 LDFLAGS = /link $(LINKDEBUG)
34
35 # overwrite version?
36 GTK_VER=2.0
37 GDK_PIXBUF_VER=$(GTK_VER)
38
39 !IFNDEF PERL
40 PERL = perl
41 !ENDIF
42
43 CFLAGS = -FImsvc_recommended_pragmas.h -I . -I .. \
44                 $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I ../gdk-pixbuf \
45         $(G_DEBUGGING) -DHAVE_CONFIG_H -DGDK_ENABLE_BROKEN \
46         -DGDK_VERSION=\"$(GTK_VER)\" \
47         -DG_LOG_DOMAIN=\"Gdk\"
48
49 EXTRALIBS = $(WTKIT)\lib\i386\wntab32x.lib $(GLIB_LIBS) \
50                 ..\gdk-pixbuf\gdk_pixbuf-$(GDK_PIXBUF_VER).lib \
51                 $(PANGOWIN32_LIBS) $(INTL_LIBS)
52
53 gdk-win32-backend :
54         cd win32
55         nmake -nologo -f makefile.msc
56         cd ..
57         
58 all: \
59         ..\config.h \
60         gdkconfig.h \
61         gdkalias.h \
62         gdkenumtypes.h \
63         gdkenumtypes.c \
64         gdkmarshalers.h \
65         gdkmarshalers.c \
66         gdk-win32-backend \
67         libgdk-win32-$(GTK_VER)-0.dll \
68         testgdk.exe \
69         gdk-win32-$(GTK_VER)s.lib \
70 #       gdk-x11-$(GTK_VER).dll \
71
72 gdk_OBJECTS = \
73         gdk.obj \
74         gdkcolor.obj \
75         gdkcursor.obj \
76         gdkdisplay.obj \
77         gdkdisplaymanager.obj \
78         gdkdnd.obj \
79         gdkdraw.obj \
80         gdkenumtypes.obj \
81         gdkevents.obj \
82         gdkfont.obj \
83         gdkgc.obj \
84         gdkglobals.obj \
85         gdkimage.obj \
86         gdkkeynames.obj \
87         gdkkeys.obj \
88         gdkkeyuni.obj \
89         gdkpango.obj \
90         gdkpixbuf-drawable.obj \
91         gdkpixbuf-render.obj \
92         gdkpixmap.obj \
93         gdkpolyreg-generic.obj \
94         gdkrectangle.obj \
95         gdkregion-generic.obj \
96         gdkrgb.obj \
97         gdkscreen.obj \
98         gdkselection.obj \
99         gdkvisual.obj \
100         gdkwindow.obj
101
102 gdk_public_h_sources = \
103         gdk.h           \
104         gdkcolor.h      \
105         gdkcursor.h     \
106         gdkdnd.h        \
107         gdkdrawable.h   \
108         gdkevents.h     \
109         gdkfont.h       \
110         gdkgc.h         \
111         gdkkeysyms.h    \
112         gdki18n.h       \
113         gdkimage.h      \
114         gdkinput.h      \
115         gdkkeys.h       \
116         gdkpango.h      \
117         gdkpixbuf.h     \
118         gdkpixmap.h     \
119         gdkproperty.h   \
120         gdkregion.h     \
121         gdkrgb.h        \
122         gdkselection.h  \
123         gdktypes.h      \
124         gdkvisual.h     \
125         gdkwindow.h     \
126
127 # private marshalers
128 gdkmarshalers.h : gdkmarshalers.list
129         $(GLIB)\gobject\glib-genmarshal --prefix=gdk_marshal gdkmarshalers.list --header >>gdkmarshalers.h
130
131 gdkmarshalers.c : gdkmarshalers.list
132         $(GLIB)\gobject\glib-genmarshal --prefix=gdk_marshal gdkmarshalers.list --body >gdkmarshalers.c
133
134 gdkenumtypes.h: $(gdk_public_h_sources) makeenums.pl
135         $(PERL) makeenums.pl include $(gdk_public_h_sources) > gdkenumtypes.h
136
137 gdkenumtypes.c: $(gdk_public_h_sources) makeenums.pl
138         $(PERL) makeenums.pl cfile $(gdk_public_h_sources) > gdkenumtypes.c
139
140 ..\config.h : ..\config.h.win32
141         copy ..\config.h.win32 ..\config.h
142
143 gdkconfig.h : gdkconfig.h.win32
144         copy gdkconfig.h.win32 gdkconfig.h
145
146 gdkalias.h: gdk.symbols
147         perl makegdkalias.pl < gdk.symbols > gdkalias.h
148
149 gdk.def: gdk.symbols
150         echo EXPORTS > gdk.def
151         cl /EP -DINCLUDE_VARIABLES -DG_OS_WIN32 gdk.symbols >> gdk.def
152
153 libgdk-win32-$(GTK_VER)-0.dll : $(gdk_OBJECTS) gdk.def win32\gdk-win32.lib
154         $(CC) $(CFLAGS) -LD -Fe$@ $(gdk_OBJECTS) win32\gdk-win32.lib $(EXTRALIBS) \
155         gdi32.lib user32.lib imm32.lib shell32.lib ole32.lib uuid.lib win32\gdk.res \
156         $(LDFLAGS) /implib:gdk-win32-$(GTK_VER).lib /def:gdk.def
157
158 gdk-win32-$(GTK_VER)s.lib : $(gdk_OBJECTS)
159         lib /out:gdk-win32-$(GTK_VER)s.lib $(gdk_OBJECTS) win32\gdk-win32.lib
160
161 gdk-x11-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def x11\gdk-x11.lib
162         $(CC) $(CFLAGS) -LD -Fegdk-x11-$(GTK_VER).dll $(gdk_OBJECTS) \
163         $(PANGO)\pango\pangox-$(PANGO_VER).lib \
164         x11\gdk-x11.lib $(X11_LIBS) $(EXTRALIBS) user32.lib $(LDFLAGS) /def:gdk.def
165
166 testgdk.exe : libgdk-win32-$(GTK_VER)-0.dll testgdk.obj
167         $(CC) -Fetestgdk.exe testgdk.obj gdk-win32-$(GTK_VER).lib $(EXTRALIBS) $(LDFLAGS)
168
169 .c.obj :
170         $(CC) $(CFLAGS) -GD -c -DGDK_COMPILATION -DG_LOG_DOMAIN=\"Gdk\" $<
171
172 clean::
173         del gdkmarshalers.c
174         del gdkmarshalers.h
175         del *.dll
176         del *.obj
177         del *.lib
178         del *.err
179         del *.res