#
# "make all" to build necessary executables.
#

CC              = gcc

LIB             = -lpthread -lrt -lm
INC             = -I. -I../include

CFLAGS          = -Wall -O3
LINK_FLAG       = -rdynamic 

.SUFFIXES:
.SUFFIXES: .o .c

.c.o:
	$(CC) $(CFLAGS) $(INC) $(DEFS) -c $*.c

all: tpcc_result tpcc_master tpcc_client tpcc_stop

tpcc_client : main.o support.o driver.o
	$(CC) $(LINK_FLAG) main.o support.o driver.o $(LIB) -o ../bin/tpcc_client

tpcc_result : result.o support.o
	$(CC) $(LINK_FLAG) result.o support.o $(LIB) -o ../bin/tpcc_result

tpcc_master : master.o support.o
	$(CC) $(LINK_FLAG) master.o support.o $(LIB) -o ../bin/tpcc_master

tpcc_stop : stop.o
	$(CC) $(LINK_FLAG) stop.o support.o $(LIB) -o ../bin/tpcc_stop

clean :
	rm -f *.o ../bin/tpcc_master ../bin/tpcc_client ../bin/tpcc_result ../bin/tpcc_stop
