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
$(LIBFILE): $(LIBSRC:=.c) $(LIBSRC:=.h)
$(CC) $(CFLAGS) -fPIC -shared -o $@ $<
$(CC) $(CFLAGS) -fPIC -shared -o $@ $(LIBSRC:=.c)
# Executable files
%: %.c $(LIBSRC:=.c) $(LIBSRC:=.h)
$(CC) $(CFLAGS) -o $@ $< $(LIBSRC:=.c)
%: %.c $(LIBFILE)
$(CC) $(CFLAGS) -o $@ $^
# Special executable
qrcodegen-test: qrcodegen-test.c $(LIBSRC:=.c) $(LIBSRC:=.h)

Loading…
Cancel
Save