projects
/
retrobench
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e15fd29
)
unix: made -m32 and --32 flags conditional, only when building on x86_64
author
John Tsiombikas
<nuclear@member.fsf.org>
Sat, 22 May 2021 05:51:56 +0000
(08:51 +0300)
committer
John Tsiombikas
<nuclear@member.fsf.org>
Sat, 22 May 2021 05:51:56 +0000
(08:51 +0300)
Makefile
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
8b45f2f
..
1dd2941
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-13,19
+13,24
@@
dbg = -g
opt = -O3 -ffast-math
inc = -Isrc
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 =
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)
.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)
$(bin_fbdev): $(obj_fbdev)
- $(CC) -o $@ -m32 $(obj_fbdev) $(LDFLAGS_fbdev)
+ $(CC) -o $@ $(ccarch) $(obj_fbdev) $(LDFLAGS_fbdev)
sinlut.s: tools/lutgen
tools/lutgen >$@
sinlut.s: tools/lutgen
tools/lutgen >$@