]> git.seodisparate.com - c_simple_http/commitdiff
Update Makefile
authorStephen Seo <seo.disparate@gmail.com>
Wed, 11 Sep 2024 04:11:55 +0000 (13:11 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 11 Sep 2024 04:11:55 +0000 (13:11 +0900)
Some cleanup.
Use certain build flags only in "RELEASE" mode.

Makefile

index b8b0a2935f8656b57edf7ac7f266cb9df293f77b..b84edcb2f16a926f013e3e34f4c8fd9989b6b705 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,8 @@ COMMON_FLAGS = -Wall -Wextra -Wpedantic \
 DEBUG_FLAGS = -Og -g
 RELEASE_FLAGS = -O3 -DNDEBUG
 
-EXTRA_COMMON_FLAGS =
 ifndef MINIMAL_BUILD_FLAGS
-       EXTRA_COMMON_FLAGS = \
+       COMMON_FLAGS := ${COMMON_FLAGS} \
                -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough \
                -Werror=format-security \
                -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 \
@@ -18,16 +17,19 @@ ifndef MINIMAL_BUILD_FLAGS
                -Wl,-z,relro -Wl,-z,now \
                -Wl,--as-needed -Wl,--no-copy-dt-needed-entries \
                -fPIE -pie \
-               -fno-delete-null-pointer-checks -fno-strict-overflow \
-               -fno-strict-aliasing -ftrivial-auto-var-init=zero \
                -Werror=implicit -Werror=incompatible-pointer-types \
                -Werror=int-conversion
+       ifdef RELEASE
+               COMMON_FLAGS := ${COMMON_FLAGS} \
+                       -fno-delete-null-pointer-checks -fno-strict-overflow \
+                       -fno-strict-aliasing -ftrivial-auto-var-init=zero
+       endif
 endif
 
 ifdef RELEASE
-       CFLAGS = ${COMMON_FLAGS} ${EXTRA_COMMON_FLAGS} ${RELEASE_FLAGS}
+       CFLAGS = ${COMMON_FLAGS} ${RELEASE_FLAGS}
 else
-       CFLAGS = ${COMMON_FLAGS} ${EXTRA_COMMON_FLAGS} ${DEBUG_FLAGS}
+       CFLAGS = ${COMMON_FLAGS} ${DEBUG_FLAGS}
 endif
 
 HEADERS = \