1 # Copyright (C) 2001 Cluster File Systems, Inc.
3 # This code is issued under the GNU General Public License.
4 # See the file COPYING in this distribution
11 EXTNP = htree-ext3-2.4.18.diff linux-2.4.18ea-0.8.26.diff
12 EXTNP+= ext3-2.4.18-ino_sb_macro.diff extN-misc-fixup.diff
13 EXTNC = balloc.c bitmap.c dir.c file.c fsync.c ialloc.c inode.c ioctl.c
14 EXTNC+= namei.c super.c symlink.c
15 EXTNI = extN_fs.h extN_fs_i.h extN_fs_sb.h extN_jbd.h
16 EXTN_EXTRA = include/linux/xattr.h include/linux/extN_xattr.h fs/extN/xattr.c
17 extN_SOURCES = $(EXTNC) $(EXTNI) xattr.c # punch.c
18 extN_DEPENDENCIES = patch-stamp
19 EXTRA_DIST = $(EXTNP) extN-2.4.18-ino_sb_fixup.diff extN-2.4.18-exports.diff
20 DISTCLEANFILES = $(extN_SOURCES) patch-stamp *.orig *.rej
21 SUB=-e "s/ext3/extN/g" -e "s/EXT3/EXTN/g"
23 include $(top_srcdir)/Rules
25 # Create a fresh ext2 patch.
28 for f in $(EXTNC); do diff -u $(top_srcdir)/fs/extN/$$f $$f >> extN.patchT ; done
29 mv -f ext2.patchT $(srcdir)/ext2.patch-$(RELEASE)
32 # Patch the kernel files with our ext3 patches. We need to go through some
33 # extra hoops because the include files are in a different tree and because
34 # patch likes to make local copies of files with (sym)links when it is patching
35 # them. To avoid this, we copy/patch in the source dir instead of the build
36 # dir (if they are different).
39 test -e $(top_srcdir)/fs || ln -sf . $(top_srcdir)/fs
41 list='$(EXTN_EXTRA)'; for f in $$list; do $(RM) $(top_srcdir)/$$f; done
43 list='$(EXTNC)'; for f in $$list; do \
44 sed $(SUB) $(LINUX)/fs/ext3/$$f > $(top_srcdir)/fs/extN/$$f; \
47 list='$(EXTNI)'; for i in $$list; do \
48 s=`echo $$i | sed "s/extN/ext3/"`; \
49 sed $(SUB) $(LINUX)/include/linux/$$s > \
50 $(top_srcdir)/include/linux/$$i; \
53 if [ -f $(srcdir)/extN.patch-$(RELEASE) ]; then \
54 patch -p0 < $(srcdir)/extN.patch-$(RELEASE); \
56 list='$(EXTNP)'; for p in $$list; do \
57 sed $(SUB) $(srcdir)/$$p|(cd $(top_srcdir);patch -p1)||exit -1;\
59 echo "It is OK if the following patch fails"; \
60 (cd $(top_srcdir); patch -N -p1) < $(srcdir)/extN-2.4.18-exports.diff; \
61 (cd $(top_srcdir); patch -p1) < $(srcdir)/extN-2.4.18-ino_sb_fixup.diff; \
65 $(EXTNC) $(EXTNI) $(EXTN_EXTRA) xattr.c: patch-stamp
67 # Don't distribute any patched files.
69 $(RM) $(top_srcdir)/fs
70 list='$(EXTNC)'; for f in $$list; do $(RM) $(distdir)/$$f; done
71 list='$(EXTNI)'; for i in $$list; do \
72 $(RM) $(distdir)/../include/linux/$$i; \
74 list='$(EXTN_EXTRA)'; for f in $$list; do $(RM) $(distdir)/../$$f; done