1 # Mesa 3-D graphics library
4 # Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
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:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
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.
23 # MinGW core makefile v1.4 for Mesa
25 # Copyright (C) 2002 - Daniel Borca
26 # Email : dborca@users.sourceforge.net
27 # Web : http://www.geocities.com/dborca
29 # MinGW core-glut makefile updated for Mesa 7.0
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!
43 # Environment variables:
46 # GLIDE path to Glide3 SDK; used with FX.
47 # default = $(TOP)/glide3
48 # FX=1 build for 3dfx Glide3. Note that this disables
49 # compilation of most WMesa code and requires fxMesa.
50 # As a consequence, you'll need the Win32 Glide3
51 # library to build any application.
53 # ICD=1 build the installable client driver interface
54 # (windows opengl driver interface)
56 # X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
61 # clean: remove object files
67 .INTERMEDIATE: x86/gen_matypes.exe
70 # Set this to the prefix of your build tools, i.e. mingw32-
71 TOOLS_PREFIX = mingw32-
78 GLUT_IMP = libglut32.a
81 include $(TOP)/configs/config.mgw
82 GLUT_USING_STDCALL ?= 1
86 LDLIBS = -L$(LIBDIR) -lwinmm -lgdi32 -luser32 -lopengl32 -lglu32
87 LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GLUT_IMP) -Wl,--output-def=$(LIBDIR)/$(GLUT_DEF)
89 CFLAGS += -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DMESA -D_DLL
91 ifeq ($(GL_USING_STDCALL),0)
92 CFLAGS += -DGL_NO_STDCALL
95 ifeq ($(GLUT_USING_STDCALL),1)
96 CFLAGS += -D_STDCALL_SUPPORTED
97 LDFLAGS += -Wl,--add-stdcall-alias
99 CFLAGS += -DGLUT_NO_STDCALL
102 CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include
111 UNLINK = del $(subst /,\,$(1))
112 ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
115 ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
119 HDRS = glutint.h glutstroke.h glutbitmap.h glutwin32.h stroke.h win32_glx.h win32_x11.h
176 SOURCES = $(SRCS) $(SRCSSEMIGENS)
178 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
181 $(CC) -o $@ $(CFLAGS) -c $<
183 $(CXX) -o $@ $(CXXFLAGS) -c $<
186 all: $(LIBDIR) $(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP)
191 $(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
192 $(CXX) -shared -fPIC -o $(LIBDIR)/$(GLUT_DLL) $(LDFLAGS) \