[openib-general] [PATCH][DAPL] make dapl build outside of kernel tree
Tom Duffy
tduffy at sun.com
Wed Apr 27 13:28:04 PDT 2005
Until DAPL is in the trunk, it should be albe to be built outside of
your normal kernel tree. These changes make that possible. Now, you
can type something like:
$ KERNELDIR=/path/to/kernel/dir/or/object/dir make
in each of dat, dat-provider, and patches (to get ib_at).
Signed-off-by: Tom Duffy <tduffy at sun.com>
Index: gen2/users/jlentini/linux-kernel/dat-provider/Makefile
===================================================================
--- gen2/users/jlentini/linux-kernel/dat-provider/Makefile (revision 2219)
+++ gen2/users/jlentini/linux-kernel/dat-provider/Makefile (working copy)
@@ -1,18 +1,3 @@
-
-obj-$(CONFIG_INFINIBAND_DAT_PROVIDER) += ib_dat_provider.o
-
-#debug
-KDAPL_DEBUG = 1
-ifeq (1,$(KDAPL_DEBUG))
- EXTRA_CFLAGS += -O0 -g
- EXTRA_CFLAGS += -DDAPL_DBG # -DDAPL_DBG_IO_TRC
-endif
-
-EXTRA_CFLAGS += \
- -DDAPL_ATS \
- -Idrivers/infiniband/include \
- -Idrivers/dat
-
PROVIDER_MODULES := \
dapl_openib_qp \
dapl_openib_util \
@@ -106,5 +91,25 @@ PROVIDER_MODULES := \
PROVIDER_OBJS := $(foreach s, $(PROVIDER_MODULES), $(s).o)
-ib_dat_provider-y:= $(PROVIDER_OBJS)
+KDAPL_DEBUG = 1
+ifeq (1,$(KDAPL_DEBUG))
+ EXTRA_CFLAGS += -O0 -g
+ EXTRA_CFLAGS += -DDAPL_DBG # -DDAPL_DBG_IO_TRC
+endif
+
+EXTRA_CFLAGS += -DDAPL_ATS -Idrivers/infiniband/include -I$(obj)/../dat -I$(obj)/../patches/
+
+ifneq ($(KERNELRELEASE),)
+ obj-m := ib_dat_provider.o
+ ib_dat_provider-objs := $(PROVIDER_OBJS)
+else
+ KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+ PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+
+endif
+clean:
+ rm -f *.o *.ko
Index: gen2/users/jlentini/linux-kernel/patches/at.c
===================================================================
--- gen2/users/jlentini/linux-kernel/patches/at.c (revision 2219)
+++ gen2/users/jlentini/linux-kernel/patches/at.c (working copy)
@@ -45,7 +45,7 @@
#include <ib_verbs.h>
#include <ib_sa.h>
-#include "../ulp/ipoib/ipoib.h"
+#include <ipoib.h>
#include <ib_at.h>
MODULE_AUTHOR("Shahar Frank");
Index: gen2/users/jlentini/linux-kernel/patches/Makefile
===================================================================
--- gen2/users/jlentini/linux-kernel/patches/Makefile (revision 0)
+++ gen2/users/jlentini/linux-kernel/patches/Makefile (revision 0)
@@ -0,0 +1,16 @@
+EXTRA_CFLAGS += -Werror -Idrivers/infiniband/include -Idrivers/infiniband/ulp/ipoib/ -I$(obj)
+
+ifneq ($(KERNELRELEASE),)
+ obj-m := ib_at.o
+ ib_at-objs := at.o
+else
+ KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+ PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+
+endif
+
+clean:
+ rm -f *.o *.ko
Index: gen2/users/jlentini/linux-kernel/dat/Makefile
===================================================================
--- gen2/users/jlentini/linux-kernel/dat/Makefile (revision 2219)
+++ gen2/users/jlentini/linux-kernel/dat/Makefile (working copy)
@@ -1,13 +1,16 @@
+EXTRA_CFLAGS += -Werror -I$(obj)
-EXTRA_CFLAGS += \
- -Idrivers/dat \
- -Werror
+ifneq ($(KERNELRELEASE),)
+ obj-m := dat.o
+ dat-objs := consumer.o core.o dictionary.o dr.o provider.o
+else
+ KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+ PWD := $(shell pwd)
-obj-$(CONFIG_DAT) += dat.o
+default:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
-dat-y := \
- consumer.o \
- core.o \
- dictionary.o \
- dr.o \
- provider.o
+endif
+
+clean:
+ rm -r *.o *.ko
More information about the general
mailing list