From 3e70adeb8b3ba422eb577b7d1d5b686c93f1a55c Mon Sep 17 00:00:00 2001 From: Luxferre Date: Wed, 14 Oct 2026 00:56:19 +0300 Subject: [PATCH] opts --- Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 01ef316..ef2c975 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,14 @@ # single-header nlohmann/json.hpp (no extra dependency). # If your headers/libs live in a non-standard prefix, override, e.g.: # make CPPFLAGS="-I/opt/include" LDLIBS="-L/opt/lib -lcurl -lreadline" +# +# 32-bit build: make 32bit +# Or: make CXXFLAGS="-m32" LDFLAGS="-m32" +# Large file support on 32-bit: make CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" CXX = c++ CXXFLAGS = -std=c++20 -Wall -Wextra -Wpedantic -O1 -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -CPPFLAGS = -I/usr/local/include -I. +CPPFLAGS = -I/usr/local/include -I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE LDLIBS = -L/usr/local/lib -lcurl -lreadline # Location of the AddressSanitizer/UBSan runtime libraries plus a replacement @@ -61,3 +65,11 @@ install: bantam # the replacement libasan_preinit.o, and sets an rpath so they load at run time. debug: $(MAKE) CXXFLAGS="$(CXXFLAGS) -g -O0 -fsanitize=address,undefined -B$(ASANDIR) -Wl,-rpath,$(ASANDIR)" bantam + +# 32-bit build target +# Usage: make 32bit +# This builds a 32-bit binary with large file support enabled. +32bit: + $(MAKE) CXXFLAGS="$(CXXFLAGS) -m32" LDFLAGS="-m32" bantam + +.PHONY: clean install debug 32bit \ No newline at end of file