From fbbd9dda4d7c5d54b8dadf624907d621011cdd08 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Sat, 22 May 2021 08:51:56 +0300 Subject: [PATCH] unix: made -m32 and --32 flags conditional, only when building on x86_64 --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8b45f2f..1dd2941 100644 --- a/Makefile +++ b/Makefile @@ -13,19 +13,24 @@ dbg = -g opt = -O3 -ffast-math inc = -Isrc -CFLAGS = -m32 -pedantic $(warn) $(dbg) $(opt) $(inc) -fno-strict-aliasing -MMD -ASFLAGS = --32 +CFLAGS = $(ccarch) -pedantic $(warn) $(dbg) $(opt) $(inc) -fno-strict-aliasing -MMD +ASFLAGS = $(asarch) LDFLAGS_x11 = -L/usr/X11R6/lib -lX11 -lXext LDFLAGS_fbdev = +ifeq ($(shell uname -m), x86_64) + ccarch = -m32 + asarch = --32 +endif + .PHONY: all all: $(bin_x11) $(bin_fbdev) $(bin_x11): $(obj_x11) - $(CC) -o $@ -m32 $(obj_x11) $(LDFLAGS_x11) + $(CC) -o $@ $(ccarch) $(obj_x11) $(LDFLAGS_x11) $(bin_fbdev): $(obj_fbdev) - $(CC) -o $@ -m32 $(obj_fbdev) $(LDFLAGS_fbdev) + $(CC) -o $@ $(ccarch) $(obj_fbdev) $(LDFLAGS_fbdev) sinlut.s: tools/lutgen tools/lutgen >$@ -- 1.7.10.4