mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-29 18:00:18 +00:00
Patch from Erik Habbinga <erikhabbinga@inphase-tech.com> to fix out of tree building introduced in r387 with some changes to prevent such things in the future.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@394 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
85
mpt/Makefile
85
mpt/Makefile
@@ -1,5 +1,32 @@
|
||||
SCST_INC_DIR := include/scst
|
||||
# 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, version 2
|
||||
# of the License.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
# Main targets:
|
||||
# all (the default) : make all
|
||||
# clean : clean files
|
||||
# extraclean : clean + clean dependencies
|
||||
# install : install
|
||||
# uninstall : uninstall
|
||||
#
|
||||
# Notes :
|
||||
# - install and uninstall must be made as root
|
||||
#
|
||||
|
||||
#SCST_INC_DIR := /usr/local/include/scst
|
||||
#SCST_DIR := $(SCST_INC_DIR)
|
||||
SCST_INC_DIR := $(SUBDIRS)/../scst/include
|
||||
SCST_DIR := $(shell pwd)/../scst/src
|
||||
|
||||
FUSION_INC_DIR := drivers/message/fusion
|
||||
|
||||
EXTRA_CFLAGS += -I$(SCST_INC_DIR) -I$(FUSION_INC_DIR) -Iinclude/scsi
|
||||
|
||||
EXTRA_CFLAGS += -DEXTRACHECKS
|
||||
@@ -7,5 +34,59 @@ EXTRA_CFLAGS += -DEXTRACHECKS
|
||||
EXTRA_CFLAGS += -DDEBUG
|
||||
#EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD
|
||||
|
||||
obj-$(CONFIG_FUSION_SCST) += mpt_scst.o
|
||||
ifeq ($(KVER),)
|
||||
ifeq ($(KDIR),)
|
||||
KDIR := /lib/modules/$(shell uname -r)/build
|
||||
endif
|
||||
else
|
||||
KDIR := /lib/modules/$(KVER)/build
|
||||
endif
|
||||
|
||||
LSI_INC_DIR := $(KDIR)/drivers/message/fusion
|
||||
EXTRA_CFLAGS += -I$(LSI_INC_DIR)
|
||||
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
obj-m += mpt_scst.o
|
||||
else
|
||||
|
||||
all: Modules.symvers Module.symvers
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m
|
||||
|
||||
tgt: Modules.symvers Module.symvers
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=n
|
||||
|
||||
install: all
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
|
||||
modules_install
|
||||
-depmod -a
|
||||
|
||||
SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Modules.symvers 2>/dev/null)
|
||||
ifneq ($(SCST_MOD_VERS),)
|
||||
Modules.symvers: $(SCST_DIR)/Modules.symvers
|
||||
cp $(SCST_DIR)/Modules.symvers .
|
||||
else
|
||||
.PHONY: Modules.symvers
|
||||
endif
|
||||
|
||||
# It's renamed in 2.6.18
|
||||
SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Module.symvers 2>/dev/null)
|
||||
ifneq ($(SCST_MOD_VERS),)
|
||||
Module.symvers: $(SCST_DIR)/Module.symvers
|
||||
cp $(SCST_DIR)/Module.symvers .
|
||||
else
|
||||
.PHONY: Module.symvers
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
rm -f $(INSTALL_DIR)/mpt_scst.ko
|
||||
-/sbin/depmod -a
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend *~ Modules.symvers \
|
||||
Module.symvers Module.markers modules.order
|
||||
rm -rf .tmp_versions
|
||||
|
||||
extraclean: clean
|
||||
|
||||
.PHONY: all tgt install uninstall clean extraclean
|
||||
|
||||
@@ -18,12 +18,15 @@ Building from the Linux kernel tree
|
||||
|
||||
To build from the kernel tree, you should:
|
||||
|
||||
1. Link drivers/message/fusion/mpt_scst to $(SCST_DIR)/mpt
|
||||
1. Link drivers/message/fusion/mpt_scst to $(SCST_DIR)/mpt.
|
||||
|
||||
2. Patch drivers/message/fusion/Makefile and
|
||||
2. Copy or link Makefile and Kconfig from $(SCST_DIR)/mpt/in-tree to
|
||||
$(SCST_DIR)/mpt (Makefile will be replaced).
|
||||
|
||||
3. Patch drivers/message/fusion/Makefile and
|
||||
drivers/message/fusion/Kconfig by diffs from $(SCST_DIR)/mpt/in-tree
|
||||
|
||||
3. Correct in drivers/message/fusion/Makefile SCST_INC_DIR variable so
|
||||
4. Correct in drivers/message/fusion/Makefile SCST_INC_DIR variable so
|
||||
it points to correct directory with SCST include files.
|
||||
|
||||
Building outside the Linux kernel tree
|
||||
|
||||
11
mpt/in-tree/Makefile
Normal file
11
mpt/in-tree/Makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
SCST_INC_DIR := include/scst
|
||||
FUSION_INC_DIR := drivers/message/fusion
|
||||
EXTRA_CFLAGS += -I$(SCST_INC_DIR) -I$(FUSION_INC_DIR) -Iinclude/scsi
|
||||
|
||||
EXTRA_CFLAGS += -DEXTRACHECKS
|
||||
#EXTRA_CFLAGS += -DTRACING
|
||||
EXTRA_CFLAGS += -DDEBUG
|
||||
#EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD
|
||||
|
||||
obj-$(CONFIG_FUSION_SCST) += mpt_scst.o
|
||||
|
||||
Reference in New Issue
Block a user