shm implemented as memfd syscall
cheliequan
2022-12-08 7e877be8fb34ab99421a2eaf3d8fb1b96ed95206
src/Makefile
@@ -1,6 +1,21 @@
all:
   gcc -g -c -Wall -Werror -fpic list_in_shm.c  memfd.c -lpthread
CC=gcc
AR=ar
CFLAGS=-g -D __SHMT_DEBUG_MODE__=1 -Wall  -I${INCLUDE}
INCLUDE=-I. -I ../include
all:shmht shmht_mytests
   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
#   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
   $(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
   $(CC) $(CFLAGS) $(INCLUDE) -fPIC -c shmht_mytests.c
memfd.o:
   $(CC) $(CFLAGS) $(INCLUDE) -fPIC -c memfd.c
clean:
   rm -rf *.so *.o a.out
   rm -rf *.so *.o a.out shmht_mytests *.a