Changed C makefile rules to use the shared library when possible, and to fix library build rule if there is more than one .c source file.

This commit is contained in:
Project Nayuki 2017-07-21 19:00:43 -04:00
parent c936e2c1de
commit 7075db21d1
1 changed files with 3 additions and 3 deletions

View File

@ -64,11 +64,11 @@ clean:
# Shared library # Shared library
$(LIBFILE): $(LIBSRC:=.c) $(LIBSRC:=.h) $(LIBFILE): $(LIBSRC:=.c) $(LIBSRC:=.h)
$(CC) $(CFLAGS) -fPIC -shared -o $@ $< $(CC) $(CFLAGS) -fPIC -shared -o $@ $(LIBSRC:=.c)
# Executable files # Executable files
%: %.c $(LIBSRC:=.c) $(LIBSRC:=.h) %: %.c $(LIBFILE)
$(CC) $(CFLAGS) -o $@ $< $(LIBSRC:=.c) $(CC) $(CFLAGS) -o $@ $^
# Special executable # Special executable
qrcodegen-test: qrcodegen-test.c $(LIBSRC:=.c) $(LIBSRC:=.h) qrcodegen-test: qrcodegen-test.c $(LIBSRC:=.c) $(LIBSRC:=.h)