-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
58 lines (47 loc) · 2.12 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
HOST1 = [email protected]
HOST2 = [email protected]
INSTALL_PATH = $(CURDIR)/install
NTRDMA_PATH = $(CURDIR)/ntrdma
NTRDMA_LIB_PATH = $(CURDIR)/ntrdma-lib
LX_OPTS = INSTALL_MOD_PATH=$(INSTALL_PATH)
AM_OPTS = DESTDIR=$(INSTALL_PATH)
LX_VERS = `cat $(NTRDMA_PATH)/include/config/kernel.release 2> /dev/null`
all: ntrdma ntrdma-lib
ntrdma:
cp config-ntrdma $(NTRDMA_PATH)/.config
mkdir -p $(INSTALL_PATH){,/boot,/lib/modules}
$(MAKE) -C $(NTRDMA_PATH) $(LX_OPTS) olddefconfig
$(MAKE) -C $(NTRDMA_PATH) $(LX_OPTS)
$(MAKE) -C $(NTRDMA_PATH) $(LX_OPTS) modules_install
cp $(NTRDMA_PATH)/arch/x86/boot/bzImage $(INSTALL_PATH)/boot/vmlinuz-$(LX_VERS)
cp $(NTRDMA_PATH)/System.map $(INSTALL_PATH)/boot/System.map-$(LX_VERS)
cp $(NTRDMA_PATH)/.config $(INSTALL_PATH)/boot/config-$(LX_VERS)
ntrdma-ext:
$(MAKE) -C $(NTRDMA_PATH) $(LX_OPTS) M=drivers/ntb
$(MAKE) -C $(NTRDMA_PATH) $(LX_OPTS) M=drivers/ntb modules_install
$(MAKE) -C $(NTRDMA_PATH) $(LX_OPTS) M=drivers/ntc
$(MAKE) -C $(NTRDMA_PATH) $(LX_OPTS) M=drivers/ntc modules_install
$(MAKE) -C $(NTRDMA_PATH) $(LX_OPTS) M=drivers/infiniband
$(MAKE) -C $(NTRDMA_PATH) $(LX_OPTS) M=drivers/infiniband modules_install
ntrdma-lib:
mkdir -p $(INSTALL_PATH){,/usr/lib64,/etc/libibverbs.d}
cd $(NTRDMA_LIB_PATH) && libtoolize
cd $(NTRDMA_LIB_PATH) && aclocal
cd $(NTRDMA_LIB_PATH) && autoconf
cd $(NTRDMA_LIB_PATH) && autoheader
cd $(NTRDMA_LIB_PATH) && automake --add-missing
cd $(NTRDMA_LIB_PATH) && ./configure --libdir=/usr/lib64 --sysconfdir=/etc
$(MAKE) -C $(NTRDMA_LIB_PATH) $(AM_OPTS)
$(MAKE) -C $(NTRDMA_LIB_PATH) $(AM_OPTS) install
cp $(NTRDMA_LIB_PATH)/ntrdma.driver $(INSTALL_PATH)/etc/libibverbs.d
deploy-files:
mkdir -p $(INSTALL_PATH){,/etc/modprobe.d}
cp modprobe.d/{,node_1/}*.conf $(INSTALL_PATH)/etc/modprobe.d
./deploy-files.sh $(HOST1) $(LX_VERS)
cp modprobe.d/{,node_2/}*.conf $(INSTALL_PATH)/etc/modprobe.d
./deploy-files.sh $(HOST2) $(LX_VERS)
deploy-bootstrap:
./deploy-bootstrap.sh $(HOST1) $(LX_VERS)
./deploy-bootstrap.sh $(HOST2) $(LX_VERS)
deploy: deploy-files deploy-bootstrap
.PHONY: all ntrdma ntrdma-ext ntrdma-lib deploy-files deploy-bootstrap deploy