Whamcloud - gitweb
1c7277145657bd1922a1a733c147e51f5013f6a2
[fs/lustre-release.git] / lustre / extN / Makefile.am
1 # Copyright (C) 2001  Cluster File Systems, Inc.
2 #
3 # This code is issued under the GNU General Public License.
4 # See the file COPYING in this distribution
5
6 DEFS:=-DEXPORT_SYMTAB
7 MODULE = extN
8 modulefs_DATA = extN.o
9 EXTRA_PROGRAMS = extN
10
11 EXTNP = htree-ext3-2.4.18.diff ext3-ino_sb-macro.diff
12 EXTNC = balloc.c bitmap.c dir.c file.c fsync.c ialloc.c inode.c ioctl.c
13 EXTNC+= namei.c super.c symlink.c
14 EXTNI = extN_fs.h extN_fs_i.h extN_fs_sb.h extN_jbd.h
15 extN_SOURCES = $(EXTNC) $(EXTNI) page.c # punch.c
16 EXTRA_DIST = $(EXTNP)
17 DISTCLEANFILES = $(EXTNC) $(EXTNI) patch-stamp *.orig *.rej
18 SUB=-e "s/ext3/extN/g" -e "s/EXT3/EXTN/g"
19
20 include $(top_srcdir)/Rules
21
22 page.c:
23         test -e page.c || ln -sf $(top_srcdir)/lib/page.c
24
25 # Patch the kernel files with our ext3 patches.  We need to go through some
26 # extra hoops because the include files are in a different tree and because
27 # patch likes to make local copies of files with (sym)links when it is patching
28 # them.  To avoid this, we copy/patch in the source dir instead of the build
29 # dir (if they are different).
30 $(EXTNC) $(EXTNI): patch-stamp
31 patch-stamp:
32         test -e $(top_srcdir)/fs || ln -sf . $(top_srcdir)/fs
33         set -vx;\
34         list='$(EXTNC)'; for f in $$list; do                                  \
35         sed $(SUB) $(LINUX)/fs/ext3/$$f > $(top_srcdir)/fs/extN/$$f;          \
36         done
37         set -vx;\
38         list='$(EXTNI)'; for i in $$list; do                                  \
39         s=`echo $$i | sed "s/extN/ext3/"`;                                    \
40         sed $(SUB) $(LINUX)/include/linux/$$s >                               \
41                 $(top_srcdir)/include/linux/$$i;                              \
42         done
43         set -vx;\
44         list='$(EXTNP)'; for p in $$list; do                                  \
45         sed $(SUB) $(srcdir)/$$p | (cd $(top_srcdir); patch -p1);             \
46         done
47         (cd $(top_srcdir); patch -p1) < $(srcdir)/extN-ino_sb-fixup.diff
48         echo timestamp > patch-stamp
49
50 # Don't distribute any patched files.
51 dist-hook:
52         rm -f $(top_srcdir)/fs
53         list='$(EXTNC)'; for f in $$list; do rm -f $(distdir)/$$f; done
54         list='$(EXTNI)'; for i in $$list; do                                  \
55                 rm -f $(distdir)/../include/linux/$$i;                        \
56         done