minor makefile fixes
[retrobench] / Makefile
index 8b45f2f..8bdd16e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,22 +10,27 @@ bin_fbdev = rbench_fbdev
 
 warn = -pedantic -Wall -Wno-deprecated-declarations
 dbg = -g
-opt = -O3 -ffast-math
+opt = -O3 -ffast-math -fno-strict-aliasing
 inc = -Isrc
 
-CFLAGS = -m32 -pedantic $(warn) $(dbg) $(opt) $(inc) -fno-strict-aliasing -MMD
-ASFLAGS = --32
+CFLAGS = $(ccarch) $(warn) $(dbg) $(opt) $(inc) -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 >$@