File: make.mingw

package info (click to toggle)
gtkgl2 1.99.0-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,104 kB
  • ctags: 330
  • sloc: sh: 6,744; ansic: 3,173; makefile: 125
file content (199 lines) | stat: -rw-r--r-- 5,463 bytes parent folder | download | duplicates (2)
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# 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 = /target

# 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.
#
# Also set BUILD to the location of the build directory.
#
# First try a separate top-level directory
-include $(TOP)/build/win32/module.defs
BUILD=$(TOP)/build
# Then in GLib 
ifndef MODULE_DEFS_INCLUDED
-include $(TOP)/glib/build/win32/module.defs
BUILD=$(TOP)/glib/build
# Then a build subdirectory of the directory where the makefile that
# included us was.
ifndef MODULE_DEFS_INCLUDED
-include build/win32/module.defs
BUILD=build
# Then try a sibling directory called build
ifndef MODULE_DEFS_INCLUDED
-include ../build/win32/module.defs
BUILD=../build
# Etc upwards
ifndef MODULE_DEFS_INCLUDED
-include ../../build/win32/module.defs
BUILD=../../build
ifndef MODULE_DEFS_INCLUDED
-include ../../../build/win32/module.defs
BUILD=../../../build
ifndef MODULE_DEFS_INCLUDED
-include ../../../../build/win32/module.defs
BUILD=../../../../build
endif
endif
endif
endif
endif
endif

BUILD_DLL = $(BUILD)/win32/build-dll
COMPILE_RESOURCE = $(BUILD)/win32/compile-resource

################
# 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)

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

GLIB_CFLAGS = `pkg-config --cflags glib-2.0`
GLIB_LIBS = `pkg-config --libs glib-2.0`

GMODULE_CFLAGS = `pkg-config --cflags gmodule-2.0`
GMODULE_LIBS = `pkg-config --libs gmodule-2.0`

GTK_CFLAGS = `pkg-config --cflags gtk+-1.3-win32-production`
GTK_LIBS = `pkg-config --libs gtk+-1.3-win32-production`

GTK2_CFLAGS = `pkg-config --cflags gtk+-2.0`
GTK2_LIBS = `pkg-config --libs gtk+-2.0`

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

INTL_CFLAGS = `pkg-config --cflags libintl`
INTL_LIBS = `pkg-config --libs libintl`

JPEG_CFLAGS = `pkg-config --cflags libjpeg`
JPEG_LIBS = `pkg-config --libs libjpeg`

LIBICONV_CFLAGS = `pkg-config --cflags libiconv`
LIBICONV_LIBS = `pkg-config --libs libiconv`

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

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

PANGO_CFLAGS = `pkg-config --cflags pango`
PANGO_LIBS = `pkg-config --libs pango`
PANGOWIN32_LIBS = `pkg-config --libs pangowin32`

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

PNG_CFLAGS = `pkg-config --cflags libpng`
PNG_LIBS = `pkg-config --libs libpng`

TIFF_CFLAGS = `pkg-config --cflags libtiff`
# Use single import library for both libtiff DLL versions (with or
# without LZW code). The user selects which DLL to use.
TIFF_NOLZW_LIBS = `pkg-config --libs libtiff`
TIFF_LZW_LIBS = $(TIFF_NOLZW_LIBS)
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.

CCOMPILER = gcc
CC = $(CCOMPILER) -mno-cygwin -mpentium -fnative-struct
CXXCOMPILER = c++
CXX = $(CXXCOMPILER) -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