File: make.mingw

package info (click to toggle)
gtkglarea 1.2.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,340 kB
  • ctags: 292
  • sloc: sh: 6,878; ansic: 2,724; makefile: 96
file content (177 lines) | stat: -rw-r--r-- 5,057 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Common makefile definitions for building GLib, GTk+, and various
# software that use these libraries with gcc on Win32 for a mingw
# configuration (for a description of what mingw is, see
# http://www.mingw.org)

# You can use this in two ways:

# Either have the build module included in each module
# that uses it. the glib and gtk+ directories should be siblings to
# these modules. For example:

# $(TOP)\somemodule
#        somemodule\build\win32 (this directory)
#        glib
#        gtk+
#        libglade (for example)
#etc

# Or, have the build module as a sibling to the source directory that 
# uses it, like:
# $(TOP)\somemodule
#        build\win32
#        glib
#        gtk+
#        libxml (for example)
#etc

# Some libraries have headers that can't be used from the source directories,
# we have to "install" them. USRDIR is a directory where we have an "include"
# subdirectory for headers.
USRDIR = /install

# The makefile.mingw files in the source directories (or
# subdirectories) all include this file right at the top after
# defining some macros used here.

ifndef OPTIMIZE
OPTIMIZE = -O2
endif

ifndef WARNINGS
WARNINGS = -Wall
endif

ifndef TOP
TOP = ..
endif

################
# It's hard to include module.defs. There is no way to tell GNU Make
# to include it from the same directory *this* file is in, is it?
# The build module can be as a freestanding directory, or included
# in the software package whose makefile includes *this* file.
-include $(TOP)/build/win32/module.defs
ifndef MODULE_DEFS_INCLUDED
-include build/win32/module.defs
ifndef MODULE_DEFS_INCLUDED
-include ../build/win32/module.defs
ifndef MODULE_DEFS_INCLUDED
-include ../../build/win32/module.defs
ifndef MODULE_DEFS_INCLUDED
-include ../../../build/win32/module.defs
ifndef MODULE_DEFS_INCLUDED
-include ../../../../build/win32/module.defs
ifndef MODULE_DEFS_INCLUDED
-include ../../../../../build/win32/module.defs
endif
endif
endif
endif
endif
endif

################
# CFLAGS and LIBS for the packages in module.defs.
# In alphabetical order.

FREETYPE2_CFLAGS = -I $(FREETYPE2)/include
FREETYPE2_LIBS = -L $(FREETYPE2)/obj -lfreetype-$(FREETYPE2_VER)

# FriBidi headers need to be "installed".
FRIBIDI_CFLAGS = -I $(USRDIR)/include
FRIBIDI_LIBS = -L $(FRIBIDI) -lfribidi-$(FRIBIDI_VER)

GIMP_CFLAGS = -I $(GIMP)
GIMP_PLUGIN_LIBS = -L $(GIMP)/libgimp -lgimp-$(GIMP_VER) -lgimpui-$(GIMP_VER)

GLIB_CFLAGS = -I $(GLIB) -I $(GLIB)/gmodule
GLIB_LIBS = -L $(GLIB) -lglib-$(GLIB_VER) -L $(GLIB)/gmodule -lgmodule-$(GLIB_VER) -L $(GLIB)/gthread -lgthread-$(GLIB_VER) -L $(GLIB)/gobject -lgobject-$(GLIB_VER)

GTK_CFLAGS = -I $(GTK)/gdk -I $(GTK)
GTK_LIBS = -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk -lgdk-$(GTK_VER) 

GTKCURRENT_CFLAGS = -I $(GTKCURRENT)/gdk -I $(GTKCURRENT)
GTKCURRENT_LIBS = -L $(GTKCURRENT)/gtk -lgtk-win32-$(GTKCURRENT_VER) -L $(GTKCURRENT)/gdk -lgdk-win32-$(GTKCURRENT_VER) 

GTKGLAREA_CFLAGS = -I $(GTKGLAREA)
GTKGLAREA_LIBS = -L $(GTKGLAREA)/gtkgl -lgtkgl-$(GTKGLAREA_VER)

INTL_CFLAGS = -I $(INTL)
INTL_LIBS = -L $(INTL) -lintl

JPEG_CFLAGS = -I $(JPEG)
JPEG_LIBS = -L $(JPEG) -ljpeg

LIBICONV_CFLAGS = -I $(LIBICONV)/include
LIBICONV_LIBS = -L $(LIBICONV)/lib -liconv

LIBXML_CFLAGS = -I $(LIBXML)
LIBXML_LIBS = -L $(LIBXML) -lxml-$(LIBXML_VER)

OPENGL_CFLAGS = $(PLATFORMSDK_CFLAGS)
OPENGL_LIBS = -lopengl32 -lglu32

PANGO_CFLAGS = -I $(PANGO)
PANGO_LIBS = -L $(PANGO)/pango -lpango-$(PANGO_VER)
PANGOWIN32_LIBS = $(PANGO_LIBS) -lpangowin32-$(PANGO_VER)

# Must use -idirafter for PlatformSDK so the mingw Win32 API headers have
# precedence
PLATFORMSDK_CFLAGS = -idirafter $(PLATFORMSDK)/include

PNG_CFLAGS = -I $(PNG) $(ZLIB_CFLAGS)
PNG_LIBS = -L $(PNG) -lpng $(ZLIB_LIBS)

TIFF_CFLAGS = -I $(TIFF)/libtiff
TIFF_LZW_LIBS = -L $(TIFF)/libtiff -ltiff-lzw $(JPEG_LIBS) $(ZLIB_LIBS) -luser32
TIFF_NOLZW_LIBS = -L $(TIFF)/libtiff -ltiff-nolzw $(JPEG_LIBS) $(ZLIB_LIBS) -luser32
TIFF_LIBS = $(TIFF_NOLZW_LIBS)

ZLIB_CFLAGS = -I $(ZLIB)
ZLIB_LIBS = -L $(ZLIB) -lz

################
# Compiler to use. The -fnative-struct switch is important so that the
# produced libraries are also callable from MSVC-compiled code. Only
# gcc 2.95 or later for mingw (distributed by Mumit Khan) have the
# -fnative-struct switch.

CC = gcc -mno-cygwin -mpentium -fnative-struct
CXX = c++ -mno-cygwin -mpentium -fnative-struct
				
################
# Various other tools

DLLTOOL = dlltool
INSTALL = install

################
# The including makefile should define INCLUDES, DEFINES and
# DEPCFLAGS.  INCLUDES are the includes related to the module being
# built.  DEFINES similarly. DEPCFLAGS should be set to a set of
# GLIB_CFLAGS, GTK_CFLAGS etc corresponding to what other modules we
# depend on.

CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES) $(DEPCFLAGS) $(WARNINGS)

################
# Useful rules

.SUFFIXES: .c .o .i .s

.c.i:
	$(CC) $(CFLAGS) -E $< >$@

.c.s:
	$(CC) $(CFLAGS) -S $< -o $@

.cc.o:
	$(CXX) $(CFLAGS) -c $< -o $@

# The default target should be "all"

default: all

clean::
	-rm *.o *.i *.exe *.dll *.a *.base *.exp