chapter 7 code

This commit is contained in:
Bo Wang
2016-11-01 00:22:15 -04:00
parent 809451045e
commit fffe4528da
8 changed files with 1059 additions and 0 deletions

34
ch7/Makefile Normal file
View File

@@ -0,0 +1,34 @@
CPP = g++-4.9
CPPFLAGS = -g -std=c++0x
OFLAG = -o
.SUFFIXES : .o .cpp .c
.cpp.o :
$(CPP) $(CPPFLAGS) -c $<
.c.o :
$(CPP) $(CPPFLAGS) -c $<
PROGS = stack stack_hp queue_spsc queue_mpmc
all: $(PROGS)
stack: stack.o
$(CPP) $(OFLAG) stack stack.o -lpthread
stack_hp: stack_hp.o
$(CPP) $(OFLAG) stack_hp stack_hp.o -lpthread
stack_sp: stack_sp.o
$(CPP) $(OFLAG) stack_sp stack_sp.o -lpthread
stack_ref: stack_ref.o
$(CPP) $(OFLAG) stack_ref stack_ref.o -lpthread
queue_spsc: queue_spsc.o
$(CPP) $(OFLAG) queue_spsc queue_spsc.o -lpthread
queue_mpmc: queue_mpmc.o
$(CPP) $(OFLAG) queue_mpmc queue_mpmc.o -lpthread
clean:
rm -f ${PROGS} *.o