Makefile.bak 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Makefile for Irrlicht Examples
  2. # It's usually sufficient to change just the target name and source file list
  3. # and be sure that CXX is set to a valid compiler
  4. SOURCE_FILES = porting.cpp guiMessageMenu.cpp materials.cpp guiTextInputMenu.cpp guiInventoryMenu.cpp irrlichtwrapper.cpp guiPauseMenu.cpp defaultsettings.cpp mapnode.cpp tile.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp client.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp main.cpp test.cpp
  5. DEBUG_TARGET = debugtest
  6. DEBUG_SOURCES = $(addprefix src/, $(SOURCE_FILES))
  7. DEBUG_BUILD_DIR = debugbuild
  8. DEBUG_OBJECTS = $(addprefix $(DEBUG_BUILD_DIR)/, $(SOURCE_FILES:.cpp=.o))
  9. FAST_TARGET = fasttest
  10. FAST_SOURCES = $(addprefix src/, $(SOURCE_FILES))
  11. FAST_BUILD_DIR = fastbuild
  12. FAST_OBJECTS = $(addprefix $(FAST_BUILD_DIR)/, $(SOURCE_FILES:.cpp=.o))
  13. SERVER_TARGET = server
  14. SERVER_SOURCE_FILES = porting.cpp materials.cpp defaultsettings.cpp mapnode.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp servermain.cpp test.cpp
  15. SERVER_SOURCES = $(addprefix src/, $(SERVER_SOURCE_FILES))
  16. SERVER_BUILD_DIR = serverbuild
  17. SERVER_OBJECTS = $(addprefix $(SERVER_BUILD_DIR)/, $(SERVER_SOURCE_FILES:.cpp=.o))
  18. IRRLICHTPATH = ../irrlicht/irrlicht-1.7.1
  19. JTHREADPATH = ../jthread/jthread-1.2.1
  20. all: fast
  21. ifeq ($(HOSTTYPE), x86_64)
  22. LIBSELECT=64
  23. endif
  24. debug: CXXFLAGS = -Wall -g -O1
  25. debug: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DDEBUG -DRUN_IN_PLACE
  26. debug: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz
  27. fast: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686
  28. fast: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DUNITTEST_DISABLE -DRUN_IN_PLACE
  29. fast: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz
  30. server: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686
  31. server: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DSERVER -DUNITTEST_DISABLE -DRUN_IN_PLACE
  32. server: LDFLAGS = -L$(JTHREADPATH)/src/.libs -ljthread -lz -lpthread
  33. DEBUG_DESTPATH = bin/$(DEBUG_TARGET)
  34. FAST_DESTPATH = bin/$(FAST_TARGET)
  35. SERVER_DESTPATH = bin/$(SERVER_TARGET)
  36. # Build commands
  37. debug: $(DEBUG_BUILD_DIR) $(DEBUG_DESTPATH)
  38. fast: $(FAST_BUILD_DIR) $(FAST_DESTPATH)
  39. server: $(SERVER_BUILD_DIR) $(SERVER_DESTPATH)
  40. $(DEBUG_BUILD_DIR):
  41. mkdir -p $(DEBUG_BUILD_DIR)
  42. $(FAST_BUILD_DIR):
  43. mkdir -p $(FAST_BUILD_DIR)
  44. $(SERVER_BUILD_DIR):
  45. mkdir -p $(SERVER_BUILD_DIR)
  46. $(DEBUG_DESTPATH): $(DEBUG_OBJECTS)
  47. $(CXX) -o $@ $(DEBUG_OBJECTS) $(LDFLAGS)
  48. $(FAST_DESTPATH): $(FAST_OBJECTS)
  49. $(CXX) -o $@ $(FAST_OBJECTS) $(LDFLAGS)
  50. $(SERVER_DESTPATH): $(SERVER_OBJECTS)
  51. $(CXX) -o $@ $(SERVER_OBJECTS) $(LDFLAGS)
  52. $(DEBUG_BUILD_DIR)/%.o: src/%.cpp
  53. $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
  54. $(FAST_BUILD_DIR)/%.o: src/%.cpp
  55. $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
  56. $(SERVER_BUILD_DIR)/%.o: src/%.cpp
  57. $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
  58. clean: clean_debug clean_fast clean_server
  59. clean_debug:
  60. @$(RM) $(DEBUG_OBJECTS) $(DEBUG_DESTPATH)
  61. clean_fast:
  62. @$(RM) $(FAST_OBJECTS) $(FAST_DESTPATH)
  63. clean_server:
  64. @$(RM) $(SERVER_OBJECTS) $(SERVER_DESTPATH)
  65. .PHONY: all all_win32 clean clean_debug clean_win32 clean_fast clean_server