From 82a97066f842f34db2556673d421aa9290ffe757 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 2 Nov 2026 17:04:36 +0100 Subject: Keep the build's own flags out of CFLAGS, CPPFLAGS, LDFLAGS and LDLIBS --- Mk/gzip.mk | 2 +- Mk/release.mk | 2 +- Mk/tests.mk | 12 ++++++------ Mk/zstd.mk | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'Mk') diff --git a/Mk/gzip.mk b/Mk/gzip.mk index 70d6d62..3ae53b3 100644 --- a/Mk/gzip.mk +++ b/Mk/gzip.mk @@ -1,4 +1,4 @@ FEATURES+=-DWANT_COMPRESSION_GZIP #FEATURES+=-DWANT_COMPRESSION_GZIP_ALWAYS -LDFLAGS+=-lz +OT_LDLIBS+=-lz diff --git a/Mk/release.mk b/Mk/release.mk index 63429ad..5c4afe9 100644 --- a/Mk/release.mk +++ b/Mk/release.mk @@ -9,7 +9,7 @@ HAVE_GIT=command -v git >/dev/null && test -d .git GIT_VERSION=`sh -c '$(TARBALL_VERSION) || { $(HAVE_GIT) && git describe --tags --match "v*" --always --dirty 2>/dev/null; }'` OT_TAG=`sh -c '$(TARBALL_VERSION) || { $(HAVE_GIT) && git describe --tags --match "v*" --exact-match 2>/dev/null; }'` -CFLAGS+=-DOT_VERSION=\"$(VERSION)\" -DGIT_VERSION=\"$(GIT_VERSION)\" -DOT_TAG=\"$(OT_TAG)\" +OT_CFLAGS+=-DOT_VERSION=\"$(VERSION)\" -DGIT_VERSION=\"$(GIT_VERSION)\" -DOT_TAG=\"$(OT_TAG)\" # Roll a release: tag it v$(VERSION), then make dist. The tarball is HEAD by # construction, so the working tree it was rolled from does not enter into it. diff --git a/Mk/tests.mk b/Mk/tests.mk index d542044..8e63839 100644 --- a/Mk/tests.mk +++ b/Mk/tests.mk @@ -11,12 +11,12 @@ TEST_HEADERS=tests/test.h $(HEADERS) # A test binary is not a production binary, so it is built with the features # the tests need to reach. FEATURES_test=$(FEATURES) -DWANT_ACCESSLIST_BLACK -DWANT_SYNC_LIVE -CFLAGS_test=$(CFLAGS) -I. -g -O1 $(FEATURES_test) +CFLAGS_test=-I. -g -O1 $(CPPFLAGS) $(OT_CFLAGS) $(FEATURES_test) # clang over $(CC) because the two toolchains do not check the same things. CC_sanitize?=clang CFLAGS_sanitize=$(CFLAGS_test) -fsanitize=address,undefined -fno-omit-frame-pointer -LDFLAGS_sanitize=$(LDFLAGS) -fsanitize=address,undefined +LDFLAGS_sanitize=$(LINK) -fsanitize=address,undefined # Black box tests drive the real binary over the wire, so they cover the event # loop and the parsers working together. The client timeout is cut right down @@ -24,10 +24,10 @@ LDFLAGS_sanitize=$(LDFLAGS) -fsanitize=address,undefined # mirrors these two numbers. PYTHON?=python3 FEATURES_integration=$(FEATURES) -DWANT_IP_FROM_QUERY_STRING -DWANT_ACCESSLIST_BLACK -DWANT_DYNAMIC_ACCESSLIST -DWANT_KEEPALIVE -DOT_CLIENT_TIMEOUT=5 -DOT_CLIENT_TIMEOUT_CHECKINTERVAL=1 -CFLAGS_integration=$(CFLAGS) $(OPTS_debug) $(FEATURES_integration) -fsanitize=address,undefined -fno-omit-frame-pointer -LDFLAGS_integration=$(LDFLAGS) -fsanitize=address,undefined -CFLAGS_tsan=$(CFLAGS) $(OPTS_debug) $(FEATURES_integration) -fsanitize=thread -fno-omit-frame-pointer -LDFLAGS_tsan=$(LDFLAGS) -fsanitize=thread +CFLAGS_integration=$(OPTS_debug) $(CPPFLAGS) $(OT_CFLAGS) $(FEATURES_integration) -fsanitize=address,undefined -fno-omit-frame-pointer +LDFLAGS_integration=$(LINK) -fsanitize=address,undefined +CFLAGS_tsan=$(OPTS_debug) $(CPPFLAGS) $(OT_CFLAGS) $(FEATURES_integration) -fsanitize=thread -fno-omit-frame-pointer +LDFLAGS_tsan=$(LINK) -fsanitize=thread BINARIES+=$(TESTBIN) $(TESTBIN).poll $(TESTBIN).sanitize opentracker.integration opentracker.tsan diff --git a/Mk/zstd.mk b/Mk/zstd.mk index 2bb56be..8c1fc40 100644 --- a/Mk/zstd.mk +++ b/Mk/zstd.mk @@ -1,3 +1,3 @@ FEATURES+=-DWANT_COMPRESSION_ZSTD #FEATURES+=-DWANT_COMPRESSION_ZSTD_ALWAYS -LDFLAGS+=-lzstd +OT_LDLIBS+=-lzstd -- cgit v1.3