ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)


TOPDIR  := $(KERNELSOURCE)
HPATH           = $(TOPDIR)/include

LD      =$(CROSS_COMPILE)ld
CC      =$(CROSS_COMPILE)gcc -D__KERNEL__ -I$(HPATH)

include .config

#
# standard CFLAGS
#

CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer

# use '-fno-strict-aliasing', but only if the compiler can take it
CFLAGS += $(shell if $(CC) -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-fno-strict-aliasing"; fi)

ifdef CONFIG_SMP
CFLAGS += -D__SMP__
endif

include $(KERNELRELEASE)/Makefile.$(ARCH)

MODFLAGS += -DMODULE
ifdef CONFIG_MODULES
ifdef CONFIG_MODVERSIONS
MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
endif
else
error:
	@echo "The present kernel configuration has modules disabled."
	@exit 1
endif

