From a3dcc36dd47714341eef97427f4e1c116160b60f Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Fri, 21 Jul 2017 12:22:17 +0300 Subject: [PATCH] Add shared library make target for C library --- c/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/c/Makefile b/c/Makefile index e19ed1d..6340c67 100644 --- a/c/Makefile +++ b/c/Makefile @@ -59,12 +59,15 @@ all: $(MAINS) # Delete build output clean: - rm -f -- $(MAINS) + rm -f -- $(MAINS) libqrcodegen.so # Executable files %: %.c $(LIBSRC:=.c) $(LIBSRC:=.h) $(CC) $(CFLAGS) -o $@ $< $(LIBSRC:=.c) +libqrcodegen.so: $(LIBSRC:=.c) $(LIBSRC:=.h) + $(CC) $(CFLAGS) -fPIC -shared -o $@ $< + # Special executable qrcodegen-test: qrcodegen-test.c $(LIBSRC:=.c) $(LIBSRC:=.h) $(CC) $(CFLAGS) -DQRCODEGEN_TEST -o $@ $< $(LIBSRC:=.c)