Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cr-marcstevens/sha1collisiondetection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcr-marcstevens <github@marc-stevens.nl>2017-03-14 00:22:31 +0300
committercr-marcstevens <github@marc-stevens.nl>2017-03-14 00:22:31 +0300
commit657d7e9ef1f80c2ae1cb8a767f69da79c92c4c88 (patch)
treef0884bbed229f1114d1b69e43ca444435d91e2a8
parent6e60421533749586a0336976e471d9c91f6fd8a3 (diff)
Fixed Makefile to correctly rebuild when a header file is modified
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index e887bed..7cf6f6d 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,7 @@ SRC_DIR=src
SRC_DEP_DIR=dep_src
SRC_OBJ_DIR=obj_src
+H_DEP:=$(shell find . -type f -name "*.h")
FS_LIB=$(wildcard $(LIB_DIR)/*.c)
FS_SRC=$(wildcard $(SRC_DIR)/*.c)
FS_OBJ_LIB=$(FS_LIB:$(LIB_DIR)/%.c=$(LIB_OBJ_DIR)/%.lo)
@@ -143,14 +144,14 @@ bin/sha1dcsum_partialcoll: $(FS_OBJ_SRC) bin/libsha1detectcoll.$(LIB_EXT)
$(SRC_DEP_DIR)/%.d: $(SRC_DIR)/%.c
$(MKDIR) $(shell dirname $@) && $(CC_DEP) $(CFLAGS) -M -MF $@ $<
-$(SRC_OBJ_DIR)/%.lo ${SRC_OBJ_DIR}/%.o: ${SRC_DIR}/%.c ${SRC_DEP_DIR}/%.d
+$(SRC_OBJ_DIR)/%.lo ${SRC_OBJ_DIR}/%.o: ${SRC_DIR}/%.c ${SRC_DEP_DIR}/%.d $(H_DEP)
$(MKDIR) $(shell dirname $@) && $(CC) $(CFLAGS) -o $@ -c $<
$(LIB_DEP_DIR)/%.d: $(LIB_DIR)/%.c
$(MKDIR) $(shell dirname $@) && $(CC_DEP) $(CFLAGS) -M -MF $@ $<
-$(LIB_OBJ_DIR)/%.lo $(LIB_OBJ_DIR)/%.o: $(LIB_DIR)/%.c $(LIB_DEP_DIR)/%.d
+$(LIB_OBJ_DIR)/%.lo $(LIB_OBJ_DIR)/%.o: $(LIB_DIR)/%.c $(LIB_DEP_DIR)/%.d $(H_DEP)
$(MKDIR) $(shell dirname $@) && $(CC) $(CFLAGS) -o $@ -c $<
-include $(FS_DEP)