wangzhengquan
2021-01-14 87f014b618c130b9f06d344ec50622d66da5d041
test/Makefile
@@ -1,53 +1,37 @@
ROOT=..
EXTRALIBS+=
INCLUDE+=-I. -I$(ROOT)/squeue/include -I$(ROOT)/squeue -I$(ROOT)/common/include
LIBCOMMON=$(ROOT)/common/libusgcommon.a
LIBSQUEUE=$(ROOT)/squeue/libsqueue.a
LDLIBS = -lpthread
ROOT := ..
PLATFORM=$(shell $(ROOT)/systype.sh)
include $(ROOT)/Make.defines.$(PLATFORM)
RPATH += -Wl,-rpath=$(ROOT)/lib:$(DEST)/lib
# 开源工具包路径
LDDIR += -L$(DEST)/lib
PROGS =   test_queue productor consumer single_productor single_consumer
#-lusgcommon
# 开源工具包
LDLIBS += -lshm_queue -lpthread -lusgcommon
#-I$(ROOT)/include/usgcommon
INCLUDES += -I${ROOT}/src -I${ROOT}/src/shm -I${ROOT}/src/queue -I${ROOT}/src/socket  -I${ROOT}/include/usgcommon
all: $(PROGS)
PROGS = ${DEST}/test_sem
# test1: $(LIBCOMMON)
DEPENDENCES = $(patsubst %, %.d, $(PROGS))
# 如果包A 引用包B, B 要放在 A 后面
# svshm_reader:  binary_sems.c  $(LIBSQUEUE) $(LIBCOMMON)
#LIBCOMMON=${ROOT}/lib/libusgcommon.a
# svshm_writer:  binary_sems.c  $(LIBSQUEUE) $(LIBCOMMON)
build: $(PROGS)
test_queue: test.h  $(ROOT)/squeue/include/SArrayLockFreeQueue.h $(ROOT)/squeue/include/SLinkedLockFreeQueue.h  $(ROOT)/squeue/include/QFactory.h  $(LIBSQUEUE) $(LIBCOMMON)
productor: test.h  $(ROOT)/squeue/include/SArrayLockFreeQueue.h $(ROOT)/squeue/include/SLinkedLockFreeQueue.h $(ROOT)/squeue/include/QFactory.h  $(LIBSQUEUE) $(LIBCOMMON)
consumer: test.h  $(ROOT)/squeue/include/SArrayLockFreeQueue.h $(ROOT)/squeue/include/SLinkedLockFreeQueue.h $(ROOT)/squeue/include/QFactory.h $(LIBSQUEUE) $(LIBCOMMON)
single_productor: test.h  $(ROOT)/squeue/include/SArrayLockFreeQueue.h $(ROOT)/squeue/include/SLinkedLockFreeQueue.h $(ROOT)/squeue/include/QFactory.h  $(LIBSQUEUE) $(LIBCOMMON)
single_consumer: test.h  $(ROOT)/squeue/include/SArrayLockFreeQueue.h $(ROOT)/squeue/include/SLinkedLockFreeQueue.h $(ROOT)/squeue/include/QFactory.h $(LIBSQUEUE) $(LIBCOMMON)
# test_lostdata: test.h  $(LIBSQUEUE) $(LIBCOMMON)
# consumer_timeout: $(ROOT)/squeue/include/squeue.h test.h  $(LIBSQUEUE) $(LIBCOMMON)
# productor_timeout: $(ROOT)/squeue/squeue.h $(LIBSQUEUE) $(LIBCOMMON)
# test_atomic: $(ROOT)/squeue/squeue.h $(LIBSQUEUE) $(LIBCOMMON)
clean:
   rm -f $(PROGS) $(TEMPFILES) *.o
   rm -f $(PROGS) $(DEPENDENCES) $(TEMPFILES)
# $(LIBCOMMON):
#    @(cd $(ROOT)/common && $(MAKE))
-include $(DEPENDENCES)
include $(ROOT)/Make.common.inc
$(LIBCOMMON):
   (cd $(ROOT)/common && $(MAKE))
$(LIBSQUEUE):
   (cd $(ROOT)/squeue && $(MAKE))