CFLAGS=-O3  -I../include -DUSE_SPROC -D_BSD_SIGNALS -D_DEBUG_=1 -D_TRY_VOLATILE_
CFLAGS1=-O1  -I../include -DUSE_SPROC -D_BSD_SIGNALS -D_DEBUG_=1 -D_TRY_VOLATILE_
# CFLAGS=-Ofast  -I../include -DUSE_SPROC -D_BSD_SIGNALS -D_DEBUG_
OBJS=shmem.o ukey.o gettime.o
TARGET=testwait testwait2 testwait3 testq testq2 testq3
HEADER=../include/ukey.h ../include/anl_shmem.h ../include/twait.h ../include/tqueue.h

.IGNORE :

all : $(TARGET)

testwait : twait.tv.o testwait.c $(OBJS)
	cc $(CFLAGS) twait.tv.o $@.c $(OBJS)  -o $@
	
testwait2 : twait.tv.o testwait2.c $(OBJS)
	cc $(CFLAGS1) twait.tv.o $@.c $(OBJS)  -o $@
	
testwait3 : twait.o testwait2.c $(OBJS)
	cc $(CFLAGS1) twait.o testwait2.c $(OBJS)  -o $@
	
testq : tqueue.o $$@.c $(OBJS)
	cc $(CFLAGS) tqueue.o $@.c $(OBJS)  -o $@
	
testq2 : tqueue.o $$@.c $(OBJS)
	cc $(CFLAGS) tqueue.o $@.c $(OBJS)  -o $@
	
testq3 : tqueue.o $$@.c $(OBJS)
	cc $(CFLAGS) tqueue.o $@.c $(OBJS)  -o $@

shmem.o : ../shmem/shmem.c
	cc $(CFLAGS) -c $? -o $@

ukey.o : ../ukey/ukey_sproc.c
	cc $(CFLAGS) -c $? -o $@

twait.o : twait.c

twait.tv.o : twait.tv.c

tqueue.o : tqueue.c

gettime.o : ../kernelbench/gettime.c
	cc -c $(CFLAGS) $?

rebuild : 
	touch *.c
	/bin/rm shmem.o ukey.o
	make all
