#Directory to VortexServer
SERVERPATH = ../SimulationManager

all: Example 

Example: RNNPBExample

CPPFLAGS += -g -fPIC -Wall -pedantic -rdynamic -std=c++0x

#for performance:
CPPFLAGS += -Ofast -static -static-libgcc -static-libstdc++
#CPPFLAGS += -m32 -march=i686	#32 bit

#intel i7 optimization:
CPPFLAGS += -march=corei7-avx -mtune=corei7-avx		#sandy-bridge
#CPPFLAGS += -march=corei7 -mtune=corei7		#westmere

#for debugging:
#CPPFLAGS += -Wl,--unresolved-symbols=report-all

#for profiling-based optimization:
PROFILING = 0

#RNNPB-Test
RNNPBExample: src/Example.cpp src/RNNPBlib/*.cpp 
ifeq ($(PROFILING), 1)
	$(CXX) $(CPPFLAGS) -fprofile-generate $^ -o $@ ${INCLUDES} ${LIBRARIES}
	./RNNPBExample --test
	$(CXX) $(CPPFLAGS) -fprofile-use $^ -o $@ ${INCLUDES} ${LIBRARIES}
else
	$(CXX) $(CPPFLAGS) $^ -o $@ ${INCLUDES} ${LIBRARIES}
endif


INCLUDES = -I $(SERVERPATH)/src -I ./src/3rdParty/boost_1_53_0

LIBRARIES = ./src/3rdParty/boost_1_53_0/stage/lib/libboost_serialization.a -pthread -lrt
