This repository has been archived by the owner on May 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
69 lines (53 loc) · 1.56 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Constants
NAME := scsi2nvme
MODULE_SRC_DIR := third_party/e2e
TRANSLATE_SRC_DIR := lib/translator
NVME_SRC_DIR := third_party/spdk
SCSI_SRC_DIR := lib
TRANSLATION_SRC_DIR := lib/translator
OBJS := $(MODULE_SRC_DIR)/scsi_mock_module.o \
$(MODULE_SRC_DIR)/util.o \
$(MODULE_SRC_DIR)/engine.cc.o \
$(MODULE_SRC_DIR)/nvme_driver.o \
$(TRANSLATION_SRC_DIR)/common.cc.o \
$(TRANSLATION_SRC_DIR)/inquiry.cc.o \
$(TRANSLATION_SRC_DIR)/read_capacity_10.cc.o \
$(TRANSLATION_SRC_DIR)/request_sense.cc.o \
$(TRANSLATION_SRC_DIR)/status.cc.o \
$(TRANSLATION_SRC_DIR)/report_luns.cc.o \
$(TRANSLATION_SRC_DIR)/verify.cc.o \
$(TRANSLATION_SRC_DIR)/read.cc.o \
$(TRANSLATION_SRC_DIR)/synchronize_cache.cc.o \
$(TRANSLATION_SRC_DIR)/mode_sense.cc.o \
$(TRANSLATION_SRC_DIR)/maintenance_in.cc.o \
$(TRANSLATION_SRC_DIR)/unmap.cc.o \
$(TRANSLATION_SRC_DIR)/write.cc.o \
$(TRANSLATION_SRC_DIR)/translation.cc.o
INC := -I$(PWD)/third_party -I$(PWD)
$(NAME)-y := $(OBJS)
#Flags & Feature Disable
cxxflags = $(FLAGS) \
$(KBUILD_CFLAGS) \
-Iinclude \
-fno-builtin \
-nostdlib \
-fno-rtti \
-fno-exceptions \
-std=c++17 \
-O3
obj-m += $(NAME).o
cc-flags-y += $(FLAGS)
ccflags-y := -std=gnu99 -Wno-declaration-after-statement
# Function def
.PHONY: $(NAME).ko
$(NAME).ko:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
.PHONY: clean
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
# C++ compiler
CC := gcc
cxx-prefix := " $(HOSTCXX) [M] "
%.cc.o: %.cc
@echo $(cxx-prefix)$@
@$(HOSTCXX) $(cxxflags) $(INC) -c $< -o $@