mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
Multiple makefiles: autodetect SCST include directory
It is cumbersome to change SCST_INC_DIR and SCST_DIR in each Makefile before and after a release. Hence modify the Makefiles such that these paths are detected automatically. Signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4740 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -43,11 +43,6 @@ export CONFIG_FCST := m
|
||||
set_var = $(shell { if [ -e "$(1)" ]; then grep -v '^$(2)=' "$(1)"; fi; echo "$(2)=$(3)"; } >/tmp/$(1)-$$$$.tmp && mv /tmp/$(1)-$$$$.tmp $(1))
|
||||
|
||||
|
||||
#SCST_INC_DIR := /usr/local/include/scst
|
||||
#SCST_DIR := $(SCST_INC_DIR)
|
||||
SCST_INC_DIR := $(SUBDIRS)/../scst/include
|
||||
SCST_DIR := $(shell pwd)/../scst/src
|
||||
|
||||
FCSTFLAGS = -DDEBUG_WORK_IN_THREAD -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \
|
||||
-DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions
|
||||
FCSTFLAGSRELEASE = -DCONFIG_SCST_TRACING
|
||||
@@ -61,15 +56,23 @@ INSTALL_DIR := /lib/modules/$(KVER)/extra
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
include $(SUBDIRS)/Makefile_in-tree
|
||||
else
|
||||
SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
|
||||
then echo "$$PWD/../scst/include"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; then echo "$$PWD/../scst/src"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
|
||||
all: Modules.symvers Module.symvers
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
|
||||
SCST_INC_DIR=$(SCST_INC_DIR)
|
||||
|
||||
tgt: Modules.symvers Module.symvers
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=n
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=n \
|
||||
SCST_INC_DIR=$(SCST_INC_DIR)
|
||||
|
||||
install: all
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
|
||||
modules_install
|
||||
SCST_INC_DIR=$(SCST_INC_DIR) modules_install
|
||||
-depmod -a $(KVER)
|
||||
|
||||
ins:
|
||||
|
||||
@@ -9,10 +9,11 @@ SHELL=/bin/bash
|
||||
|
||||
SUBDIRS := $(shell pwd)
|
||||
|
||||
#SCST_INC_DIR := /usr/local/include/scst
|
||||
SCST_INC_DIR := $(SUBDIRS)/../scst/include
|
||||
#SCST_DIR := $(SCST_INC_DIR)
|
||||
SCST_DIR := $(shell pwd)/../scst/src
|
||||
SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
|
||||
then echo "$$PWD/../scst/include"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; then echo "$$PWD/../scst/src"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
SBINDIR := /usr/local/sbin
|
||||
INITDIR := /etc/init.d
|
||||
RCDIR := /etc/rc.d
|
||||
@@ -37,7 +38,7 @@ mods: Modules.symvers Module.symvers
|
||||
$(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) SUBDIRS=$(KMOD) modules
|
||||
|
||||
progs:
|
||||
$(MAKE) -C usr
|
||||
$(MAKE) -C usr SCST_INC_DIR=$(SCST_INC_DIR)
|
||||
|
||||
include/iscsi_scst_itf_ver.h: include/iscsi_scst.h
|
||||
echo "/* Autogenerated, don't edit */" >include/iscsi_scst_itf_ver.h
|
||||
|
||||
@@ -30,11 +30,6 @@
|
||||
|
||||
SHELL=/bin/bash
|
||||
|
||||
#SCST_INC_DIR := /usr/local/include/scst
|
||||
#SCST_DIR := $(SCST_INC_DIR)
|
||||
SCST_INC_DIR := $(SUBDIRS)/../../scst/include
|
||||
SCST_DIR := $(shell pwd)/../../scst/src
|
||||
|
||||
EXTRA_CFLAGS += -I$(SCST_INC_DIR)
|
||||
|
||||
INSTALL_DIR := /lib/modules/$(shell uname -r)/extra
|
||||
@@ -72,20 +67,29 @@ obj-m := qla2x00tgt.o
|
||||
qla2x00tgt-objs := qla2x00t.o
|
||||
else
|
||||
|
||||
SCST_INC_DIR := $(shell if [ -e "$$PWD/../../scst" ]; \
|
||||
then echo "$$PWD/../../scst/include"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
SCST_DIR := $(shell if [ -e "$$PWD/../../scst" ]; \
|
||||
then echo "$$PWD/../../scst/src"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
|
||||
ifneq ($(BUILD_2X_MODULE),)
|
||||
# We need to make qla2xxx_scst before Module.symvers
|
||||
.NOTPARALLEL:
|
||||
endif
|
||||
|
||||
all: $(QLA2XXX_SCST) Modules.symvers Module.symvers
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
|
||||
SCST_INC_DIR=$(SCST_INC_DIR)
|
||||
|
||||
install: all
|
||||
ifneq ($(BUILD_2X_MODULE),)
|
||||
$(MAKE) SUBDIRS=$(QLA2XXX_DIR) -C $(QLA2XXX_DIR) $@
|
||||
$(MAKE) SUBDIRS=$(QLA2XXX_DIR) -C $(QLA2XXX_DIR) $@ \
|
||||
SCST_INC_DIR=$(SCST_INC_DIR)
|
||||
endif
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
|
||||
modules_install
|
||||
SCST_INC_DIR=$(SCST_INC_DIR) modules_install
|
||||
-/sbin/depmod -a $(KVER)
|
||||
|
||||
uninstall:
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
SHELL=/bin/bash
|
||||
|
||||
#SCST_INC_DIR := /usr/local/include/scst
|
||||
#SCST_DIR := $(SCST_INC_DIR)
|
||||
SCST_INC_DIR := $(SUBDIRS)/../scst/include/
|
||||
SCST_DIR := $(shell pwd)/../scst/src
|
||||
KMOD := $(shell pwd)/kernel
|
||||
|
||||
enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi)
|
||||
@@ -36,12 +32,20 @@ ifneq ($(PATCHLEVEL),)
|
||||
obj-m := scst_local.o
|
||||
else
|
||||
|
||||
SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
|
||||
then echo "$$PWD/../scst/include"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
|
||||
then echo "$$PWD/../scst/src"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
|
||||
all: Modules.symvers Module.symvers
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
|
||||
SCST_INC_DIR=$(SCST_INC_DIR)
|
||||
|
||||
install: all
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
|
||||
modules_install
|
||||
SCST_INC_DIR=$(SCST_INC_DIR) modules_install
|
||||
-/sbin/depmod -aq $(KVER)
|
||||
|
||||
SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Modules.symvers 2>/dev/null)
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
# Makefile for ib_srpt.ko.
|
||||
#
|
||||
|
||||
SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
|
||||
then echo "$$PWD/../scst/include"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
SCST_SYMVERS_DIR := $(shell if [ -e $$PWD/../scst ]; then \
|
||||
echo $$PWD/../scst/src; \
|
||||
else echo /usr/local/include/scst; fi)
|
||||
@@ -50,7 +53,7 @@ OFED_SRPT_INSTALLED:=$(shell if [ -e $(OFED_SRPT_PATH) ]; then echo true; else e
|
||||
|
||||
all: src/$(MODULE_SYMVERS)
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \
|
||||
PRE_CFLAGS="$(OFED_CFLAGS)" modules
|
||||
PRE_CFLAGS="$(OFED_CFLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules
|
||||
|
||||
install: all src/ib_srpt.ko
|
||||
@eval `sed -n 's/#define UTS_RELEASE /KERNELRELEASE=/p' $(KDIR)/include/linux/version.h $(KDIR)/include/linux/utsrelease.h 2>/dev/null`; \
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
SCST_INC_DIR := $(shell d="$(dir $(lastword $(MAKEFILE_LIST)))"; \
|
||||
if [ -e "$$d../../scst" ]; \
|
||||
then echo "$$d../../scst/include"; \
|
||||
else echo "/usr/local/include/scst"; fi)
|
||||
EXTRA_CFLAGS += -I$(SCST_INC_DIR)
|
||||
|
||||
-include $(SUBDIRS)/../build_mode
|
||||
|
||||
Reference in New Issue
Block a user