2010-11-27 00:02:21 +01:00
|
|
|
# Makefile for Irrlicht Examples
|
|
|
|
# It's usually sufficient to change just the target name and source file list
|
|
|
|
# and be sure that CXX is set to a valid compiler
|
2011-01-07 18:39:27 +01:00
|
|
|
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
|
2010-12-23 21:35:53 +01:00
|
|
|
|
|
|
|
DEBUG_TARGET = debugtest
|
|
|
|
DEBUG_SOURCES = $(addprefix src/, $(SOURCE_FILES))
|
|
|
|
DEBUG_BUILD_DIR = debugbuild
|
|
|
|
DEBUG_OBJECTS = $(addprefix $(DEBUG_BUILD_DIR)/, $(SOURCE_FILES:.cpp=.o))
|
2010-12-19 18:11:05 +01:00
|
|
|
|
|
|
|
FAST_TARGET = fasttest
|
2010-12-22 15:30:23 +01:00
|
|
|
FAST_SOURCES = $(addprefix src/, $(SOURCE_FILES))
|
|
|
|
FAST_BUILD_DIR = fastbuild
|
|
|
|
FAST_OBJECTS = $(addprefix $(FAST_BUILD_DIR)/, $(SOURCE_FILES:.cpp=.o))
|
2010-12-19 18:11:05 +01:00
|
|
|
|
|
|
|
SERVER_TARGET = server
|
2011-01-07 18:56:47 +01:00
|
|
|
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
|
2010-12-19 18:11:05 +01:00
|
|
|
SERVER_SOURCES = $(addprefix src/, $(SERVER_SOURCE_FILES))
|
2010-12-20 21:03:49 +01:00
|
|
|
SERVER_BUILD_DIR = serverbuild
|
2010-12-19 18:11:05 +01:00
|
|
|
SERVER_OBJECTS = $(addprefix $(SERVER_BUILD_DIR)/, $(SERVER_SOURCE_FILES:.cpp=.o))
|
2010-11-27 00:02:21 +01:00
|
|
|
|
|
|
|
IRRLICHTPATH = ../irrlicht/irrlicht-1.7.1
|
|
|
|
JTHREADPATH = ../jthread/jthread-1.2.1
|
|
|
|
|
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
all: fast
|
2010-11-27 00:02:21 +01:00
|
|
|
|
|
|
|
ifeq ($(HOSTTYPE), x86_64)
|
|
|
|
LIBSELECT=64
|
|
|
|
endif
|
|
|
|
|
2011-01-07 18:39:27 +01:00
|
|
|
debug: CXXFLAGS = -Wall -g -O1
|
|
|
|
debug: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DDEBUG -DRUN_IN_PLACE
|
|
|
|
debug: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz
|
|
|
|
|
|
|
|
fast: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686
|
2011-01-07 18:56:47 +01:00
|
|
|
fast: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DUNITTEST_DISABLE -DRUN_IN_PLACE
|
2011-01-07 18:39:27 +01:00
|
|
|
fast: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz
|
|
|
|
|
|
|
|
server: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686
|
2011-01-07 18:56:47 +01:00
|
|
|
server: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DSERVER -DUNITTEST_DISABLE -DRUN_IN_PLACE
|
2011-01-07 18:39:27 +01:00
|
|
|
server: LDFLAGS = -L$(JTHREADPATH)/src/.libs -ljthread -lz -lpthread
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
DEBUG_DESTPATH = bin/$(DEBUG_TARGET)
|
2010-12-23 09:29:09 +01:00
|
|
|
FAST_DESTPATH = bin/$(FAST_TARGET)
|
|
|
|
SERVER_DESTPATH = bin/$(SERVER_TARGET)
|
2010-11-27 00:02:21 +01:00
|
|
|
|
|
|
|
# Build commands
|
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
debug: $(DEBUG_BUILD_DIR) $(DEBUG_DESTPATH)
|
|
|
|
fast: $(FAST_BUILD_DIR) $(FAST_DESTPATH)
|
|
|
|
server: $(SERVER_BUILD_DIR) $(SERVER_DESTPATH)
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
$(DEBUG_BUILD_DIR):
|
|
|
|
mkdir -p $(DEBUG_BUILD_DIR)
|
2010-12-22 15:30:23 +01:00
|
|
|
$(FAST_BUILD_DIR):
|
|
|
|
mkdir -p $(FAST_BUILD_DIR)
|
2010-12-20 13:04:31 +01:00
|
|
|
$(SERVER_BUILD_DIR):
|
2010-12-19 18:11:05 +01:00
|
|
|
mkdir -p $(SERVER_BUILD_DIR)
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
$(DEBUG_DESTPATH): $(DEBUG_OBJECTS)
|
|
|
|
$(CXX) -o $@ $(DEBUG_OBJECTS) $(LDFLAGS)
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2010-12-22 15:30:23 +01:00
|
|
|
$(FAST_DESTPATH): $(FAST_OBJECTS)
|
2010-12-23 21:35:53 +01:00
|
|
|
$(CXX) -o $@ $(FAST_OBJECTS) $(LDFLAGS)
|
2010-12-19 18:11:05 +01:00
|
|
|
|
|
|
|
$(SERVER_DESTPATH): $(SERVER_OBJECTS)
|
2010-12-23 21:35:53 +01:00
|
|
|
$(CXX) -o $@ $(SERVER_OBJECTS) $(LDFLAGS)
|
2010-12-19 18:11:05 +01:00
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
$(DEBUG_BUILD_DIR)/%.o: src/%.cpp
|
2010-11-27 00:02:21 +01:00
|
|
|
$(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
|
|
|
|
|
2010-12-22 15:30:23 +01:00
|
|
|
$(FAST_BUILD_DIR)/%.o: src/%.cpp
|
|
|
|
$(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
|
|
|
|
|
2010-12-19 18:11:05 +01:00
|
|
|
$(SERVER_BUILD_DIR)/%.o: src/%.cpp
|
|
|
|
$(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
|
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
clean: clean_debug clean_fast clean_server
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
clean_debug:
|
|
|
|
@$(RM) $(DEBUG_OBJECTS) $(DEBUG_DESTPATH)
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
clean_fast:
|
2010-12-23 09:29:09 +01:00
|
|
|
@$(RM) $(FAST_OBJECTS) $(FAST_DESTPATH)
|
2010-12-19 18:11:05 +01:00
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
clean_server:
|
2010-12-19 18:11:05 +01:00
|
|
|
@$(RM) $(SERVER_OBJECTS) $(SERVER_DESTPATH)
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2010-12-23 21:35:53 +01:00
|
|
|
.PHONY: all all_win32 clean clean_debug clean_win32 clean_fast clean_server
|