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.

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

@ -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)

Loading…
Cancel
Save