]> Pileus Git - ~andy/gtk/blob - gdk/makefile.msc
build in the backend dir after auto-generating files
[~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)/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=1.3
37 GDK_PIXBUF_VER=$(GTK_VER)
38
39 !IFNDEF PERL
40 PERL = perl
41 !ENDIF
42
43 CFLAGS = -I . -I .. $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I ../gdk-pixbuf \
44                 -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_ENABLE_BROKEN -DGDK_VERSION=\"$(GTK_VER)\"
45 EXTRALIBS = $(WTKIT)\lib\i386\wntab32x.lib $(GLIB_LIBS) \
46                 ..\gdk-pixbuf\gdk_pixbuf-$(GDK_PIXBUF_VER).lib $(PANGOWIN32_LIBS)
47
48 gdk-win32-backend :
49         cd win32
50         nmake -nologo -f makefile.msc
51         cd ..
52         
53 all: \
54         ..\config.h \
55         gdkconfig.h \
56         gdkenumtypes.h \
57         gdkenumtypes.c \
58         gdk-win32-backend \
59         gdk-win32-$(GTK_VER).dll \
60         testgdk.exe
61
62 gdk_OBJECTS = \
63         gdk.obj \
64         gdkcolor.obj \
65         gdkcursor.obj \
66         gdkdraw.obj \
67         gdkenumtypes.obj \
68         gdkevents.obj \
69         gdkfont.obj \
70         gdkgc.obj \
71         gdkglobals.obj \
72         gdkimage.obj \
73         gdkkeys.obj \
74         gdkkeyuni.obj \
75         gdkpango.obj \
76         gdkpixbuf-drawable.obj \
77         gdkpixbuf-render.obj \
78         gdkpixmap.obj \
79         gdkpolyreg-generic.obj \
80         gdkrectangle.obj \
81         gdkregion-generic.obj \
82         gdkrgb.obj \
83         gdkwindow.obj
84
85 gdk_public_h_sources = \
86         gdk.h           \
87         gdkcolor.h      \
88         gdkcompat.h     \
89         gdkcursor.h     \
90         gdkcursors.h    \
91         gdkdnd.h        \
92         gdkdrawable.h   \
93         gdkevents.h     \
94         gdkfont.h       \
95         gdkgc.h         \
96         gdkkeysyms.h    \
97         gdki18n.h       \
98         gdkimage.h      \
99         gdkinput.h      \
100         gdkkeys.h       \
101         gdkpango.h      \
102         gdkpixbuf.h     \
103         gdkpixmap.h     \
104         gdkproperty.h   \
105         gdkregion.h     \
106         gdkrgb.h        \
107         gdkselection.h  \
108         gdktypes.h      \
109         gdkvisual.h     \
110         gdkwindow.h     \
111
112 gdkenumtypes.h: $(gdk_public_h_sources) makeenums.pl
113         $(PERL) makeenums.pl include $(gdk_public_h_sources) > gdkenumtypes.h
114
115 gdkenumtypes.c: $(gdk_public_h_sources) makeenums.pl
116         $(PERL) makeenums.pl cfile $(gdk_public_h_sources) > gdkenumtypes.c
117
118 ..\config.h : ..\config.h.win32
119         copy ..\config.h.win32 ..\config.h
120
121 gdkconfig.h : gdkconfig.h.win32
122         copy gdkconfig.h.win32 gdkconfig.h
123
124 gdk-win32-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def win32\gdk-win32.lib
125         $(CC) $(CFLAGS) -LD -Fegdk-win32-$(GTK_VER).dll $(gdk_OBJECTS) win32\gdk-win32.lib $(EXTRALIBS) gdi32.lib user32.lib imm32.lib shell32.lib ole32.lib uuid.lib win32\gdk.res $(LDFLAGS) /def:gdk.def
126
127 testgdk.exe : gdk-win32-$(GTK_VER).dll testgdk.obj
128         $(CC) -Fetestgdk.exe testgdk.obj gdk-win32-$(GTK_VER).lib $(EXTRALIBS) $(LDFLAGS)
129
130 .c.obj :
131         $(CC) $(CFLAGS) -GD -c -DGDK_COMPILATION -DG_LOG_DOMAIN=\"Gdk\" $<
132
133 clean::
134         del *.dll
135         del *.obj
136         del *.lib
137         del *.err
138         del *.res