Merge remote branch 'origin/master' into gallium_draw_llvm
[mesa.git] / src / glu / sgi / Makefile.mgw
1 # Mesa 3-D graphics library
2 # Version: 5.1
3 #
4 # Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a
7 # copy of this software and associated documentation files (the "Software"),
8 # to deal in the Software without restriction, including without limitation
9 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 # and/or sell copies of the Software, and to permit persons to whom the
11 # Software is furnished to do so, subject to the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 # BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 # MinGW core makefile v1.4 for Mesa
24 #
25 # Copyright (C) 2002 - Daniel Borca
26 # Email : dborca@users.sourceforge.net
27 # Web : http://www.geocities.com/dborca
28
29 # MinGW core-glu makefile updated for Mesa 7.0
30 #
31 # Updated : by Heromyth, on 2007-7-21
32 # Email : zxpmyth@yahoo.com.cn
33 # Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
34 # The others havn't been tested yet.
35 # 2) The generated DLLs are *not* compatible with the ones built
36 # with the other compilers like VC8, especially for GLUT.
37 # 3) Although more tests are needed, it can be used individually!
38
39 #
40 # Available options:
41 #
42 # Environment variables:
43 # CFLAGS
44 #
45 # GLIDE path to Glide3 SDK; used with FX.
46 # default = $(TOP)/glide3
47 # FX=1 build for 3dfx Glide3. Note that this disables
48 # compilation of most WMesa code and requires fxMesa.
49 # As a consequence, you'll need the Win32 Glide3
50 # library to build any application.
51 # default = no
52 # ICD=1 build the installable client driver interface
53 # (windows opengl driver interface)
54 # default = no
55 # X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
56 # default = no
57 #
58 # Targets:
59 # all: build GL
60 # clean: remove object files
61 #
62
63
64
65 .PHONY: all clean
66 .INTERMEDIATE: x86/gen_matypes.exe
67 .SUFFIXES: .rc .res
68
69 # Set this to the prefix of your build tools, i.e. mingw32-
70 TOOLS_PREFIX = mingw32-
71
72 TOP = ../../..
73 LIBDIR = $(TOP)/lib
74
75 LIB_NAME = glu32
76 DLL_EXT = .dll
77 IMP_EXT = .a
78 LIB_PRE = lib
79 STRIP = -s
80
81 AR = ar
82 ARFLAGS = crus
83 DLLTOOL = dlltool
84
85 GLU_DLL = $(LIB_NAME)$(DLL_EXT)
86 GLU_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT)
87 GLU_DEF = $(LIB_NAME).def
88
89 LDLIBS = -L$(LIBDIR) -lopengl32
90 LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at
91
92 CFLAGS += -DBUILD_GLU32 -D_DLL
93
94
95 CC = $(TOOLS_PREFIX)gcc
96 CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude
97 CXX = $(TOOLS_PREFIX)g++
98 CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
99
100 AR = ar
101 ARFLAGS = crus
102
103 UNLINK = del $(subst /,\,$(1))
104 ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
105 UNLINK = $(RM) $(1)
106 endif
107 ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
108 UNLINK = $(RM) $(1)
109 endif
110
111 C_SOURCES = \
112 libutil/error.c \
113 libutil/glue.c \
114 libutil/mipmap.c \
115 libutil/project.c \
116 libutil/quad.c \
117 libutil/registry.c \
118 libtess/dict.c \
119 libtess/geom.c \
120 libtess/memalloc.c \
121 libtess/mesh.c \
122 libtess/normal.c \
123 libtess/priorityq.c \
124 libtess/render.c \
125 libtess/sweep.c \
126 libtess/tess.c \
127 libtess/tessmono.c
128
129 CC_SOURCES = \
130 libnurbs/interface/bezierEval.cc \
131 libnurbs/interface/bezierPatch.cc \
132 libnurbs/interface/bezierPatchMesh.cc \
133 libnurbs/interface/glcurveval.cc \
134 libnurbs/interface/glinterface.cc \
135 libnurbs/interface/glrenderer.cc \
136 libnurbs/interface/glsurfeval.cc \
137 libnurbs/interface/incurveeval.cc \
138 libnurbs/interface/insurfeval.cc \
139 libnurbs/internals/arc.cc \
140 libnurbs/internals/arcsorter.cc \
141 libnurbs/internals/arctess.cc \
142 libnurbs/internals/backend.cc \
143 libnurbs/internals/basiccrveval.cc \
144 libnurbs/internals/basicsurfeval.cc \
145 libnurbs/internals/bin.cc \
146 libnurbs/internals/bufpool.cc \
147 libnurbs/internals/cachingeval.cc \
148 libnurbs/internals/ccw.cc \
149 libnurbs/internals/coveandtiler.cc \
150 libnurbs/internals/curve.cc \
151 libnurbs/internals/curvelist.cc \
152 libnurbs/internals/curvesub.cc \
153 libnurbs/internals/dataTransform.cc \
154 libnurbs/internals/displaylist.cc \
155 libnurbs/internals/flist.cc \
156 libnurbs/internals/flistsorter.cc \
157 libnurbs/internals/hull.cc \
158 libnurbs/internals/intersect.cc \
159 libnurbs/internals/knotvector.cc \
160 libnurbs/internals/mapdesc.cc \
161 libnurbs/internals/mapdescv.cc \
162 libnurbs/internals/maplist.cc \
163 libnurbs/internals/mesher.cc \
164 libnurbs/internals/monoTriangulationBackend.cc \
165 libnurbs/internals/monotonizer.cc \
166 libnurbs/internals/mycode.cc \
167 libnurbs/internals/nurbsinterfac.cc \
168 libnurbs/internals/nurbstess.cc \
169 libnurbs/internals/patch.cc \
170 libnurbs/internals/patchlist.cc \
171 libnurbs/internals/quilt.cc \
172 libnurbs/internals/reader.cc \
173 libnurbs/internals/renderhints.cc \
174 libnurbs/internals/slicer.cc \
175 libnurbs/internals/sorter.cc \
176 libnurbs/internals/splitarcs.cc \
177 libnurbs/internals/subdivider.cc \
178 libnurbs/internals/tobezier.cc \
179 libnurbs/internals/trimline.cc \
180 libnurbs/internals/trimregion.cc \
181 libnurbs/internals/trimvertpool.cc \
182 libnurbs/internals/uarray.cc \
183 libnurbs/internals/varray.cc \
184 libnurbs/nurbtess/directedLine.cc \
185 libnurbs/nurbtess/gridWrap.cc \
186 libnurbs/nurbtess/monoChain.cc \
187 libnurbs/nurbtess/monoPolyPart.cc \
188 libnurbs/nurbtess/monoTriangulation.cc \
189 libnurbs/nurbtess/partitionX.cc \
190 libnurbs/nurbtess/partitionY.cc \
191 libnurbs/nurbtess/polyDBG.cc \
192 libnurbs/nurbtess/polyUtil.cc \
193 libnurbs/nurbtess/primitiveStream.cc \
194 libnurbs/nurbtess/quicksort.cc \
195 libnurbs/nurbtess/rectBlock.cc \
196 libnurbs/nurbtess/sampleComp.cc \
197 libnurbs/nurbtess/sampleCompBot.cc \
198 libnurbs/nurbtess/sampleCompRight.cc \
199 libnurbs/nurbtess/sampleCompTop.cc \
200 libnurbs/nurbtess/sampleMonoPoly.cc \
201 libnurbs/nurbtess/sampledLine.cc \
202 libnurbs/nurbtess/searchTree.cc
203
204 SOURCES = $(C_SOURCES) $(CC_SOURCES)
205
206 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
207
208 .c.o:
209 $(CC) -o $@ $(CFLAGS) -c $<
210 .cc.o:
211 $(CXX) -o $@ $(CXXFLAGS) -c $<
212
213
214 all: $(LIBDIR) $(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP)
215
216 $(LIBDIR):
217 mkdir -p $(LIBDIR)
218
219 $(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
220 $(CXX) $(LDFLAGS) -o $(LIBDIR)/$(GLU_DLL) $^ $(LDLIBS)
221 $(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GLU_DEF) $^
222 $(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GLU_IMP) --def $(LIBDIR)/$(GLU_DEF)
223
224
225 clean:
226 -$(call UNLINK,libutil/*.o)
227 -$(call UNLINK,libtess/*.o)
228 -$(call UNLINK,libnurbs/interface/*.o)
229 -$(call UNLINK,libnurbs/internals/*.o)
230 -$(call UNLINK,libnurbs/nurbtess/*.o)