mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
Currently the install location of SCST is pretty much hard coded into
the Makefiles to be /usr/local.
I am custom building a system for ZFS & SCST and I want to install in
/usr instead of /usr/local.
Currently I am doing a “find . -name Makefile -exec sed -i 's:/usr/local:/usr:g'
{} \;” to accommodate this.
This patch fixes it.
From Sietse van Zanen <sietse@wizdom.nu>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4791 d57e44dd-8a1f-0410-8b47-8ef2f437770f
129 lines
3.3 KiB
Makefile
129 lines
3.3 KiB
Makefile
#
|
|
# FCST: libfc SCSI target makefile
|
|
# Based on ../mvsas_tgt/Makefile
|
|
#
|
|
# Copyright (C) 2006 - 2008 Jacky Feng <jfeng@marvell.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, 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
|
|
#
|
|
|
|
ifndef PREFIX
|
|
PREFIX=/usr/local
|
|
endif
|
|
|
|
ifeq ($(KVER),)
|
|
ifeq ($(KDIR),)
|
|
KVER = $(shell uname -r)
|
|
KDIR := /lib/modules/$(KVER)/build
|
|
endif
|
|
else
|
|
KDIR := /lib/modules/$(KVER)/build
|
|
endif
|
|
|
|
export PWD := $(shell pwd)
|
|
export CONFIG_FCST := m
|
|
|
|
|
|
# Set variable $(2) to value $(3) in file $(1).
|
|
set_var = $(shell { if [ -e "$(1)" ]; then grep -v '^$(2)=' "$(1)"; fi; echo "$(2)=$(3)"; } >/tmp/$(1)-$$$$.tmp && mv /tmp/$(1)-$$$$.tmp $(1))
|
|
|
|
|
|
FCSTFLAGS = -DDEBUG_WORK_IN_THREAD -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \
|
|
-DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions
|
|
FCSTFLAGSRELEASE = -DCONFIG_SCST_TRACING
|
|
FCSTFLAGSPERF =
|
|
EXTRA_CFLAGS += -I$(SCST_INC_DIR) $(FCSTFLAGS$(BUILDMODE))
|
|
|
|
MODULE_NAME = fcst
|
|
|
|
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 "$(PREFIX)/include/scst"; fi)
|
|
SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; then echo "$$PWD/../scst/src"; \
|
|
else echo "$(PREFIX)/include/scst"; fi)
|
|
|
|
all: Modules.symvers Module.symvers
|
|
$(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 \
|
|
SCST_INC_DIR=$(SCST_INC_DIR)
|
|
|
|
install: all
|
|
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
|
|
SCST_INC_DIR=$(SCST_INC_DIR) modules_install
|
|
-depmod -a $(KVER)
|
|
|
|
ins:
|
|
./config
|
|
insmod fcst.ko
|
|
|
|
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)/$(MODULE_NAME).ko
|
|
-/sbin/depmod -a $(KVER)
|
|
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
|
|
rm -f *.orig *.rej
|
|
|
|
2debug:
|
|
-$(MAKE) clean
|
|
$(call set_var,build_mode,BUILDMODE,)
|
|
|
|
2release:
|
|
-$(MAKE) clean
|
|
$(call set_var,build_mode,BUILDMODE,RELEASE)
|
|
|
|
2perf:
|
|
-$(MAKE) clean
|
|
$(call set_var,build_mode,BUILDMODE,PERF)
|
|
|
|
.PHONY: all tgt install uninstall clean extraclean
|