commit 7d8e17d4ff3c126ebd1ec743225f4acd1b6198cf
parent a5542c3d89353ee818b434606cc44c67d7aaa0ae
Author: Laslo Hunhold <dev@frign.de>
Date: Fri, 24 Jun 2022 00:45:56 +0200
Explicitly use object-files in library-generation
The macro $? only evaluates to the list of prerequisites that are
newer than the current target. While this incidentally works when
simply compiling, this leads to the library-files only including
the changed .o-file (and nothing else!) when a single source file
has been changed.
This is easily fixed by explicitly listing the object-files.
Signed-off-by: Laslo Hunhold <dev@frign.de>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
@@ -187,11 +187,11 @@ $(TEST):
$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
libgrapheme.a: $(SRC:=.o)
- $(AR) rc $@ $?
+ $(AR) rc $@ $(SRC:=.o)
$(RANLIB) $@
libgrapheme.so: $(SRC:=.o)
- $(CC) -o $@ -shared $?
+ $(CC) -o $@ -shared $(SRC:=.o)
benchmark: $(BENCHMARK)
for m in $(BENCHMARK); do ./$$m; done