From ca312c023b11d7885227addc7564494998d8898c Mon Sep 17 00:00:00 2001
From: cheliequan <liequanche@126.com>
Date: 星期三, 28 十二月 2022 13:31:58 +0800
Subject: [PATCH] 更新ipc client库和使用示例
---
src/Makefile | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 5dd8487..62eef2d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,20 +2,28 @@
AR=ar
CFLAGS=-g -D __SHMT_DEBUG_MODE__=1 -Wall -I${INCLUDE}
INCLUDE=-I. -I ../include
-all:shmht shmht_mytests
+all:shmht shmht_mytests ipc_server ipc_client
gcc -g -c -Wall -Werror -I${INCLUDE} -fpic list_in_shm.c memfd.c -lpthread
gcc -shared -o liblistInShm.so list_in_shm.o memfd.o
# gcc test_list_in_shm.c liblistInShm.so -lpthread
shmht: shmht.o memfd.o
$(CC) -o libshmht.so $(CFLAGS) -shared $^
$(AR) rcs libshmht.a $^
-shmht.o: shmht.c shmht.h
+shmht.o: shmht.c
$(CC) $(CFLAGS) $(INCLUDE) -fPIC -c shmht.c
shmht_mytests: shmht_mytests.o shmht.o memfd.o
$(CC) $(CFLAGS) $(INCLUDE) -L . -pthread -o $@ $^
-shmht_mytests.o: shmht.h
+shmht_mytests.o:
$(CC) $(CFLAGS) $(INCLUDE) -fPIC -c shmht_mytests.c
memfd.o:
$(CC) $(CFLAGS) $(INCLUDE) -fPIC -c memfd.c
+ipc_server:libipc_server.so
+ $(CC) $(CFLAGS) $(INCLUDE) -fPIC -pthread -o $@ ipc_server.c -lipc_server -L .
+libipc_server.so:
+ $(CC) -shared -fPIC -o $@ ipc_server_lib.c ipc_msg.c memfd.c
+ipc_client:libipc_client.so
+ $(CC) $(CFLAGS) $(INCLUDE) -fPIC -o $@ ipc_client.c ipc_msg.c memfd.c -lipc_client -L .
+libipc_client.so:
+ $(CC) -shared -fPIC -o $@ ipc_client_lib.c ipc_msg.c memfd.c
clean:
- rm -rf *.so *.o a.out shmht_mytests *.a
+ rm -rf *.so *.o a.out shmht_mytests *.a ipc_client ipc_server
--
Gitblit v1.8.0