From 76da96358213eae725c6df66cc6d1cd08f193327 Mon Sep 17 00:00:00 2001 From: Leonid Plyushch Date: Sun, 21 Jul 2019 20:09:17 +0300 Subject: [PATCH] add support for building static library --- Makefile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4082546..fb33bb4 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,21 @@ -CFLAGS += -fpic -shared -std=c11 -Wall -Wextra -Wl,--version-script=exports.txt +CFLAGS += -fpic -shared -std=c11 -Wall -Wextra +LDFLAGS += -Wl,--version-script=exports.txt -libandroid-shmem.so: shmem.c shm.h - $(CC) $(CFLAGS) $(LDFLAGS) shmem.c -llog -o $@ +libandroid-shmem.a: shmem.o + $(AR) rcu $@ shmem.o -install: libandroid-shmem.so shm.h +libandroid-shmem.so: shmem.o + $(CC) $(LDFLAGS) -shared shmem.o -o $@ -llog + +shmem.o: shmem.c shm.h + $(CC) $(CFLAGS) -c shmem.c -o $@ + +install: libandroid-shmem.a libandroid-shmem.so shm.h + install -D libandroid-shmem.a $(PREFIX)/lib/libandroid-shmem.a install -D libandroid-shmem.so $(PREFIX)/lib/libandroid-shmem.so install -D shm.h $(PREFIX)/include/sys/shm.h clean: - rm -f libandroid-shmem.so + rm -f libandroid-shmem.a libandroid-shmem.so .PHONY: install