From 37a7bd95042c19d7334b099d50ac6dc8e07e4b4e Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期二, 07 七月 2020 16:40:51 +0800 Subject: [PATCH] update --- test/Makefile | 103 +++++++++++++++++++++++++++++++++++---------------- 1 files changed, 70 insertions(+), 33 deletions(-) diff --git a/test/Makefile b/test/Makefile index f20ab24..dd3b2b0 100755 --- a/test/Makefile +++ b/test/Makefile @@ -1,53 +1,90 @@ -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 -PLATFORM=$(shell $(ROOT)/systype.sh) -include $(ROOT)/Make.defines.$(PLATFORM) +# 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 +# PLATFORM=$(shell $(ROOT)/systype.sh) +# include $(ROOT)/Make.defines.$(PLATFORM) -PROGS = test_queue productor consumer single_productor single_consumer +# PROGS = test_queue productor consumer single_productor single_consumer -all: $(PROGS) +# all: $(PROGS) + +# # test1: $(LIBCOMMON) + +# # 濡傛灉鍖匒 寮曠敤鍖匓锛� B 瑕佹斁鍦� A 鍚庨潰 +# # svshm_reader: binary_sems.c $(LIBSQUEUE) $(LIBCOMMON) + +# # svshm_writer: binary_sems.c $(LIBSQUEUE) $(LIBCOMMON) + +# 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 + + + +# +# Makefile for common library. +# +ROOT=.. +#LDLIBS+=-Wl,-rpath=$(ROOT)/common:$(ROOT)/lib/jsoncpp +# 寮�婧愬伐鍏峰寘璺緞 +LDDIR += -L$(ROOT)/squeue +# 寮�婧愬伐鍏峰寘 +LDLIBS += -lsqueue -lpthread + +INCLUDE += -I$(ROOT)/squeue/ -I$(ROOT)/squeue/include + +PLATFORM=$(shell $(ROOT)/systype.sh) +include $(ROOT)/Make.defines.$(PLATFORM) + + +PROGS = test_queue single_productor single_consumer multiple_queue_productor multiple_queue_consumer test_timeout + + +build: $(PROGS) + + # test1: $(LIBCOMMON) # 濡傛灉鍖匒 寮曠敤鍖匓锛� B 瑕佹斁鍦� A 鍚庨潰 -# svshm_reader: binary_sems.c $(LIBSQUEUE) $(LIBCOMMON) + -# svshm_writer: binary_sems.c $(LIBSQUEUE) $(LIBCOMMON) +test_queue: test.h $(ROOT)/squeue/include/lock_free_queue.h -test_queue: 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/lock_free_queue.h - -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) +single_consumer: test.h $(ROOT)/squeue/include/lock_free_queue.h clean: - rm -f $(PROGS) $(TEMPFILES) *.o + rm -f $(TEMPFILES) $(PROGS) -$(LIBCOMMON): - (cd $(ROOT)/common && $(MAKE)) $(LIBSQUEUE): (cd $(ROOT)/squeue && $(MAKE)) -- Gitblit v1.8.0