From e7e07f42b336bb7b5c488eb3bcc6397c0a2a03f4 Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期一, 24 八月 2020 16:36:09 +0800
Subject: [PATCH] fix conflict

---
 algorithm/Makefile |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/algorithm/Makefile b/algorithm/Makefile
new file mode 100644
index 0000000..be7f44e
--- /dev/null
+++ b/algorithm/Makefile
@@ -0,0 +1,53 @@
+#
+# Makefile for common library.
+#
+ROOT=..
+PLATFORM=$(shell $(ROOT)/systype.sh)
+LIBCOMMON=$(ROOT)/common/libusgcommon.a
+DLIBCOMMON=$(ROOT)/common/libusgcommon.so
+LIBALG = libalg.a
+DLIBALG = libalg.so
+LDLIBS =-L$(ROOT)/common -lusgcommon $(EXTRALIBS)
+
+include $(ROOT)/Make.defines.$(PLATFORM)
+
+SOURCES := $(wildcard *.c)
+OBJS   = $(patsubst %.c, %.o, $(SOURCES)) 
+
+all: $(LIBALG) $(DLIBALG)
+
+
+graph.o:  $(LIBCOMMON) 
+
+IndirectAlg.o: $(LIBCOMMON) 
+
+#static lib
+$(LIBALG): $(OBJS) $(LIBCOMMON)
+	$(AR) rv $@ $?
+	$(RANLIB) $@
+
+#dynamic lib
+$(DLIBALG):	$(SOURCES) $(DLIBCOMMON)
+	rm -f *.o
+	# $(CC) -fPIC $(CFLAGS) $(filter-out $(DLIBCOMMON), $^) -o $@ $(LDFLAGS) $(LDLIBS)
+	$(CC) -fPIC -shared $(CFLAGS) -o  $@  $(filter-out $(DLIBCOMMON), $^)
+
+#PREFIX is environment variable, but if it is not set, then set default value
+ifeq ($(PREFIX),)
+    PREFIX := /usr/local
+endif
+
+# 浣跨敤鏂瑰紡锛� g++ test1.c  -lcommon
+install: $(DLIBALG)
+	sudo install -d $(PREFIX)/lib/
+	sudo install -m 644 $^ $(PREFIX)/lib/
+	sudo install -d $(PREFIX)/include/
+	sudo install -m 644 include/* $(PREFIX)/include/
+
+clean:
+	rm -f *.o a.out core temp.* *.a *.so
+
+	
+
+
+include $(ROOT)/Make.common.inc

--
Gitblit v1.8.0