aboutsummaryrefslogtreecommitdiffstats
path: root/menu
diff options
context:
space:
mode:
Diffstat (limited to 'menu')
-rw-r--r--menu/Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/menu/Makefile b/menu/Makefile
index 4824f05c..4c35dbb2 100644
--- a/menu/Makefile
+++ b/menu/Makefile
@@ -1,7 +1,13 @@
-CC = gcc -funsigned-char -W -Wall
-CFLAGS = -march=i386 -Os
+gcc_ok = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
+ then echo $(1); else echo $(2); fi)
+
+M32 := $(call gcc_ok,-m32,)
+ALIGN := $(call gcc_ok,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0)
+
+CC = gcc $(M32) -funsigned-char
+CFLAGS = -g -W -Wall -march=i386 $(ALIGN) -Os
AS = as
-LD = ld
+LD = ld -m elf_i386
OBJCOPY = objcopy
.SUFFIXES: .c .s .s16 .o16 .elf .com