summaryrefslogtreecommitdiff
path: root/RealtimeSync/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'RealtimeSync/makefile')
-rw-r--r--RealtimeSync/makefile64
1 files changed, 48 insertions, 16 deletions
diff --git a/RealtimeSync/makefile b/RealtimeSync/makefile
index c0386603..b1c78f61 100644
--- a/RealtimeSync/makefile
+++ b/RealtimeSync/makefile
@@ -2,23 +2,53 @@ APPNAME = RealtimeSync
prefix = /usr
BINDIR = $(DESTDIR)$(prefix)/bin
-CPPFLAGS = -Wall -pipe -O3 -pthread -std=gnu++0x -DNDEBUG -DwxUSE_UNICODE -DFFS_LINUX -DZEN_PLATFORM_OTHER -DWXINTL_NO_GETTEXT_MACRO -I.. -include "../zen/i18n.h" -include "zen/warn_static.h"
-LINKFLAGS = -pthread -lrt
+CPPFLAGS = -std=c++11 -Wall -pipe -O3 -DNDEBUG -DwxUSE_UNICODE -DZEN_PLATFORM_OTHER -DWXINTL_NO_GETTEXT_MACRO -I.. -include "zen/i18n.h" -include "zen/warn_static.h"
+LINKFLAGS =
-ifeq ($(BUILD),release)
-#static wxWidgets and boost library linkage for precompiled release
-CPPFLAGS += `wx-config --cxxflags --debug=no --unicode=yes --static=yes`
-LINKFLAGS += `wx-config --libs --debug=no --unicode=yes --static=yes` -Wl,-Bstatic -lboost_thread -lboost_system -Wl,-Bdynamic
+#distinguish Linux/Mac builds
+OPERATING_SYSTEM_NAME := $(shell uname)
+
+#################### Linux ############################
+ifeq ($(OPERATING_SYSTEM_NAME), Linux)
+COMPILER_BIN=g++ -pthread
+CPPFLAGS += -DFFS_LINUX
+
+#Gtk - support "no button border"
+CPPFLAGS += `pkg-config --cflags gtk+-2.0`
+LINKFLAGS += `pkg-config --libs gtk+-2.0`
+
+ifeq ($(BUILD),Launchpad)
+#default build/Launchpad
+CPPFLAGS += `wx-config --cxxflags --debug=no`
+LINKFLAGS += `wx-config --libs --debug=no` -lboost_thread -lboost_system
else
-#default build
-CPPFLAGS += `wx-config --cxxflags --debug=no --unicode=yes`
-LINKFLAGS += `wx-config --libs --debug=no --unicode=yes` -lboost_thread -lboost_system
+#static wxWidgets and boost library linkage for precompiled release
+WX_CONFIG_BIN =$(HOME)/Desktop/wxGTK-2.8.12/lib/release/bin/wx-config
+CPPFLAGS += -I$(HOME)/Desktop/boost_1_53_0
+BOOST_LIB_DIR =$(HOME)/Desktop/boost_1_53_0/stage/lib
+
+CPPFLAGS += `$(WX_CONFIG_BIN) --cxxflags --debug=no --static=yes`
+LINKFLAGS += `$(WX_CONFIG_BIN) --libs --debug=no --static=yes` $(BOOST_LIB_DIR)/libboost_thread.a $(BOOST_LIB_DIR)/libboost_system.a
endif
-#####################################################################################################
-#Gtk - no button border
-CPPFLAGS += `pkg-config --cflags gtk+-2.0`
-LINKFLAGS += `pkg-config --libs gtk+-2.0`
+endif
+#################### OS X ############################
+ifeq ($(OPERATING_SYSTEM_NAME), Darwin)
+COMPILER_BIN=clang++ -stdlib=libc++
+CPPFLAGS += -DFFS_MAC
+
+WX_CONFIG_BIN =$(HOME)/Desktop/wxWidgets-2.9.4/lib/release/bin/wx-config
+CPPFLAGS += -I$(HOME)/Desktop/boost_1_53_0
+BOOST_LIB_DIR =$(HOME)/Desktop/boost_1_53_0/stage/lib
+MACOS_SDK =-mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
+#-Wl,-Bstatic not supported on OSX!
+
+# link wxWidgets and boost statically -> check dependencies with: otool -L RealtimeSync
+CPPFLAGS += $(MACOS_SDK) `$(WX_CONFIG_BIN) --cxxflags --debug=no --static=yes`
+LINKFLAGS += $(MACOS_SDK) `$(WX_CONFIG_BIN) --libs --debug=no --static=yes` $(BOOST_LIB_DIR)/libboost_thread.a $(BOOST_LIB_DIR)/libboost_system.a
+
+endif
+#####################################################################################################
CPP_LIST= #internal list of all *.cpp files needed for compilation
CPP_LIST+=application.cpp
@@ -36,6 +66,7 @@ CPP_LIST+=../lib/localization.cpp
CPP_LIST+=../lib/process_xml.cpp
CPP_LIST+=../lib/resolve_path.cpp
CPP_LIST+=../lib/xml_base.cpp
+CPP_LIST+=../lib/ffs_paths.cpp
CPP_LIST+=../zen/dir_watcher.cpp
CPP_LIST+=../zen/file_handling.cpp
CPP_LIST+=../zen/file_io.cpp
@@ -43,22 +74,23 @@ CPP_LIST+=../zen/file_traverser.cpp
CPP_LIST+=../zen/zstring.cpp
CPP_LIST+=../wx+/button.cpp
-#list of all *.o files
+#list of all *.o files (we need the "RTS" subdirectory to handle "../*.cpp" files
OBJECT_LIST=$(CPP_LIST:%.cpp=../OBJ/RTS_Release_GCC_Make/RTS/%.o)
all: RealtimeSync
../OBJ/RTS_Release_GCC_Make/RTS/%.o : %.cpp
mkdir -p $(dir $@)
- g++ $(CPPFLAGS) -c $< -o $@
+ $(COMPILER_BIN) $(CPPFLAGS) -c $< -o $@
RealtimeSync: $(OBJECT_LIST)
- g++ -o ../BUILD/$(APPNAME) $(OBJECT_LIST) $(LINKFLAGS)
+ $(COMPILER_BIN) -o ../BUILD/$(APPNAME) $(OBJECT_LIST) $(LINKFLAGS)
clean:
#-f doesn't work when deleting directories
if [ -d ../OBJ/RTS_Release_GCC_Make ]; then rm -rf ../OBJ/RTS_Release_GCC_Make; fi
rm -f ../BUILD/$(APPNAME)
+ rm -f ../wx+/pch.h.gch
install:
mkdir -p $(BINDIR)
bgstack15