# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-# MinGW samples makefile v1.0 for Mesa
+# MinGW samples makefile v1.2 for Mesa
#
-# Copyright (C) 2002 - Borca Daniel
+# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
+# MinGW samples makefile updated for Mesa 7.0
+#
+# Updated : by Heromyth, on 2007-7-21
+# Email : zxpmyth@yahoo.com.cn
+# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
+# The others havn't been tested yet.
+# 2) The generated DLLs are *not* compatible with the ones built
+# with the other compilers like VC8, especially for GLUT.
+# 3) Although more tests are needed, it can be used individually!
#
# Available options:
#
# Environment variables:
-# CPU optimize for the given processor.
-# default = pentium
#
# Targets:
# <file.exe> build a specific file
-.PHONY : all
-.SUFFIXES : .c .o .exe
+.PHONY: all
+.SUFFIXES: .c .o .exe
+.SECONDARY: ../util/readtex.o ../util/showbuffer.o
TOP = ../..
-CPU ?= pentium
CC = mingw32-gcc
-CFLAGS = -Wall -W -pedantic
-CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
+CFLAGS = -Wall -pedantic
+CFLAGS += -O2 -ffast-math -D_DLL
CFLAGS += -I$(TOP)/include -I../util
-CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK -D_STDCALL_SUPPORTED
-CFLAGS += -D_WINDEF_ -D_WINGDI_
+ifeq ($(FX),1)
+ CFLAGS += -DFX
+endif
+
+CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK
LD = mingw32-g++
LDFLAGS = -s -L$(TOP)/lib
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
-.o.exe:
- $(LD) -o $@ $(LDFLAGS) $< $(LDLIBS)
+%.exe: ../util/readtex.o ../util/showbuffer.o %.o
+ $(LD) -o $@ $(LDFLAGS) $(LDLIBS) $^
+
all:
$(error Must specify <filename.exe> to build)