wangzhengquan
2020-12-01 caecfd9123e17b916c1e6e79f967afb3cdeaa0bb
test/Makefile
@@ -1,90 +1,39 @@
# 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
# all: $(PROGS)
# # test1: $(LIBCOMMON)
# # 如果包A 引用包B, 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
ROOT := ..
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
#RPATH += -Wl,-rpath=${ROOT}/lib
# 开源工具包路径
LDDIR += -L${DEST}/lib
# 开源工具包
LDLIBS += -lshm_queue -lusgcommon -lpthread
INCLUDES += -I${DEST}/include/shmqueue -I$(ROOT)/include/usgcommon
build: $(PROGS)
PROGS = ${DEST}/test test2
DEPENDENCES = $(patsubst %, %.d, $(PROGS))
# test1: $(LIBCOMMON)
#LIBCOMMON=${ROOT}/lib/libusgcommon.a
# 如果包A 引用包B, B 要放在 A 后面
build:    $(PROGS)
test_queue: test.h  $(ROOT)/squeue/include/lock_free_queue.h
single_productor: test.h  $(ROOT)/squeue/include/lock_free_queue.h
# class
#$(DEST)/kucker : kucker.c
single_consumer: test.h  $(ROOT)/squeue/include/lock_free_queue.h
clean:
   rm -f $(TEMPFILES) $(PROGS)
   rm -f $(PROGS) $(DEPENDENCES) $(TEMPFILES)
# $(LIBCOMMON):
#    @(cd $(ROOT)/common && $(MAKE))
-include $(DEPENDENCES)
include $(ROOT)/Make.common.inc
$(LIBSQUEUE):
   (cd $(ROOT)/squeue && $(MAKE))