#
#  Makefile
#
#  Copyright (C) 2002 Intel Corporation
#  Author/Maintainer - George W Artz <george.w.artz@intel.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
##################################################################
# 
# Makefile: VTune Sampling Driver
#
##################################################################
# 
# Specific build Macros: 
#
# DEBUG_LEVEL:
#       DEBUG_MODULE_LOAD               Enable module load debugging
#       DEBUG_PIDCREATE_TRACKING        Enable PID Create debugging
#       DEBUG_SYSTEM                    System Info Debug Turned ON
#
###################################################################

O_TARGET := vtune_driver.o
obj-$(CONFIG_VTUNE) += vtune_drv.o

EXTRA_CFLAGS =  -DUSE_TYPE_WAIT_QUEUE_NEW -DUSE_TYPE_FILE_OPS_NEW -DUSE_VMALLOC -DENFORCE_ROOT_ONLY_ACCESS

ifeq ($(CONFIG_VTUNE),m)
	EXTRA_CFLAGS += -DMODULE
endif

vtune-objs = vtune.o
ifeq ($(CONFIG_X86),y)
	vtune-objs += vtexliblinux32.o vtoshooks.o vtxsys.o sys_call_table.o
	EXTRA_CFLAGS += -DSA_PERCPU_IRQ_SUPPORTED -Dlinux32
else
	vtune-objs += vtexliblinux64.o vtoshooks64.o vtxsys64.o
	EXTRA_CFLAGS += -DSA_PERCPU_IRQ_SUPPORTED -Dlinux64
endif

vtune_drv.o: $(vtune-objs)
	$(LD) -r -o $@ $(vtune-objs)

vtxsys.o:
	$(CC) $(CFLAGS) -D__ASSEMBLY__ vtxsys.S -c -o vtxsys.o

vtxsys64.o:
	$(CC) $(CFLAGS) -D__ASSEMBLY__ vtxsys64.S -c -o vtxsys64.o

include $(TOPDIR)/Rules.make


# ------------------------- makefile targets -----------------------------
#
#clean:: 
#	rm -f *.o *.map $(VTUNE_DRV) ../../util/util.o
