assimp/tools/assimp_cmd/makefile.mingw

79 lines
2.6 KiB
Plaintext

# ---------------------------------------------------------------------------
# Makefile for assimp_cmd (mingw32-make)
# aramis_acg@users.sourceforge.net
#
# Usage: mingw32-make -f makefile.mingw <target> <macros>
# TARGETS:
# all Build assimp_cmd tool and assimp if necessary
# clean Cleanup all object files, including those from core
# cleanme Cleanup only my object files
# MACROS: (make clean before you change one)
# NOBOOST=1 Build Assimp against boost workaround
# SINGLETHREADED=1 Build Assimp single-threaded library
# DEBUG=1 Build debug build of Assimp library
# ---------------------------------------------------------------------------
# C++ object files
OBJECTS = $(patsubst %.cpp,%.o, $(wildcard *.cpp))
# Windows resource files
RCFILES = $(patsubst %.rc,%.res, $(wildcard *.rc))
# Specify additional include paths here
INCLUDEFLAGS = -I../../include
# Specify additional library paths here
LIBRARYFLAGS = -L../../bin/mingw/
# Specify additional cpp definitions here
DEFINEFLAGS = -DASSIMP_BUILD_BOOST_WORKAROUND
# Specify additional gcc compiler flags here
CPPFLAGS=-Wall
# Specify the output executable name here
OUTPUT = ../../bin/mingw/assimp
# ---------------------------------------------------------------------------
# Setup environment for debug/release builds
# ---------------------------------------------------------------------------
ifeq ($(DEBUG),1)
DEFINEFLAGS += -D_DEBUG -DDEBUG
else
CPPFLAGS += -o3
DEFINEFLAGS += -DNDEBUG -D_NDEBUG
endif
# ---------------------------------------------------------------------------
# all: Build assimp and assimp_cmd
# ---------------------------------------------------------------------------
all: $(OBJECTS) $(RCFILES)
cd ../../code/ && $(MAKE) -fmakefile.mingw static
gcc -s -o$(OUTPUT) $(OBJECTS) $(RCFILES) $(LIBRARYFLAGS) -lassimp -lstdc++
# ---------------------------------------------------------------------------
# clean: Clean assimp and assimp_cmd
# ---------------------------------------------------------------------------
.PHONY: clean
clean:
-del *.o *.res
cd ../../code/ && $(MAKE) -fmakefile.mingw clean
# ---------------------------------------------------------------------------
# cleanme: Clean assimp_cmd only
# ---------------------------------------------------------------------------
.PHONY: cleanme
cleanme:
-del *.o *.res
%.o:%.cpp
$(CXX) -g -c $(CPPFLAGS) $? -o $@ $(INCLUDEFLAGS) $(DEFINEFLAGS)
%.res:%.rc
windres $? -O coff -o $@