[hackers] [libgrapheme] Explicitly use object-files in library-generation || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Fri, 24 Jun 2022 00:47:26 +0200 (CEST)

commit 7d8e17d4ff3c126ebd1ec743225f4acd1b6198cf
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Fri Jun 24 00:45:56 2022 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Fri Jun 24 00:45:56 2022 +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_AT_frign.de>

diff --git a/Makefile b/Makefile
index 2866c92..6e6baa1 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -187,11 +187,11 @@ $(TEST):
         $(CC) -c -o $_AT_ $(CPPFLAGS) $(CFLAGS) $<
 
 libgrapheme.a: $(SRC:=.o)
- $(AR) rc $_AT_ $?
+ $(AR) rc $_AT_ $(SRC:=.o)
         $(RANLIB) $_AT_
 
 libgrapheme.so: $(SRC:=.o)
- $(CC) -o $_AT_ -shared $?
+ $(CC) -o $_AT_ -shared $(SRC:=.o)
 
 benchmark: $(BENCHMARK)
         for m in $(BENCHMARK); do ./$$m; done
Received on Fri Jun 24 2022 - 00:47:26 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 24 2022 - 00:48:29 CEST