###############################################################################
##                                                                           ##
##  Dynamo / iomtr_kstat/Makefile-24                                         ##
##                                                                           ##
## ------------------------------------------------------------------------- ##
##                                                                           ##
##  Job .......: The Makefile for the iomtr_kstat module for 2.4.x kernel    ##
##                                                                           ##
## ------------------------------------------------------------------------- ##
##                                                                           ##
##  Intel Open Source License                                                ##
##                                                                           ##
##  Copyright (c) 2001 Intel Corporation                                     ##
##  All rights reserved.                                                     ##
##  Redistribution and use in source and binary forms, with or without       ##
##  modification, are permitted provided that the following conditions       ##
##  are met:                                                                 ##
##                                                                           ##
##  Redistributions of source code must retain the above copyright notice,   ##
##  this list of conditions and the following disclaimer.                    ##
##                                                                           ##
##  Redistributions in binary form must reproduce the above copyright        ##
##  notice, this list of conditions and the following disclaimer in the      ##
##  documentation and/or other materials provided with the distribution.     ##
##                                                                           ##
##  Neither the name of the Intel Corporation nor the names of its           ##
##  contributors may be used to endorse or promote products derived from     ##
##  this software without specific prior written permission.                 ##
##                                                                           ##
##  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      ##
##  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT      ##
##  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    ##
##  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR      ##
##  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,         ##
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT         ##
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,    ##
##  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY    ##
##  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT      ##
##  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE    ##
##  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     ##
##                                                                           ##
## ------------------------------------------------------------------------- ##
##                                                                           ##
##  Remarks ...: <none>                                                      ##
##                                                                           ##
## ------------------------------------------------------------------------- ##
##                                                                           ##
##  Changes ...: 2004-02-19 (mingz@ele.uri.edu)                              ##
##               - Support cross compile now.                                ##
##                                                                           ##
###############################################################################

# CROSS_COMPILE   = /opt/crosstool/arm-unknown-linux-gnu/gcc-3.3.1-glibc-2.3.2/bin/arm-unknown-linux-gnu-
CROSS_COMPILE = /usr/bin/

AS              = $(CROSS_COMPILE)as
LD              = $(CROSS_COMPILE)ld
CC              = $(CROSS_COMPILE)gcc
CPP             = $(CC) -E
AR              = $(CROSS_COMPILE)ar
NM              = $(CROSS_COMPILE)nm
STRIP           = $(CROSS_COMPILE)strip
OBJCOPY         = $(CROSS_COMPILE)objcopy
OBJDUMP         = $(CROSS_COMPILE)objdump

# the following compiler flags are needed for x86_64
EXTRA_CFLAGS=-DIOMTR_SETTING_KSTAT_PERCPU -DIOMTR_SETTING_NO_CPU_KHZ -mcmodel=kernel
# on regular machines is can be empty
# EXTRA_CFLAGS=

CFLAGS:= -O2 -Wall -D__KERNEL__ -DMODULE $(EXTRA_CFLAGS)
INCLUDEDIR = /lib/modules/`uname -r`/build/include

CFLAGS += -isystem $(INCLUDEDIR)

TARGET = iomtr_kstat
OBJS = $(TARGET).o
SRC = $(TARGET).c

all: $(TARGET).o

clean:
	rm -f *.o *~ core
