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

pull/14/merge
Project Nayuki 8 years ago
parent ea59bedc93
commit c936e2c1de

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

Loading…
Cancel
Save