aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-08-08 05:57:53 -0400
committerTest_User <hax@andrewyu.org>2024-08-08 05:57:53 -0400
commit3c36c77ea7e98cca9be6cb7f1907a73a542964ec (patch)
tree6879f26b10225121651a50ebf65c72b8638e8e8f
parentc00f2cbfddbb42d2950210aa1966efa339ff28f5 (diff)
downloadhaxircd-3c36c77ea7e98cca9be6cb7f1907a73a542964ec.tar.gz
haxircd-3c36c77ea7e98cca9be6cb7f1907a73a542964ec.zip
Deal with LDFLAGS too
-rw-r--r--Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5ce5758..44c17f7 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@
# OTHER DEALINGS IN THE SOFTWARE.
ORIGINAL_CFLAGS := $(CFLAGS)
+ORIGINAL_LDFLAGS := $(LDFLAGS)
INCLUDEFLAGS =
@@ -54,6 +55,7 @@ LDFLAGS = -lpthread
printf '%s\n' 'LAST_IPv4 = $(IPv4)' >> .makeopts
printf '%s\n' 'LAST_IPv6 = $(IPv6)' >> .makeopts
printf '%s\n' 'LAST_CFLAGS = $(ORIGINAL_CFLAGS)' >> .makeopts
+ printf '%s\n' 'LAST_LDFLAGS = $(ORIGINAL_LDFLAGS)' >> .makeopts
printf '%s\n' 'LAST_CC = $(CC)' >> .makeopts
$(shell [ -e .makeopts ] || > .makeopts)
@@ -184,6 +186,15 @@ ORIGINAL_CFLAGS := $(LAST_CFLAGS)
CFLAGS := $(LAST_CFLAGS)
endif
+ifneq ($(ORIGINAL_LDFLAGS),)
+ifneq ($(ORIGINAL_LDFLAGS),$(LAST_LDFLAGS))
+rebuild = 1
+endif
+else
+ORIGINAL_LDFLAGS := $(LAST_LDFLAGS)
+LDFLAGS := $(LAST_LDFLAGS)
+endif
+
ifneq ($(CC),)
ifneq ($(CC),$(LAST_CC))
rebuild = 1