From 7075db21d17618489de603979845751a6872b37c Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Fri, 21 Jul 2017 19:00:43 -0400 Subject: [PATCH] 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. --- c/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c/Makefile b/c/Makefile index 0e302cc..a33f8d2 100644 --- a/c/Makefile +++ b/c/Makefile @@ -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)