2 # Qlogic 2x00 SCSI target driver makefile
4 # Copyright (C) 2004 Vladislav Bolkhovitin <vst@vlnb.net>
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation, version 2
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
19 # all (the default) : make all
21 # extraclean : clean + clean dependencies
23 # uninstall : uninstall
26 # - install and uninstall must be made as root
29 #SCST_INC_DIR := /usr/local/include/scst
30 SCST_INC_DIR := $(SUBDIRS)/../../scst/include
31 SCST_DIR := $(shell pwd)/../../scst/src
32 EXTRA_CFLAGS += -I$(SCST_INC_DIR) -DFC_TARGET_SUPPORT
33 EXTRA_CFLAGS += -DFC_SCST_WWN_AUTH
34 EXTRA_CFLAGS += -DEXTRACHECKS
36 INSTALL_DIR := /lib/modules/$(shell uname -r)/extra
38 #EXTRA_CFLAGS += -DTRACING
39 EXTRA_CFLAGS += -DDEBUG_TGT -DDEBUG_WORK_IN_THREAD
40 #EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD
44 KDIR := /lib/modules/$(shell uname -r)/build
47 KDIR := /lib/modules/$(KVER)/build
50 QLA2XXX_INC_DIR := $(KDIR)/drivers/scsi/qla2xxx
51 EXTRA_CFLAGS += -I$(QLA2XXX_INC_DIR)
53 ifneq ($(KERNELRELEASE),)
55 qla2x00tgt-objs := qla2x00t.o
60 $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m
63 $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=n
66 $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
70 Modules.symvers: $(SCST_DIR)/Modules.symvers
71 -cp $(SCST_DIR)/Modules.symvers .
74 rm -f $(INSTALL_DIR)/qla2[23x]00tgt.ko
79 rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend *~ Modules.symvers
84 .PHONY: all tgt install uninstall clean extraclean