📄 makefile
字号:
### Note: This Makefile is for 2.6 kernel only, at present.## V0.0.0.5 Ver.Make# default to build for the running kernelifeq ("x", "x$(KERNEL_SRC)") KERNEL_SRC=/lib/modules/$(shell uname -r)/buildendif# use KERNEL_SRC if not called by Mahoroifeq ("x", "x$(KERNEL_SOURCE_DIR)") KERNEL_SRC_DIR=$(KERNEL_SRC)else KERNEL_SRC_DIR=$(KERNEL_SOURCE_DIR)endififeq ("x", "x$(KERNEL_BUILD_DIR)") KERNEL_BLD_DIR=$(KERNEL_SRC_DIR)else KERNEL_BLD_DIR=$(KERNEL_BUILD_DIR)endififneq ($(KERNELRELEASE),) include $(SUBDIRS)/mv_conf.mkelse include mv_conf.mkendififeq ("xy", "x$(RAID_MODULE)") LIB_TYPE=_raid_endif# we may build for 32bit kernel on a 64bit systemCONFIG_64BIT=$(shell cat $(KERNEL_BLD_DIR)/.config | grep -m 1 CONFIG_64BIT | awk -F= '{print $$2}')CONFIG_REGPARM=$(shell cat $(KERNEL_BLD_DIR)/.config | grep -m 1 CONFIG_REGPARM | awk -F= '{print $$2}')ifeq ($(strip $(CONFIG_64BIT)),y) ARCH_TYPE=x86_64 RAID_LIB_NAME=libmv$(LIB_TYPE)64else ARCH_TYPE=i386 ifeq ($(strip $(CONFIG_REGPARM)),y) RAID_LIB_NAME=libmv$(LIB_TYPE)32 else RAID_LIB_NAME=libmv$(LIB_TYPE)32_noregparm endifendifexport LD_LIBRARY_PATHodin_objs_$(SUPPORT_ODIN) := core/odin/core_exp.o core/odin/core_init.o \ core/odin/core_ibcd.o core/odin/core_adpt.o \ core/odin/core_spi.o \ core/odin/core_ses.o core/odin/core_xor.o \ core/odin/core_api.o core/odin/scsi2sata.o \ core/odin/core_i2c.o \ core/odin/ata2scsi.o core/odin/core_helper.o \ core/odin/core_extern.o# core/odin/core_eeprom.o \thor_objs_$(SUPPORT_THOR) := core/thor/core_exp.o core/thor/core_init.o \ core/thor/core_api.o core/thor/core_xor.o \ core/thor/scsi2sata.oCORE_OBJS := $(odin_objs_y) $(thor_objs_y)COMM_OBJS := lib/common/com_util.o lib/common/com_u64.o \ lib/common/com_scsi.o lib/common/com_tag.o \ lib/common/com_sgd.o lib/common/com_nvram.oraid_objs_$(RAID_MODULE) := raid/ddf_handler.o raid/raid0.o \ raid/raid1.o raid/raid_util_ext.o \ raid/raid_api.o raid/raid_bga.o \ raid/raid_cmd_handler.o raid/raid_ddf.o \ raid/raid_eh.o raid/raid_exp.o \ raid/raid_manage_ext.o raid/raid_mp.o \ raid/raid_manage.o raid/raid_res_mgmt.o \ raid/raid_tset.o raid/raid_util.o \ raid/ddf_handler_ext.o raid/raid_api_ext.o \ raid/raid_cmd_ext.o raid/raid_ddf_ext.o \ raid/raid_exp_ext.ocache_objs_$(CACHE_MODULE) := cache/cache_exp.o cache/cache_mod.oraid6_objs_$(RAID6_MODULE) := raid/raid6.o math/math_matrix.oRAID_OBJS := $(raid_objs_y) $(raid6_objs_y) $(cache_objs_y)OSDEP_OBJS := osd/linux/linux_main.o osd/linux/hba_exp.o \ osd/linux/hba_mod.o osd/linux/hba_timer.o \ osd/linux/oss_wrapper.o osd/linux/linux_iface.o \ osd/linux/res_mgmt.o# for partial source tree buildingraid_dir_$(RAID_MODULE) := raidheader_dirs := core common $(raid_dir_y)LIBMV_OBJS := $(CORE_OBJS) $(COMM_OBJS) $(RAID_OBJS)HBA_OBJS := $(OSDEP_OBJS) $(LIBMV_OBJS)INCLUDE_DIR = -I$(KERNEL_BLD_DIR)/include \ -I$(KERNEL_BLD_DIR)/include/scsi \ -I$(KERNEL_BLD_DIR)/drivers/scsi \ -I$(KERNEL_SRC_DIR)/include \ -I$(KERNEL_SRC_DIR)/include/scsi \ -I$(KERNEL_SRC_DIR)/drivers/scsiifneq ($(KERNELRELEASE),)obj-m := odin.oodin-objs := $(HBA_OBJS) clean-files += Modules.symversclean-files += Module.symversEXTRA_CFLAGS := -I$(src)/include -I$(src)/core \ -I$(src)/raid -I$(src)/. \ -I$(src)/osd/linux -I$(src)/math \ -I$(src)/cache -I$(src)/include/generic \ -I$(src)/include/icommonEXTRA_CFLAGS += -D__MV_LINUX__ $(INCLUDE_DIR)ifneq ($(ARCH_TYPE), x86_64)EXTRA_CFLAGS += -D_32_LEGACY_elseEXTRA_CFLAGS += -D_64_SYS_endifEXTRA_CFLAGS += -include $(src)/mv_config.hifeq ($(RAID_MODULE), y)EXTRA_CFLAGS += -DRAID_DRIVER=1endififeq ($(RAID6_MODULE), y)EXTRA_CFLAGS += -DSUPPORT_RAID6=1endififeq ($(CACHE_MODULE), y)EXTRA_CFLAGS += -DCACHE_MODULE_SUPPORT=1endififeq ($(SUPPORT_ODIN), y)EXTRA_CFLAGS += -D__ODIN_DRIVER__ -I$(src)/core/odinendififeq ($(SUPPORT_THOR), y)EXTRA_CFLAGS += -D__THOR_DRIVER__ -I$(src)/core/thorendifEXTRA_CFLAGS += -D__MV_DEBUG__EXTRA_CFLAGS += -D__LEGACY_OSSW__=1EXTRA_CFLAGS += -D__AC_REQ_TRACE__ EXTRA_CFLAGS += -D__AC_COLOR_DEBUG__EXTRA_CFLAGS += -D__AC_LOG__else# Why use SUBDIRS? for backward compatibilityall: $(MAKE) ARCH=$(ARCH_TYPE) CC=$(CC) LD=$(LD) V=$(V) -C $(KERNEL_BLD_DIR) SUBDIRS=`pwd` modulesclean: $(MAKE) V=$(V) -C $(KERNEL_BLD_DIR) SUBDIRS=`pwd` clean @rm -rf partial @rm -rf thor @rm -rf *.o *.objendif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -