1# Note that this file is hardly maintained, hardly usable without
2# manual editing, and not really part of a recommended way to build
3# GLib and related software with Microsoft's compilers. Only a few
4# persons use a build setup that involves this file.
5
6# Common makefile definitions for building GLib, GTk+, and various
7# software that use these libraries with msvc on Win32
8
9# Debug builds shoud link with msvcrtd release build with msvcrt.
10!IFNDEF DEBUG
11# Full optimization:
12OPTIMIZE = -Ox
13CRUNTIME = -MD
14# Line number debug info only
15DEBUGINFO = -Zd
16LINKDEBUG =
17!ELSE
18# Debugging:
19OPTIMIZE = 
20CRUNTIME = -MDd
21DEBUGINFO = -Zi -DG_ENABLE_DEBUG=1
22LINKDEBUG = /debug /nodefaultlib:msvcrt.lib
23!ENDIF
24
25LDFLAGS = /link /machine:ix86 $(LINKDEBUG)
26
27!IFNDEF TOP
28TOP = ..
29!ENDIF
30
31# paths and version numbers
32!INCLUDE module.defs
33
34################
35# CFLAGS and LIBS for the packages in module.defs.
36# In alphabetical order.
37
38# Note that these CFLAGS and LIBS refer to stuff in "source"
39# directories. This is for historical reasons, and only useable if you
40# have the GLib, Pango, etc sources. If you use the prebuilt developer
41# packages, you should fix these to instead refer to the place where
42# you unzipped the developer packages. Easiest of all, run pkg-config
43# --cflags gtk+-2.0 (for instance), and paste its output as the
44# definition of GTK2_CFLAGS. Etc.
45
46ATK_CFLAGS = -I $(ATK)
47ATK_LIBS = $(ATK)\atk\atk-$(ATK_VER).lib
48
49CAIRO_CFLAGS = -I $(CAIRO)\cairo\src -I $(CAIRO)\libpixman\src -I $(CAIRO) $(FONTCONFIG_CFLAGS) $(FREETYPE2_CFLAGS)
50CAIRO_LIBS = $(CAIRO)\cairo\src\libcairo-$(CAIRO_VER).lib
51
52DIRENT_CFLAGS = -I $(GLIB)\build\win32\dirent
53DIRENT_LIBS = $(GLIB)\build\win32\dirent\dirent.lib
54
55# Don't know if Freetype2, FriBiDi and some others actually can be
56# built with MSVC, but one can produce an import library even if the
57# DLL was built with gcc.
58
59FREETYPE2_CFLAGS = -I $(FREETYPE2)\include
60FREETYPE2_LIBS = $(FREETYPE2)\obj\freetype-$(FREETYPE2_VER).lib
61
62GDK_PIXBUF_CFLAGS = -I $(GDK_PIXBUF)
63GDK_PIXBUF_LIBS = $(GTK2)\gdk-pixbuf\gdk_pixbuf-$(GDK_PIXBUF_VER).lib
64
65GIMP_CFLAGS = -I $(GIMP)
66GIMP_PLUGIN_LIBS = $(GIMP)\libgimp\gimp-$(GIMP_VER).lib $(GIMP)\libgimp\gimpui-$(GIMP_VER).lib
67
68# overide definition to use it as callable path
69GLIB = $(TOP)\glib
70
71GLIB_CFLAGS = -I $(GLIB) -I $(GLIB)\glib -I $(GLIB)\gmodule $(INTL_CFLAGS)
72GLIB_LIBS = $(GLIB)\glib\glib-$(GLIB_VER).lib $(GLIB)\gmodule\gmodule-$(GLIB_VER).lib $(GLIB)\gobject\gobject-$(GLIB_VER).lib
73GTHREAD_LIBS = $(GLIB)\gthread\gthread-$(GLIB_VER).lib
74
75GNOMECANVAS_CFLAGS = -I $(GNOMECANVAS)
76GNOMECANVAS_LIBS = $(GNOMECANVAS)\libgnomecanvas\libgnomecanvas-$(GNOMECANVAS_VER).lib
77
78GNOMEPRINT_CFLAGS = -I $(GNOMEPRINT)
79GNOMEPRINT_LIBS = $(GNOMEPRINT)\libgnomeprint\gnome-print-$(GNOMEPRINT_VER).lib
80
81GNOMEPRINTUI_CFLAGS = -I $(GNOMEPRINTUI)
82GNOMEPRINTUI_LIBS = $(GNOMEPRINTUI)\libgnomeprintui\gnome-printui-$(GNOMEPRINTUI_VER).lib
83
84GTK_CFLAGS = -I$(GTK)\gdk -I$(GTK)\gdk -I$(GTK) 
85GTK_LIBS = $(GTK)\gtk\gtk.lib $(GTK)\gdk\gdk.lib 
86
87GTK2_CFLAGS = $(GLIB_CFLAGS) $(ATK_CFLAGS) -I$(GTK2)\gdk -I$(GTK2)\gdk -I$(GTK2) -I$(PANGO) -I$(ATK)
88GTK2_LIBS = $(GTK2)\gtk\gtk-win32-$(GTK2_VER).lib $(GTK2)\gdk\gdk-win32-$(GTK2_VER).lib $(GTK2)\gdk-pixbuf\gdk_pixbuf-$(GTK2_VER).lib $(PANGO_LIBS)
89
90GTKGLAREA_CFLAGS = -I $(GTKGLAREA)
91GTKGLAREA_CFLAGS = -I $(GTKGLAREA)
92GTKGLAREA_LIBS = $(GTKGLAREA)\gtkgl\gtkgl-$(GTKGLAREA_VER).lib
93
94LIBART_CFLAGS = -I$(LIBART)\.. -FIlibart_lgpl/art_config.h
95LIBART_LIBS = $(LIBART)\libart.lib
96
97INTL_CFLAGS = -I $(INTL)
98INTL_LIBS = $(INTL)\intl.lib 
99
100LIBICONV_CFLAGS = -I $(LIBICONV)\include
101LIBICONV_LIBS = $(LIBICONV)\lib\iconv.lib
102
103LIBXML_CFLAGS = -I $(LIBXML)
104LIBXML_LIBS = $(LIBXML)\xml-$(LIBXML_VER).lib
105
106LIBXML2_CFLAGS = $(LIBICONV_CFLAGS) -I $(LIBXML2)\include
107LIBXML2_LIBS = $(LIBXML2)\libxml2.lib
108
109LIBXSLT_CFLAGS = -I $(LIBXSLT)
110LIBXSLT_LIBS = $(LIBXSLT)\libxslt\libxslt.lib
111
112JPEG_CFLAGS = -I $(JPEG)
113JPEG_LIBS = $(JPEG)\libjpeg.lib
114
115OPENGL_CFLAGS = # None needed, headers bundled with the compiler
116OPENGL_LIBS = opengl32.lib lglu32.lib
117
118PANGO_CFLAGS = -I $(PANGO)
119PANGO_LIBS = $(PANGO)\pango\pango-$(PANGO_VER).lib
120PANGOWIN32_LIBS = $(PANGO_LIBS) $(PANGO)\pango\pangowin32-$(PANGO_VER).lib
121PANGOFT2_LIBS = $(PANGO_LIBS) $(PANGO)\pango\pangoft2-$(PANGO_VER).lib
122
123PNG_CFLAGS = -I $(PNG) $(ZLIB_CFLAGS)
124PNG_LIBS = $(PNG)\png.lib $(ZLIB_LIBS)
125
126RSVG_CFLAGS = -I $(RSVG)\..
127RSVG_LIBS = $(RSVG)\librsvg-$(RSVG_VER).lib
128
129SVG_CFLAGS = -I $(SVG)\src
130SVG_LIBS = $(SVG)\src\libsvg-$(SVG_VER).lib
131
132TIFF_CFLAGS = -I $(TIFF)\libtiff
133# Use single import library for both libtiff DLL versions (with or
134# without LZW code). The user selects which DLL to use.
135TIFF_NOLZW_LIBS = $(TIFF)\libtiff\tiff.lib $(JPEG_LIBS) $(ZLIB_LIBS) user32.lib
136TIFF_LZW_LIBS = $(TIFF_NOLZW_LIBS)
137TIFF_LIBS = $(TIFF_NOLZW_LIBS)
138
139ZLIB_CFLAGS = -I $(ZLIB)
140ZLIB_LIBS = $(ZLIB)\zlib.lib
141
142################
143# Compiler to use.
144
145CCOMPILER = cl
146CC = $(CCOMPILER) -G5 -GF $(CRUNTIME) -W3 -nologo
147
148################
149# The including makefile should define INCLUDES, DEFINES and
150# DEPCFLAGS.  INCLUDES are the includes related to the module being
151# built.  DEFINES similarly. DEPCFLAGS should be set to a set of
152# GLIB_CFLAGS, GTK_CFLAGS etc corresponding to what other modules we
153# depend on.
154
155CFLAGS = $(OPTIMIZE) $(DEBUGINFO) $(INCLUDES) $(DEFINES) $(DEPCFLAGS)
156
157.c.i :
158	$(CC) $(CFLAGS) -E $< >$@
159
160# The default target should be "all"
161
162default: all
163
164clean::
165	-del *.obj
166	-del *.res
167	-del *.i
168	-del *.exe
169	-del *.dll
170	-del *.lib
171	-del *.err
172	-del *.map
173	-del *.sym
174	-del *.exp
175	-del *.lk1
176	-del *.mk1
177	-del *.pdb
178	-del *.ilk
179
180# Needed by hacker rule to make makefile.msc from makefile.msc.in:
181SED = e:\cygwin\bin\sed
182