]> git.kaiwu.me - haproxy.git/commitdiff
BUILD: Makefile: allow external makefiles to provide build targets
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 30 Oct 2026 09:57:52 +0000 (10:57 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 30 Oct 2026 15:44:33 +0000 (16:44 +0100)
Let EXTRA_MAKE fragments set EXTRA_TARGET_BUILD to a nonempty value to
provide their own build and cleanup targets instead of building HAProxy.
Keep the common option handling and regression-test targets available.

Evaluate the selector after global compiler and linker options have been
initialized so a fragment can install its alternate build rules there.

Makefile

index c3c3e8927f7749881b8c675654ecbbedda7d34f2..050f1e2a00a14b8a40f5428d1fe2cb5b1041de19 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -940,6 +940,9 @@ endif
 # add options at the beginning of the "ld" command line if needed.
 LDOPTS = $(TARGET_LDFLAGS) $(OPTIONS_LDFLAGS) $(ADDLIB)
 
+# External addons may supply their own build and cleanup targets.
+ifeq ($(EXTRA_TARGET_BUILD),)
+
 ifeq ($(TARGET),)
 all:
        @echo "Building HAProxy without specifying a TARGET is not supported."
@@ -1338,6 +1341,8 @@ update-version:
        echo "$(SUBVERS)" > SUBVERS
        echo "$(VERDATE)" > VERDATE
 
+endif # EXTRA_TARGET_BUILD
+
 # just display the build options. The "USE_*" options and their respective
 # settings are also listed if they're explicitly set on the command line, or if
 # they are not empty. Implicit "USE_*" are not listed.