]> git.seodisparate.com - c_simple_http/commitdiff
Update Makefile: recompile if header has changed
authorStephen Seo <seo.disparate@gmail.com>
Sun, 1 Sep 2024 03:36:04 +0000 (12:36 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Sun, 1 Sep 2024 03:36:04 +0000 (12:36 +0900)
Makefile

index 14bfcd67a55adb52a569daf47f4e9b4e6d577052..5377b7a52aea0d78504c03932a76fa1112e71e67 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,16 @@ else
        CFLAGS = ${COMMON_FLAGS} ${DEBUG_FLAGS}
 endif
 
+HEADERS = \
+       src/arg_parse.h \
+       src/big_endian.h \
+       src/tcp_socket.h \
+       src/globals.h \
+       src/signal_handling.h \
+       src/constants.h \
+       src/http.h \
+       src/config.h
+
 SOURCES = \
                src/main.c \
                src/arg_parse.c \
@@ -42,6 +52,6 @@ clean:
        rm -f unit_test
        rm -rf ${OBJECT_DIR}
 
-${OBJECT_DIR}/%.c.o: %.c
+${OBJECT_DIR}/%.c.o: %.c ${HEADERS}
        @mkdir -p $(dir $@)
        gcc -o $@ -c ${CFLAGS} $<