]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
simplify the build rules
authorAlan T. DeKok <aland@freeradius.org>
Thu, 1 Jan 2026 16:08:40 +0000 (11:08 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 1 Jan 2026 16:38:55 +0000 (11:38 -0500)
remove unnecessary comments and examples.

move common definitions to a common.mk file

simplify the use of $(filter-out ...)

filter out "--rtlib=.." from the LDFLAGS.  This change prevents
linking errors when building with the sanitizers enabled.

scripts/build/make/common.mk [new file with mode: 0644]
scripts/build/make/dlopen.mk
scripts/build/make/util.mk
scripts/build/make/version.mk

diff --git a/scripts/build/make/common.mk b/scripts/build/make/common.mk
new file mode 100644 (file)
index 0000000..5f90b36
--- /dev/null
@@ -0,0 +1,20 @@
+#
+#  All of the files in this directory produce GNU make log messages,
+#  and not FreeRADIUS log messages,
+#
+TARGET                         := libfreeradius-make-${TARGET_NAME}.$(BUILD_LIB_EXT)
+SOURCES                                := ${TARGET_NAME}.c log.c
+
+#
+#  This target is NOT built with static analyzer flags.
+#
+$(TARGET): CFLAGS              := $(filter-out -W% -fsanitize%,$(CFLAGS))
+$(TARGET): CPPFLAGS            := $(filter-out -W%,$(CPPFLAGS))
+$(TARGET): LDFLAGS             := $(filter-out -fsanitize% --rtlib=%,$(LDFLAGS))
+
+#
+#  This gets built with the BUILD_CC i.e. the one we use to bootstrap
+#  this build system.
+#
+SRC_CC := ${HOST_COMPILE.c}
+TGT_LINKER := ${HOST_LINK.c}
index 41c51b15e25891204b234b4f3430961a3ab1756f..b32ba368d50e48ba5d37bd2292466913c0e31f86 100644 (file)
@@ -1,31 +1,3 @@
-TARGET                         := libfreeradius-make-dlopen.$(BUILD_LIB_EXT)
-SOURCES                                := dlopen.c log.c
+TARGET_NAME := dlopen
 
-#
-#  This target is NOT built with static analyzer flags.
-#
-$(TARGET): CFLAGS              := $(filter-out -W%,$(filter-out -fsanitize%,$(CFLAGS)))
-$(TARGET): CPPFLAGS            := $(filter-out -W%,$(CPPFLAGS))
-$(TARGET): LDFLAGS             := $(filter-out -fsanitize%,$(LDFLAGS))
-
-#
-#  This gets built with the BUILD_CC i.e. the one we use to bootstrap
-#  this build system.
-#
-SRC_CC := ${HOST_COMPILE.c}
-TGT_LINKER := ${HOST_LINK.c}
-
-#
-#  If we're building this target, then don't try to use it until we know
-#  that building the target succeeds.
-#
-#ifneq "$(MAKECMDGOALS)" "$(TARGET)"
-#load ${BUILD_DIR}/lib/.libs/libfreeradius-make-dlopen.$(BUILD_LIB_EXT)(dlopen_gmk_setup)
-
-#$(info $(dlopen /home/foo/libcrypto,ASN1_verify,/home/user,/foo,/usr/local/Cellar/openssl@1.1/1.1.1d/lib))
-#$(info $(dlsym libcrypto,ASN1_verify))
-#$(info $(dlclose libcrypto))
-
-#$(info $(dlopen libfoobar))
-#$(info $(dlerror ))
-#endif
+include ${top_srcdir}/scripts/build/make/common.mk
index 1b43a23d19611df6d776ce7eaa7b796100680eb3..958b014c7c752e4751e1667acc64bd79b1a36ff0 100644 (file)
@@ -1,31 +1,3 @@
-TARGET                         := libfreeradius-make-util.$(BUILD_LIB_EXT)
-SOURCES                                := util.c log.c
+TARGET_NAME := util
 
-#
-#  This target is NOT built with static analyzer flags.
-#
-$(TARGET): CFLAGS              := $(filter-out -W%,$(filter-out -fsanitize%,$(CFLAGS)))
-$(TARGET): CPPFLAGS            := $(filter-out -W%,$(CPPFLAGS))
-$(TARGET): LDFLAGS             := $(filter-out -fsanitize%,$(LDFLAGS))
-
-#
-#  This gets built with the BUILD_CC i.e. the one we use to bootstrap
-#  this build system.
-#
-SRC_CC := ${HOST_COMPILE.c}
-TGT_LINKER := ${HOST_LINK.c}
-
-#
-#  If we're building this target, then don't try to use it until we know
-#  that building the target succeeds.
-#
-#ifneq "$(MAKECMDGOALS)" "$(TARGET)"
-#load ${BUILD_DIR}/lib/.libs/libfreeradius-make-util.$(BUILD_LIB_EXT)(util_gmk_setup)
-
-#$(info $(dlopen /home/foo/libcrypto,ASN1_verify,/home/user,/foo,/usr/local/Cellar/openssl@1.1/1.1.1d/lib))
-#$(info $(dlsym libcrypto,ASN1_verify))
-#$(info $(dlclose libcrypto))
-
-#$(info $(dlopen libfoobar))
-#$(info $(dlerror ))
-#endif
+include ${top_srcdir}/scripts/build/make/common.mk
index e3e20cb7c96f13844dc9b62f447f1affa37c81c6..9586fd38e4004f39d93cf8549e4b9bc033e9428c 100644 (file)
@@ -1,31 +1,3 @@
-TARGET                         := libfreeradius-make-version.$(BUILD_LIB_EXT)
-SOURCES                                := version.c log.c
+TARGET_NAME := version
 
-#
-#  This target is NOT built with static analyzer flags.
-#
-$(TARGET): CFLAGS              := $(filter-out -W%,$(filter-out -fsanitize%,$(CFLAGS)))
-$(TARGET): CPPFLAGS            := $(filter-out -W%,$(CPPFLAGS))
-$(TARGET): LDFLAGS             := $(filter-out -fsanitize%,$(LDFLAGS))
-
-#
-#  This gets built with the BUILD_CC i.e. the one we use to bootstrap
-#  this build system.
-#
-SRC_CC := ${HOST_COMPILE.c}
-TGT_LINKER := ${HOST_LINK.c}
-
-#
-#  If we're building this target, then don't try to use it until we know
-#  that building the target succeeds.
-#
-#ifneq "$(MAKECMDGOALS)" "$(TARGET)"
-#load ${BUILD_DIR}/lib/.libs/libfreeradius-make-version.$(BUILD_LIB_EXT)(version_gmk_setup)
-
-#$(info $(dlopen /home/foo/libcrypto,ASN1_verify,/home/user,/foo,/usr/local/Cellar/openssl@1.1/1.1.1d/lib))
-#$(info $(dlsym libcrypto,ASN1_verify))
-#$(info $(dlclose libcrypto))
-
-#$(info $(dlopen libfoobar))
-#$(info $(dlerror ))
-#endif
+include ${top_srcdir}/scripts/build/make/common.mk