Hello,
I couldn't find a mingw makefile, as I wanted to use my own IDE, but apologies if there already is one. I've made a makefile for mingw that works with either mingw's makefile (mingw32-make) or msys make if MSYS is installed (if you have codeblocks you will probably only have mingw32-make). It works on the current version of box2d with the following targets:
box2d - just the library
examples - the testbed and helloworld, including the glui and glut. as an added bonus testbed doesn't create two windows

clean - remove .o files
veryclean - remove .o files and .a files
all - make library and examples
e.g. from the command line
mingw32-make
(will make everything)
mingw32-make box2d
(will make just the library)
substitute mingw32-make for 'make'
Just unzip it in the build folder. Don't know if it'll help anyone

I have MSYS, but I disabled it and it worked fine with mingw32-make, but obviously problems do occur sometimes...
The file is attached, but here it is if anyone wants to read it:
Code:
# targets are
# box2d - just create the box2d library
# examples - just create the examples
# all - create everything. or simply call make/mingw32-make by itself
# clean - remove all .o files
# veryclean - remove all .o and .a files
CC = gcc
CXX = g++
LD = g++
CFLAGS = -O2 -s -fexceptions
LIBDIR = ../../Library
LIBDIRMINGW = ..\..\Library
INCLUDEDIR = ../../Include
EXAMPLES = ../../Examples
SOURCE = ../../Source/
CONTRIB = ../../Contrib/
TESTLIBS = -lBox2d -lfreeglut -lglui -lGLU32 -lOpenGL32 -lWinMM -lGDI32
OBJDIR = obj
OBJ_CPP_CORE += $(addprefix $(OBJDIR)/core/, $(subst $(SOURCE),,$(patsubst %.cpp,%.o,$(wildcard $(SOURCE)*/*.cpp))))
OBJ_CPP_CORE += $(addprefix $(OBJDIR)/core/, $(subst $(SOURCE),,$(patsubst %.cpp,%.o,$(wildcard $(SOURCE)*/*/*.cpp))))
OBJ_CPP_GLUI += $(addprefix $(OBJDIR)/glui/, $(subst $(CONTRIB)glui/,,$(patsubst %.cpp,%.o,$(wildcard $(CONTRIB)glui/*.cpp))))
OBJ_C_FREE += $(addprefix $(OBJDIR)/freeglut/, $(subst $(CONTRIB)freeglut/,,$(patsubst %.c,%.o,$(wildcard $(CONTRIB)freeglut/*.c))))
ifeq ($(findstring /sh.exe, $(SHELL)), /sh.exe)
UNIX_TOOLS=1
endif
all: createdir box2d examples
examples: createdir hello glui freeglut testbed
box2d: createdir $(OBJ_CPP_CORE)
ar rc $(LIBDIR)/libbox2d.a $(OBJDIR)/core/*.o
@echo BOX2D LIBRARY MADE
$(OBJDIR)/core/%.o: $(SOURCE)%.cpp
$(CXX) $(CFLAGS) -o $(OBJDIR)/core/$(notdir $@) -c $<
createdir:
ifdef UNIX_TOOLS
-mkdir $(OBJDIR)
-mkdir $(OBJDIR)/core
-mkdir $(OBJDIR)/glui
-mkdir $(OBJDIR)/freeglut
else
-mkdir $(OBJDIR)
-mkdir $(OBJDIR)\core
-mkdir $(OBJDIR)\glui
-mkdir $(OBJDIR)\freeglut
endif
@echo TEMP AREA CREATED
hello:
$(CXX) $(CFLAGS) -I$(INCLUDEDIR) $(EXAMPLES)/HelloWorld/HelloWorld.cpp -L$(LIBDIR) -lBox2D -o HelloWorld.exe
@echo HELLO SAMPLE MADE
glui: $(OBJ_CPP_GLUI)
ar rc $(LIBDIR)/libglui.a $(OBJDIR)/glui/*.o
@echo GLUI LIBRARY MADE
$(OBJDIR)/glui/%.o: $(CONTRIB)glui/%.cpp
$(CXX) $(CFLAGS) -DFREEGLUT_STATIC -I$(CONTRIB)glui -o $(OBJDIR)/glui/$(notdir $@) -c $<
freeglut: $(OBJ_C_FREE)
ar rc $(LIBDIR)/libfreeglut.a $(OBJDIR)/freeglut/*.o
@echo FREEGLUT LIBRARY MADE
$(OBJDIR)/freeglut/%.o: $(CONTRIB)freeglut/%.c
$(CC) $(CFLAGS) -DFREEGLUT_STATIC -I$(CONTRIB)freeglut -o $(OBJDIR)/freeglut/$(notdir $@) -c $<
testbed:
$(CXX) $(CFLAGS) -DFREEGLUT_STATIC -I$(INCLUDEDIR) -I$(CONTRIB) $(EXAMPLES)/TestBed/Tests/*.cpp $(EXAMPLES)/TestBed/Framework/*.cpp -L$(LIBDIR) $(TESTLIBS) -o TestBed.exe
@echo TESTBED DONE
clean:
ifdef UNIX_TOOLS
-rm $(OBJDIR)/core/*.o
-rm $(OBJDIR)/glui/*.o
-rm $(OBJDIR)/freeglut/*.o
else
-del $(OBJDIR)\core\*.o
-del $(OBJDIR)\glui\*.o
-del $(OBJDIR)\freeglut\*.o
endif
@echo DONE CLEAN
veryclean: clean
ifdef UNIX_TOOLS
-rm $(LIBDIR)/*.a
else
-del $(LIBDIRMINGW)\*.a
endif
@echo DONE VERYCLEAN