Added variable for library file name, added library to the default build - in the C makefile.

This commit is contained in:
Project Nayuki 2017-07-21 18:57:09 -04:00
parent ea59bedc93
commit c936e2c1de
1 changed files with 4 additions and 3 deletions

View File

@ -52,17 +52,18 @@ CFLAGS += -O1
# ---- Targets to build ----
LIBSRC = qrcodegen
LIBFILE = libqrcodegen.so
MAINS = qrcodegen-demo qrcodegen-test qrcodegen-worker
# Build all binaries
all: $(MAINS)
all: $(LIBFILE) $(MAINS)
# Delete build output
clean:
rm -f -- $(MAINS) libqrcodegen.so
rm -f -- $(LIBFILE) $(MAINS)
# Shared library
libqrcodegen.so: $(LIBSRC:=.c) $(LIBSRC:=.h)
$(LIBFILE): $(LIBSRC:=.c) $(LIBSRC:=.h)
$(CC) $(CFLAGS) -fPIC -shared -o $@ $<
# Executable files