Skip to content

Commit

Permalink
add support for building static library
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid Plyushch committed Jul 21, 2019
1 parent af4778c commit 76da963
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 76da963

Please sign in to comment.