#
# Makefile for the Cisco iSCSI client
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...

O_TARGET := iscsi_mod.o

EXTRA_CFLAGS := -I../../scsi -I/usr/include -DLINUX -DHAS_SET_USER_NICE

ifeq ($(wildcard $(TOPDIR)/kernel/ksyms.c),$(TOPDIR)/kernel/ksyms.c)
  # check for the presence of certain kernel symbols, and compile accordingly

  SET_USER_NICE:=$(shell grep '^[ \t]*EXPORT_SYMBOL(set_user_nice)' $(TOPDIR)/kernel/ksyms.c 2>/dev/null )
  ifneq ($(SET_USER_NICE),)
     EXTRA_FLAGS += -DHAS_SET_USER_NICE=1
  endif

  REPARENT_TO_INIT:=$(shell grep '^[ \t]*EXPORT_SYMBOL(reparent_to_init)' $(TOPDIR)/kernel/ksyms.c 2>/dev/null )
  ifneq ($(REPARENT_TO_INIT),)
    EXTRA_FLAGS += -DHAS_REPARENT_TO_INIT=1
  endif
endif


obj-y	:= iscsi.o iscsi-probe.o iscsi-login.o iscsiAuthClient.o iscsiAuthClientGlue.o md5.o iscsi-crc.o
obj-m   := $(O_TARGET)

include $(TOPDIR)/Rules.make
