Browse Source

assimp_cmd: makefile.mingw now embeds icon and version into the executable.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@386 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 16 years ago
parent
commit
07b7814da9
1 changed files with 33 additions and 16 deletions
  1. 33 16
      tools/assimp_cmd/makefile.mingw

+ 33 - 16
tools/assimp_cmd/makefile.mingw

@@ -1,6 +1,6 @@
 
 # ---------------------------------------------------------------------------
-# Makefile for assimp_cmd (MinGW32-make)
+# Makefile for assimp_cmd (mingw32-make)
 # [email protected]
 #
 # Usage: mingw32-make -f makefile.mingw <target> <macros>
@@ -16,24 +16,30 @@
 #   DEBUG=1              Build debug build of Assimp library
 # ---------------------------------------------------------------------------
 
-
 # C++ object files
-OBJECTS   := $(patsubst %.cpp,%.o,  $(wildcard *.cpp)) 
+OBJECTS = $(patsubst %.cpp,%.o,  $(wildcard *.cpp)) 
+
+# Windows resource files
+RCFILES = $(patsubst %.rc,%.res,  $(wildcard *.rc)) 
 
-# Include flags for gcc
+# Specify additional include paths here
 INCLUDEFLAGS = -I../../include
 
-# Library flags for gcc
+# Specify additional library paths here
 LIBRARYFLAGS = -L../../bin/mingw/
 
-# Preprocessor defines for gcc
+# Specify additional cpp definitions here
 DEFINEFLAGS =  -DASSIMP_BUILD_BOOST_WORKAROUND
 
-# GCC compiler flags 
+# Specify additional gcc compiler flags here
 CPPFLAGS=-Wall
 
+# Specify the output executable name here
+OUTPUT = ../../bin/mingw/assimp
 
-# Setup environment for debug build
+# ---------------------------------------------------------------------------
+# Setup environment for debug/release builds
+# ---------------------------------------------------------------------------
 ifeq ($(DEBUG),1)
 	DEFINEFLAGS   += -D_DEBUG -DDEBUG
 else
@@ -41,21 +47,32 @@ else
 	DEFINEFLAGS   += -DNDEBUG -D_NDEBUG
 endif
 
-# Output path of executable
-OUTPUT = ../../bin/mingw/assimp
-
-all:	$(OBJECTS)
+# ---------------------------------------------------------------------------
+# all: Build assimp and assimp_cmd
+# ---------------------------------------------------------------------------
+all:	$(OBJECTS) $(RCFILES)
 	cd ../../code/ && $(MAKE) -fmakefile.mingw static 
-	gcc -s -o$(OUTPUT) $(OBJECTS) $(LIBRARYFLAGS) -lassimp -lstdc++ 
+	gcc -s -o$(OUTPUT) $(OBJECTS) $(RCFILES) $(LIBRARYFLAGS) -lassimp -lstdc++ 
 
-%.o:%.cpp
-	$(CXX) -g -c  $(CPPFLAGS) $? -o $@ $(INCLUDEFLAGS) $(DEFINEFLAGS)
 
+# ---------------------------------------------------------------------------
+# clean: Clean assimp and assimp_cmd
+# ---------------------------------------------------------------------------
 .PHONY: clean
 clean:
 	-del *.o
 	cd ../../code/ && $(MAKE) -fmakefile.mingw clean
 
+# ---------------------------------------------------------------------------
+# cleanme: Clean assimp_cmd only
+# ---------------------------------------------------------------------------
 .PHONY: cleanme
 cleanme:
-	-del *.o
+	-del *.o
+
+%.o:%.cpp
+	$(CXX) -g -c  $(CPPFLAGS) $? -o $@ $(INCLUDEFLAGS) $(DEFINEFLAGS)
+
+%.res:%.rc
+	windres $? -O coff -o $@
+