Whamcloud - gitweb
windows porting: add private lnet tag to b_winnt_port branch
[fs/lustre-release.git] / build / Makefile
1 #
2 # There are four ways this Makefile can be called:
3 #
4
5 # 1.  As a subdirectory from the toplevel, for automake
6 #
7 # 2.  A wrapper around the kernel's makefile when building modules, to
8 #     possibly override the .config file
9 #
10 # 3.  At configure time, as the toplevel module dir for building
11 #     kernel tests
12 #
13 # 4.  At configure time, to determine the kernel's idea of $(ARCH)
14 #
15
16 ifeq ($(PATCHLEVEL),)
17
18 ifeq ($(LUSTRE_LINUX_CONFIG),)
19
20 # case #1
21 include autoMakefile
22
23 else
24
25 # case #2
26 # Note that this comes from make -C $LINUX -f $LUSTRE/build/Makefile
27 # so "include Makefile" below includes $LINUX/Makefile, not this file
28 include $(LUSTRE_LINUX_CONFIG)
29 include Makefile
30
31 endif # LUSTRE_LINUX_CONFIG
32
33 else # PATCHLEVEL
34
35 # case 3
36
37 ifneq ($(LUSTRE_KERNEL_TEST),)
38 ifeq ($(PATCHLEVEL),4)
39 all: $(LUSTRE_KERNEL_TEST)
40 else
41 extra-y = $(LUSTRE_KERNEL_TEST)
42 endif
43 endif
44
45 obj-m := conftest.o
46
47 ifeq ($(PATCHLEVEL),4)
48 include $(TOPDIR)/Rules.make
49 endif
50
51 endif # PATCHLEVEL
52
53 # case 4
54
55 echoarch:
56         echo $(ARCH) >$(ARCHFILE)