mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 05:01:27 +00:00
Move the $(SCST_INC_DIR) definitions from the out-of-tree sections into the in-kernel sections. Since SCST is now distributed as a single tar archive, only support in-tree builds with $(SCST_INC_DIR) and $(SCST_DIR). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8079 d57e44dd-8a1f-0410-8b47-8ef2f437770f
108 lines
2.5 KiB
Makefile
108 lines
2.5 KiB
Makefile
#
|
|
# A Makefile for the scst-local ...
|
|
#
|
|
|
|
SHELL=/bin/bash
|
|
|
|
KMOD := $(shell pwd)/kernel
|
|
|
|
ifneq ($(PATCHLEVEL),)
|
|
ccflags-y += -I$(KBUILD_EXTMOD)/../scst/include
|
|
ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter\
|
|
-Wno-missing-field-initializers
|
|
|
|
#ccflags-y += -DCONFIG_SCST_LOCAL_DIRECT_PROCESSING
|
|
|
|
-include $(KBUILD_EXTMOD)/../build_mode
|
|
|
|
echo := $(shell echo "scst_local build mode: $(BUILD_MODE)" >& 2)
|
|
|
|
BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \
|
|
-DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions
|
|
BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING
|
|
BUILD_MODE_CFLAGS_PERF =
|
|
ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE))
|
|
|
|
obj-m := scst_local.o
|
|
else
|
|
######### BEGIN OUT-OF-TREE RULES #########
|
|
|
|
ifndef PREFIX
|
|
PREFIX=/usr/local
|
|
endif
|
|
|
|
ifeq ($(KVER),)
|
|
ifeq ($(KDIR),)
|
|
KVER := $(shell uname -r)
|
|
KDIR := /lib/modules/$(KVER)/build
|
|
else
|
|
KVER := $(strip $(shell \
|
|
cat $(KDIR)/include/config/kernel.release 2>/dev/null || \
|
|
make -s -C $(KDIR) kernelversion))
|
|
endif
|
|
else
|
|
KDIR := /lib/modules/$(KVER)/build
|
|
endif
|
|
|
|
ifeq ($(INSTALL_MOD_PATH),)
|
|
export INSTALL_MOD_PATH := $(DESTDIR)
|
|
endif
|
|
|
|
INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
|
|
|
|
SCST_DIR := $(shell echo "$$PWD")/../scst
|
|
|
|
all: Modules.symvers Module.symvers
|
|
$(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m
|
|
|
|
install: all
|
|
$(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \
|
|
$$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \
|
|
modules_install
|
|
|
|
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)/scst_local.ko
|
|
-/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER)
|
|
|
|
########## END OUT-OF-TREE RULES ##########
|
|
endif
|
|
|
|
clean:
|
|
@$(MAKE) -C $(KDIR) M=$(shell pwd) clean
|
|
@$(RM) tags Modules.symvers module.symvers Module.markers modules.order
|
|
|
|
extraclean: clean
|
|
rm -f *.orig *.rej
|
|
|
|
2release:
|
|
-$(MAKE) clean
|
|
|
|
2debug:
|
|
-$(MAKE) clean
|
|
|
|
2perf:
|
|
-$(MAKE) clean
|
|
|
|
release-archive:
|
|
../scripts/generate-release-archive scst_local "$$(sed -n 's/^#define[[:blank:]]SCST_LOCAL_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' scst_local.c)"
|
|
|
|
.PHONY: all tgt install uninstall clean extraclean 2release 2debug 2perf
|
|
|