2010-11-26 18:02:21 -05: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
|
|
|
|
TARGET = test
|
2010-12-20 15:03:49 -05:00
|
|
|
SOURCE_FILES = 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-11-26 18:02:21 -05:00
|
|
|
SOURCES = $(addprefix src/, $(SOURCE_FILES))
|
2010-12-20 15:03:49 -05:00
|
|
|
BUILD_DIR = build
|
2010-12-19 12:11:05 -05:00
|
|
|
OBJECTS = $(addprefix $(BUILD_DIR)/, $(SOURCE_FILES:.cpp=.o))
|
|
|
|
#OBJECTS = $(SOURCES:.cpp=.o)
|
|
|
|
|
|
|
|
FAST_TARGET = fasttest
|
|
|
|
|
|
|
|
SERVER_TARGET = server
|
2010-12-20 07:04:31 -05:00
|
|
|
SERVER_SOURCE_FILES = 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 12:11:05 -05:00
|
|
|
SERVER_SOURCES = $(addprefix src/, $(SERVER_SOURCE_FILES))
|
2010-12-20 15:03:49 -05:00
|
|
|
SERVER_BUILD_DIR = serverbuild
|
2010-12-19 12:11:05 -05:00
|
|
|
SERVER_OBJECTS = $(addprefix $(SERVER_BUILD_DIR)/, $(SERVER_SOURCE_FILES:.cpp=.o))
|
|
|
|
#SERVER_OBJECTS = $(SERVER_SOURCES:.cpp=.o)
|
2010-11-26 18:02:21 -05:00
|
|
|
|
|
|
|
IRRLICHTPATH = ../irrlicht/irrlicht-1.7.1
|
|
|
|
JTHREADPATH = ../jthread/jthread-1.2.1
|
|
|
|
|
|
|
|
#CXXFLAGS = -O2 -ffast-math -Wall -fomit-frame-pointer -pipe
|
2010-12-11 11:11:03 -05:00
|
|
|
CXXFLAGS = -O2 -ffast-math -Wall -g -pipe
|
2010-11-26 18:02:21 -05:00
|
|
|
#CXXFLAGS = -O1 -ffast-math -Wall -g
|
2010-12-11 11:11:03 -05:00
|
|
|
#CXXFLAGS = -Wall -g -O0
|
2010-11-26 18:02:21 -05:00
|
|
|
|
2010-12-19 12:11:05 -05:00
|
|
|
#FAST_CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686
|
2010-11-26 18:02:21 -05:00
|
|
|
|
|
|
|
#Default target
|
|
|
|
|
|
|
|
all: all_linux
|
|
|
|
|
|
|
|
ifeq ($(HOSTTYPE), x86_64)
|
|
|
|
LIBSELECT=64
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Target specific settings
|
|
|
|
|
2010-12-13 18:56:24 -05:00
|
|
|
all_linux fast_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz
|
2010-12-19 12:11:05 -05:00
|
|
|
all_linux fast_linux: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src
|
|
|
|
fast_linux server_linux: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686
|
|
|
|
server_linux: LDFLAGS = -L$(JTHREADPATH)/src/.libs -ljthread -lz -lpthread
|
|
|
|
server_linux: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DSERVER
|
2010-11-26 18:02:21 -05:00
|
|
|
all_linux fast_linux clean_linux: SYSTEM=Linux
|
|
|
|
|
2010-12-19 12:11:05 -05:00
|
|
|
# These are out of date
|
2010-11-26 18:02:21 -05:00
|
|
|
all_win32: LDFLAGS = -L$(IRRLICHTPATH)/lib/Win32-gcc -L$(JTHREADPATH)/Debug -lIrrlicht -lopengl32 -lm -ljthread
|
|
|
|
all_win32 clean_win32: SYSTEM=Win32-gcc
|
|
|
|
all_win32 clean_win32: SUF=.exe
|
|
|
|
|
|
|
|
# Name of the binary - only valid for targets which set SYSTEM
|
|
|
|
|
|
|
|
DESTPATH = bin/$(TARGET)$(SUF)
|
2010-12-19 12:11:05 -05:00
|
|
|
FAST_DESTPATH = bin/$(FAST_TARGET)$(SUF)
|
|
|
|
SERVER_DESTPATH = bin/$(SERVER_TARGET)$(SUF)
|
2010-11-26 18:02:21 -05:00
|
|
|
|
|
|
|
# Build commands
|
|
|
|
|
2010-12-20 07:04:31 -05:00
|
|
|
all_linux all_win32: $(BUILD_DIR) $(DESTPATH)
|
|
|
|
fast_linux: $(BUILD_DIR) $(FAST_DESTPATH)
|
|
|
|
server_linux: $(SERVER_BUILD_DIR) $(SERVER_DESTPATH)
|
2010-11-26 18:02:21 -05:00
|
|
|
|
2010-12-20 07:04:31 -05:00
|
|
|
$(BUILD_DIR):
|
2010-12-19 12:11:05 -05:00
|
|
|
mkdir -p $(BUILD_DIR)
|
2010-12-20 07:04:31 -05:00
|
|
|
$(SERVER_BUILD_DIR):
|
2010-12-19 12:11:05 -05:00
|
|
|
mkdir -p $(SERVER_BUILD_DIR)
|
2010-11-26 18:02:21 -05:00
|
|
|
|
|
|
|
$(DESTPATH): $(OBJECTS)
|
|
|
|
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
|
|
|
|
|
2010-12-19 12:11:05 -05:00
|
|
|
$(FAST_DESTPATH): $(SOURCES)
|
|
|
|
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS) -DUNITTEST_DISABLE
|
|
|
|
|
|
|
|
$(SERVER_DESTPATH): $(SERVER_OBJECTS)
|
|
|
|
$(CXX) -o $@ $(SERVER_OBJECTS) $(LDFLAGS) -DSERVER -DUNITTEST_DISABLE
|
|
|
|
|
|
|
|
$(BUILD_DIR)/%.o: src/%.cpp
|
2010-11-26 18:02:21 -05:00
|
|
|
$(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
|
|
|
|
|
2010-12-19 12:11:05 -05:00
|
|
|
$(SERVER_BUILD_DIR)/%.o: src/%.cpp
|
|
|
|
$(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)
|
|
|
|
|
|
|
|
clean: clean_linux clean_win32 clean_fast_linux clean_server_linux
|
2010-11-26 18:02:21 -05:00
|
|
|
|
|
|
|
clean_linux clean_win32:
|
|
|
|
@$(RM) $(OBJECTS) $(DESTPATH)
|
|
|
|
|
|
|
|
clean_fast_linux:
|
2010-12-19 12:11:05 -05:00
|
|
|
@$(RM) $(OBJECTS) $(FAST_DESTPATH)
|
|
|
|
|
|
|
|
clean_server_linux:
|
|
|
|
@$(RM) $(SERVER_OBJECTS) $(SERVER_DESTPATH)
|
2010-11-26 18:02:21 -05:00
|
|
|
|
2010-12-19 12:11:05 -05:00
|
|
|
.PHONY: all all_win32 clean clean_linux clean_win32 clean_fast_linux clean_server_linux
|