From a5f8bdf484b74b4358974337ec07a3f18bbe0291 Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期二, 14 七月 2020 16:28:35 +0800 Subject: [PATCH] lib --- /dev/null | 0 test2/test_queue_wrapper | 0 queue/Makefile | 8 ++++---- queue/libshm_queue.so | 0 Makefile | 2 +- test2/client | 0 test2/server | 0 include/usgcommon/usg_common.h | 3 +-- test2/Makefile | 2 +- lib/libusgcommon.so | 0 Make.defines.linux | 8 ++++---- 11 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Make.defines.linux b/Make.defines.linux index 3b61627..ef20eaa 100755 --- a/Make.defines.linux +++ b/Make.defines.linux @@ -8,7 +8,7 @@ LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) LDFLAGS= LDDIR += -L$(ROOT)/lib -LDLIBS += $(LDDIR) -lusgcommon $(EXTRALIBS) +LDLIBS += $(LDDIR) $(EXTRALIBS) INCLUDE += -I. -I./include -I$(ROOT)/include -I$(ROOT)/include/usgcommon ifeq ($(DEBUG),y) @@ -21,13 +21,13 @@ RANLIB=echo AR=ar AWK=awk -LIBCOMMON=$(ROOT)/common/libusgcommon.a +#LIBCOMMON=$(ROOT)/common/libusgcommon.a # Common temp files to delete from each directory. TEMPFILES=core core.* *.o temp.* *.out *.a *.so -%: %.c $(LIBCOMMON) - $(CC) $(CFLAGS) $(filter-out $(LIBCOMMON), $^) -o $@ $(LDFLAGS) $(LDLIBS) +%: %.c + $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) diff --git a/Makefile b/Makefile index 22e32ca..04304ee 100755 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -DIRS = queue test test2 +DIRS = queue test2 all: for i in $(DIRS); do \ diff --git a/include/usgcommon/usg_common.h b/include/usgcommon/usg_common.h index 20fefe9..ad509ed 100644 --- a/include/usgcommon/usg_common.h +++ b/include/usgcommon/usg_common.h @@ -64,10 +64,9 @@ #include <algorithm> #include <iomanip> #include <limits> +#include <map> #include <initializer_list> #include <vector> -#include <map> -#include <set> #include <thread> #endif diff --git a/lib/libusgcommon.so b/lib/libusgcommon.so new file mode 100644 index 0000000..dd862b0 --- /dev/null +++ b/lib/libusgcommon.so Binary files differ diff --git a/queue/Makefile b/queue/Makefile index c18e39a..c9a9e38 100644 --- a/queue/Makefile +++ b/queue/Makefile @@ -7,7 +7,7 @@ #LDDIR += -L$(ROOT)/lib/jsoncpp -L$(ROOT)/lib/nng # 寮�婧愬伐鍏峰寘 -#LDLIBS += -ljsoncpp -lnng -lpthread +LDLIBS += -lusgcommon #INCLUDE += -I$(ROOT)/device/include @@ -20,7 +20,7 @@ SOURCES := $(wildcard *.c) OBJS = $(patsubst %.c, %.o, $(SOURCES)) -MYLIBS = $(LIBSQUEUE) +MYLIBS = $(LIBSQUEUE) $(DLIBSQUEUE) all: build @@ -29,13 +29,13 @@ #static lib $(LIBSQUEUE): $(OBJS) - $(AR) rv $@ $? + $(AR) rv $@ $? $(ROOT)/lib/libusgcommon.a $(RANLIB) $@ #dynamic lib $(DLIBSQUEUE): $(SOURCES) rm -f *.o - $(CC) -fPIC -shared $(CFLAGS) $^ -o $@ $(LDFLAGS) + $(CC) -fPIC -shared $(CFLAGS) $^ -o $@ $(LDFLAGS) $(ROOT)/lib/libusgcommon.so #PREFIX is environment variable, but if it is not set, then set default value diff --git a/queue/libshm_queue.a b/queue/libshm_queue.a deleted file mode 100644 index 4676de3..0000000 --- a/queue/libshm_queue.a +++ /dev/null Binary files differ diff --git a/queue/libshm_queue.so b/queue/libshm_queue.so new file mode 100755 index 0000000..d050417 --- /dev/null +++ b/queue/libshm_queue.so Binary files differ diff --git a/test/multiple_queue_consumer b/test/multiple_queue_consumer deleted file mode 100755 index 0db518d..0000000 --- a/test/multiple_queue_consumer +++ /dev/null Binary files differ diff --git a/test/multiple_queue_productor b/test/multiple_queue_productor deleted file mode 100755 index 29046c6..0000000 --- a/test/multiple_queue_productor +++ /dev/null Binary files differ diff --git a/test/single_consumer b/test/single_consumer deleted file mode 100755 index f3369d1..0000000 --- a/test/single_consumer +++ /dev/null Binary files differ diff --git a/test/single_productor b/test/single_productor deleted file mode 100755 index f0a8b92..0000000 --- a/test/single_productor +++ /dev/null Binary files differ diff --git a/test/test_lostdata b/test/test_lostdata deleted file mode 100755 index 7ca646d..0000000 --- a/test/test_lostdata +++ /dev/null Binary files differ diff --git a/test/test_queue b/test/test_queue deleted file mode 100755 index f8b2955..0000000 --- a/test/test_queue +++ /dev/null Binary files differ diff --git a/test/test_timeout b/test/test_timeout deleted file mode 100755 index d83e4ce..0000000 --- a/test/test_timeout +++ /dev/null Binary files differ diff --git a/test2/Makefile b/test2/Makefile index 9743df5..54c80cb 100644 --- a/test2/Makefile +++ b/test2/Makefile @@ -2,7 +2,7 @@ # Makefile for common library. # ROOT=.. -#LDLIBS+=-Wl,-rpath=$(ROOT)/common:$(ROOT)/lib/jsoncpp +LDLIBS+=-Wl,-rpath=$(ROOT)/queue # 寮�婧愬伐鍏峰寘璺緞 LDDIR += -L$(ROOT)/queue # 寮�婧愬伐鍏峰寘 diff --git a/test2/client b/test2/client index 516aeb1..2e70d5e 100755 --- a/test2/client +++ b/test2/client Binary files differ diff --git a/test2/server b/test2/server index 47e62b9..de8a68d 100755 --- a/test2/server +++ b/test2/server Binary files differ diff --git a/test2/test_queue_wrapper b/test2/test_queue_wrapper index 493e51d..1840703 100755 --- a/test2/test_queue_wrapper +++ b/test2/test_queue_wrapper Binary files differ -- Gitblit v1.8.0