# test_ice makefile

# Vars

SHELL=/bin/sh
CXX=g++
DYN_CXXFLAGS=-g -Wall -I. -I/usr/include
STATIC_CXXFLAGS=-g -Wall -I. -DTEST_ICE_STATIC
DYN_LDFLAGS=-L/usr/lib/
STATIC_LDFLAGS=-L/usr/lib/ -static -static-libgcc
RM=rm -f
prefix=..
  
DYN_OBJECTS=\
	bytestream.o \
	kitchensink.o \
	main.o \
	socketops.o

STATIC_OBJECTS=\
	s_bytestream.o \
	s_kitchensink.o \
	s_main.o \
	s_socketops.o

# Rules

all : test_ice test_ice-static

test_ice : $(DYN_OBJECTS)
	$(CXX) $(DYN_CXXFLAGS) -o test_ice $(DYN_OBJECTS) $(DYN_LDFLAGS)
	
test_ice-static : $(STATIC_OBJECTS)
	$(CXX) $(STATIC_CXXFLAGS) -o test_ice-static $(STATIC_OBJECTS) $(STATIC_LDFLAGS)
	
bytestream.o : ../gtmurmur/bytestream.cpp
	$(CXX) $(DYN_CXXFLAGS) -c ../gtmurmur/bytestream.cpp -o bytestream.o
kitchensink.o : ../gtmurmur/kitchensink.cpp
	$(CXX) $(DYN_CXXFLAGS) -c ../gtmurmur/kitchensink.cpp -o kitchensink.o
main.o : main.cpp
	$(CXX) $(DYN_CXXFLAGS) -c main.cpp -o main.o
socketops.o : ../gtmurmur/socketops.cpp
	$(CXX) $(DYN_CXXFLAGS) -c ../gtmurmur/socketops.cpp -o socketops.o

s_bytestream.o : ../gtmurmur/bytestream.cpp
	$(CXX) $(STATIC_CXXFLAGS) -c ../gtmurmur/bytestream.cpp -o s_bytestream.o
s_kitchensink.o : ../gtmurmur/kitchensink.cpp
	$(CXX) $(STATIC_CXXFLAGS) -c ../gtmurmur/kitchensink.cpp -o s_kitchensink.o
s_main.o : main.cpp
	$(CXX) $(STATIC_CXXFLAGS) -c main.cpp -o s_main.o
s_socketops.o : ../gtmurmur/socketops.cpp
	$(CXX) $(STATIC_CXXFLAGS) -c ../gtmurmur/socketops.cpp -o s_socketops.o

.PHONY : clean
clean :
	$(RM) test_ice test_ice-static $(DYN_OBJECTS) $(STATIC_OBJECTS)
	
.PHONY : install
install : test_ice test_ice-static
	install -m 0755 test_ice $(prefix)/bin/linux/x86
	install -m 0755 test_ice-static $(prefix)/bin/linux/x86

	
	
