From 4f3f598e6f3705936e09a0508b1e1bbbbbe683b3 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期一, 20 七月 2020 17:46:40 +0800 Subject: [PATCH] change makefile --- queue/Makefile | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/queue/Makefile b/queue/Makefile index c18e39a..8c59c1b 100644 --- a/queue/Makefile +++ b/queue/Makefile @@ -2,12 +2,12 @@ # Makefile for common library. # ROOT=.. -#LDLIBS+=-Wl,-rpath=$(ROOT)/common:$(ROOT)/lib/jsoncpp +LDLIBS+=-Wl,-rpath=$(ROOT)/lib # 寮�婧愬伐鍏峰寘璺緞 -#LDDIR += -L$(ROOT)/lib/jsoncpp -L$(ROOT)/lib/nng +LDDIR += -L$(ROOT)/lib # 寮�婧愬伐鍏峰寘 -#LDLIBS += -ljsoncpp -lnng -lpthread +LDLIBS += -lusgcommon #INCLUDE += -I$(ROOT)/device/include @@ -20,7 +20,13 @@ SOURCES := $(wildcard *.c) OBJS = $(patsubst %.c, %.o, $(SOURCES)) -MYLIBS = $(LIBSQUEUE) +MYLIBS = $(LIBSQUEUE) $(DLIBSQUEUE) + +ifeq ($(DEBUG),y) + MYLIBS = $(LIBSQUEUE) +else + MYLIBS = $(LIBSQUEUE) $(DLIBSQUEUE) +endif all: build @@ -32,10 +38,13 @@ $(AR) rv $@ $? $(RANLIB) $@ +LDFLAGS += -L$(ROOT)/lib -lusgcommon #dynamic lib $(DLIBSQUEUE): $(SOURCES) +#$(DLIBSQUEUE): $(SOURCES) $(ROOT)/lib/libusgcommon.so rm -f *.o $(CC) -fPIC -shared $(CFLAGS) $^ -o $@ $(LDFLAGS) + #$(CC) -fPIC -shared $(CFLAGS) $(LDFLAGS) -o $@ $^ -Wl,--whole-archive $(ROOT)/lib/libusgcommon.a -Wl,--no-whole-archive #PREFIX is environment variable, but if it is not set, then set default value -- Gitblit v1.8.0