mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-16 10:11:28 +00:00
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@457 d57e44dd-8a1f-0410-8b47-8ef2f437770f
59 lines
1.6 KiB
Makefile
59 lines
1.6 KiB
Makefile
#
|
|
# Makefile for the Linux kernel device drivers.
|
|
#
|
|
# Note! Dependencies are done automagically by 'make dep', which also
|
|
# removes any old dependencies. DON'T put your own dependencies here
|
|
# unless it's something special (not a .c file).
|
|
#
|
|
# Note 2! The CFLAGS definitions are now in the main makefile.
|
|
|
|
SCST_DIR := $(shell pwd)/../scst/src
|
|
SUBDIRS := $(shell pwd)
|
|
|
|
ifeq ($(KVER),)
|
|
ifeq ($(KDIR),)
|
|
KVER = $(shell uname -r)
|
|
KDIR ?= /lib/modules/$(KVER)/build
|
|
else
|
|
KVER = $$KERNELRELEASE
|
|
endif
|
|
else
|
|
KDIR ?= /lib/modules/$(KVER)/build
|
|
endif
|
|
|
|
all: Modules.symvers Module.symvers
|
|
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src 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`; \
|
|
install -vD -m 644 src/ib_srpt.ko \
|
|
$(DISTDIR)$(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra/ib_srpt.ko
|
|
-/sbin/depmod -aq $(KVER)
|
|
|
|
SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Modules.symvers 2>/dev/null)
|
|
ifneq ($(SCST_MOD_VERS),)
|
|
Modules.symvers: $(SCST_DIR)/Modules.symvers
|
|
echo $(SCST_MOD_VERS)
|
|
cp $(SCST_DIR)/Modules.symvers src/
|
|
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 src/
|
|
else
|
|
.PHONY: Module.symvers
|
|
endif
|
|
|
|
clean:
|
|
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src clean
|
|
rm -f src/Modules.symvers src/Module.symvers src/Module.markers \
|
|
src/modules.order
|
|
|
|
extraclean: clean
|
|
|
|
.PHONY: all install clean extraclean
|