From ab7fd4be0c526bf0291465d8bbf2323dd37287f3 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 14 Apr 2010 20:22:00 +0400 Subject: [PATCH] Makefile: Add cpu specific definition We need to figure out what kind of cpu we're going to run on for bios code. Suggested-by: Pekka Enberg Signed-off-by: Cyrill Gorcunov --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 048309b..5b9c39a 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,15 @@ OBJS += util.o OBJS += bios/intfake.o OBJS += bios/int10.o -CFLAGS += $(CPPFLAGS) -Iinclude -g +uname_M := $(shell uname -m | sed -e s/i.86/i386/) +ifeq ($(uname_M),i386) +DEFINES += -D__x86_32__ +ifeq ($(uname_M),x86_64) +DEFINES += -D__x86_64__ +endif +endif + +CFLAGS += $(CPPFLAGS) $(DEFINES) -Iinclude -g WARNINGS += -Wall WARNINGS += -Wcast-align