Home | History | Annotate | Download | only in win32
      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:
     12 OPTIMIZE = -Ox
     13 CRUNTIME = -MD
     14 # Line number debug info only
     15 DEBUGINFO = -Zd
     16 LINKDEBUG =
     17 !ELSE
     18 # Debugging:
     19 OPTIMIZE = 
     20 CRUNTIME = -MDd
     21 DEBUGINFO = -Zi -DG_ENABLE_DEBUG=1
     22 LINKDEBUG = /debug /nodefaultlib:msvcrt.lib
     23 !ENDIF
     24 
     25 LDFLAGS = /link /machine:ix86 $(LINKDEBUG)
     26 
     27 !IFNDEF TOP
     28 TOP = ..
     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 
     46 ATK_CFLAGS = -I $(ATK)
     47 ATK_LIBS = $(ATK)\atk\atk-$(ATK_VER).lib
     48 
     49 CAIRO_CFLAGS = -I $(CAIRO)\cairo\src -I $(CAIRO)\libpixman\src -I $(CAIRO) $(FONTCONFIG_CFLAGS) $(FREETYPE2_CFLAGS)
     50 CAIRO_LIBS = $(CAIRO)\cairo\src\libcairo-$(CAIRO_VER).lib
     51 
     52 DIRENT_CFLAGS = -I $(GLIB)\build\win32\dirent
     53 DIRENT_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 
     59 FREETYPE2_CFLAGS = -I $(FREETYPE2)\include
     60 FREETYPE2_LIBS = $(FREETYPE2)\obj\freetype-$(FREETYPE2_VER).lib
     61 
     62 GDK_PIXBUF_CFLAGS = -I $(GDK_PIXBUF)
     63 GDK_PIXBUF_LIBS = $(GTK2)\gdk-pixbuf\gdk_pixbuf-$(GDK_PIXBUF_VER).lib
     64 
     65 GIMP_CFLAGS = -I $(GIMP)
     66 GIMP_PLUGIN_LIBS = $(GIMP)\libgimp\gimp-$(GIMP_VER).lib $(GIMP)\libgimp\gimpui-$(GIMP_VER).lib
     67 
     68 # overide definition to use it as callable path
     69 GLIB = $(TOP)\glib
     70 
     71 GLIB_CFLAGS = -I $(GLIB) -I $(GLIB)\glib -I $(GLIB)\gmodule $(INTL_CFLAGS)
     72 GLIB_LIBS = $(GLIB)\glib\glib-$(GLIB_VER).lib $(GLIB)\gmodule\gmodule-$(GLIB_VER).lib $(GLIB)\gobject\gobject-$(GLIB_VER).lib
     73 GTHREAD_LIBS = $(GLIB)\gthread\gthread-$(GLIB_VER).lib
     74 
     75 GNOMECANVAS_CFLAGS = -I $(GNOMECANVAS)
     76 GNOMECANVAS_LIBS = $(GNOMECANVAS)\libgnomecanvas\libgnomecanvas-$(GNOMECANVAS_VER).lib
     77 
     78 GNOMEPRINT_CFLAGS = -I $(GNOMEPRINT)
     79 GNOMEPRINT_LIBS = $(GNOMEPRINT)\libgnomeprint\gnome-print-$(GNOMEPRINT_VER).lib
     80 
     81 GNOMEPRINTUI_CFLAGS = -I $(GNOMEPRINTUI)
     82 GNOMEPRINTUI_LIBS = $(GNOMEPRINTUI)\libgnomeprintui\gnome-printui-$(GNOMEPRINTUI_VER).lib
     83 
     84 GTK_CFLAGS = -I$(GTK)\gdk -I$(GTK)\gdk -I$(GTK) 
     85 GTK_LIBS = $(GTK)\gtk\gtk.lib $(GTK)\gdk\gdk.lib 
     86 
     87 GTK2_CFLAGS = $(GLIB_CFLAGS) $(ATK_CFLAGS) -I$(GTK2)\gdk -I$(GTK2)\gdk -I$(GTK2) -I$(PANGO) -I$(ATK)
     88 GTK2_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 
     90 GTKGLAREA_CFLAGS = -I $(GTKGLAREA)
     91 GTKGLAREA_CFLAGS = -I $(GTKGLAREA)
     92 GTKGLAREA_LIBS = $(GTKGLAREA)\gtkgl\gtkgl-$(GTKGLAREA_VER).lib
     93 
     94 LIBART_CFLAGS = -I$(LIBART)\.. -FIlibart_lgpl/art_config.h
     95 LIBART_LIBS = $(LIBART)\libart.lib
     96 
     97 INTL_CFLAGS = -I $(INTL)
     98 INTL_LIBS = $(INTL)\intl.lib 
     99 
    100 LIBICONV_CFLAGS = -I $(LIBICONV)\include
    101 LIBICONV_LIBS = $(LIBICONV)\lib\iconv.lib
    102 
    103 LIBXML_CFLAGS = -I $(LIBXML)
    104 LIBXML_LIBS = $(LIBXML)\xml-$(LIBXML_VER).lib
    105 
    106 LIBXML2_CFLAGS = $(LIBICONV_CFLAGS) -I $(LIBXML2)\include
    107 LIBXML2_LIBS = $(LIBXML2)\libxml2.lib
    108 
    109 LIBXSLT_CFLAGS = -I $(LIBXSLT)
    110 LIBXSLT_LIBS = $(LIBXSLT)\libxslt\libxslt.lib
    111 
    112 JPEG_CFLAGS = -I $(JPEG)
    113 JPEG_LIBS = $(JPEG)\libjpeg.lib
    114 
    115 OPENGL_CFLAGS = # None needed, headers bundled with the compiler
    116 OPENGL_LIBS = opengl32.lib lglu32.lib
    117 
    118 PANGO_CFLAGS = -I $(PANGO)
    119 PANGO_LIBS = $(PANGO)\pango\pango-$(PANGO_VER).lib
    120 PANGOWIN32_LIBS = $(PANGO_LIBS) $(PANGO)\pango\pangowin32-$(PANGO_VER).lib
    121 PANGOFT2_LIBS = $(PANGO_LIBS) $(PANGO)\pango\pangoft2-$(PANGO_VER).lib
    122 
    123 PNG_CFLAGS = -I $(PNG) $(ZLIB_CFLAGS)
    124 PNG_LIBS = $(PNG)\png.lib $(ZLIB_LIBS)
    125 
    126 RSVG_CFLAGS = -I $(RSVG)\..
    127 RSVG_LIBS = $(RSVG)\librsvg-$(RSVG_VER).lib
    128 
    129 SVG_CFLAGS = -I $(SVG)\src
    130 SVG_LIBS = $(SVG)\src\libsvg-$(SVG_VER).lib
    131 
    132 TIFF_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.
    135 TIFF_NOLZW_LIBS = $(TIFF)\libtiff\tiff.lib $(JPEG_LIBS) $(ZLIB_LIBS) user32.lib
    136 TIFF_LZW_LIBS = $(TIFF_NOLZW_LIBS)
    137 TIFF_LIBS = $(TIFF_NOLZW_LIBS)
    138 
    139 ZLIB_CFLAGS = -I $(ZLIB)
    140 ZLIB_LIBS = $(ZLIB)\zlib.lib
    141 
    142 ################
    143 # Compiler to use.
    144 
    145 CCOMPILER = cl
    146 CC = $(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 
    155 CFLAGS = $(OPTIMIZE) $(DEBUGINFO) $(INCLUDES) $(DEFINES) $(DEPCFLAGS)
    156 
    157 .c.i :
    158 	$(CC) $(CFLAGS) -E $< >$@
    159 
    160 # The default target should be "all"
    161 
    162 default: all
    163 
    164 clean::
    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:
    181 SED = e:\cygwin\bin\sed
    182