added rule to Makefile to ensure reproducible builds
authorHolger Schemel <info@artsoft.org>
Wed, 28 Sep 2022 15:40:44 +0000 (17:40 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 28 Sep 2022 15:40:44 +0000 (17:40 +0200)
Declare build dependency to ensure consistent make execution order.
See https://reproducible-builds.org/ for why this is good.

Without this patch, parallelism would make a difference in
the produced config.o

This patch was done while working on reproducible builds for openSUSE.

Thanks to Bernhard M. Wiedemann for this patch!

src/Makefile

index b9a75a6bb4289a691393fc810c41ff534e8943b4..f634296e13e0ff84812ca307e630b217d7a07607 100644 (file)
@@ -316,6 +316,8 @@ conf-hash:
        @echo '#define SOURCE_HASH_STRING "$(SOURCE_HASH_STRING)"' \
        > $(COMMIT_HASH_FILE)
 
+config.o: config.c $(TIMESTAMP_FILE)
+
 $(TIMESTAMP_FILE): $(SRCS) $(RNDLIBS)
        @$(MAKE) conf-time