Whamcloud - gitweb
Another slightly less rough cut at XML based configuration. There
[fs/lustre-release.git] / lustre / extN / Makefile.am
index 1c72771..c34c1cb 100644 (file)
@@ -8,29 +8,38 @@ MODULE = extN
 modulefs_DATA = extN.o
 EXTRA_PROGRAMS = extN
 
-EXTNP = htree-ext3-2.4.18.diff ext3-ino_sb-macro.diff
+EXTNP = htree-ext3-2.4.18.diff linux-2.4.18ea-0.8.26.diff
+EXTNP+= ext3-2.4.18-ino_sb_macro.diff extN-misc-fixup.diff
 EXTNC = balloc.c bitmap.c dir.c file.c fsync.c ialloc.c inode.c ioctl.c
 EXTNC+= namei.c super.c symlink.c
 EXTNI = extN_fs.h extN_fs_i.h extN_fs_sb.h extN_jbd.h
-extN_SOURCES = $(EXTNC) $(EXTNI) page.c # punch.c
-EXTRA_DIST = $(EXTNP)
-DISTCLEANFILES = $(EXTNC) $(EXTNI) patch-stamp *.orig *.rej
+EXTN_EXTRA = include/linux/xattr.h include/linux/extN_xattr.h fs/extN/xattr.c
+extN_SOURCES = $(EXTNC) $(EXTNI) xattr.c # punch.c
+extN_DEPENDENCIES = patch-stamp
+EXTRA_DIST = $(EXTNP) extN-2.4.18-ino_sb_fixup.diff extN-2.4.18-exports.diff
+DISTCLEANFILES = $(extN_SOURCES) patch-stamp *.orig *.rej
 SUB=-e "s/ext3/extN/g" -e "s/EXT3/EXTN/g"
 
 include $(top_srcdir)/Rules
 
-page.c:
-       test -e page.c || ln -sf $(top_srcdir)/lib/page.c
+# Create a fresh ext2 patch.
+diff:
+       $(RM) extN.patchT
+       for f in $(EXTNC); do diff -u $(top_srcdir)/fs/extN/$$f $$f >> extN.patchT ; done
+       mv -f ext2.patchT $(srcdir)/ext2.patch-$(RELEASE)
+.PHONY: diff
 
 # Patch the kernel files with our ext3 patches.  We need to go through some
 # extra hoops because the include files are in a different tree and because
 # patch likes to make local copies of files with (sym)links when it is patching
 # them.  To avoid this, we copy/patch in the source dir instead of the build
 # dir (if they are different).
-$(EXTNC) $(EXTNI): patch-stamp
-patch-stamp:
+patch-stamp: $(EXTNP)
+       $(RM) $@
        test -e $(top_srcdir)/fs || ln -sf . $(top_srcdir)/fs
        set -vx;\
+       list='$(EXTN_EXTRA)'; for f in $$list; do $(RM) $(top_srcdir)/$$f; done
+       set -vx;\
        list='$(EXTNC)'; for f in $$list; do                                  \
        sed $(SUB) $(LINUX)/fs/ext3/$$f > $(top_srcdir)/fs/extN/$$f;          \
        done
@@ -41,16 +50,25 @@ patch-stamp:
                $(top_srcdir)/include/linux/$$i;                              \
        done
        set -vx;\
-       list='$(EXTNP)'; for p in $$list; do                                  \
-       sed $(SUB) $(srcdir)/$$p | (cd $(top_srcdir); patch -p1);             \
-       done
-       (cd $(top_srcdir); patch -p1) < $(srcdir)/extN-ino_sb-fixup.diff
-       echo timestamp > patch-stamp
+       if [ -f $(srcdir)/extN.patch-$(RELEASE) ]; then \
+               patch -p0 < $(srcdir)/extN.patch-$(RELEASE); \
+       else \
+               list='$(EXTNP)'; for p in $$list; do                        \
+               sed $(SUB) $(srcdir)/$$p|(cd $(top_srcdir);patch -p1)||exit -1;\
+               done;  \
+               echo "It is OK if the following patch fails";               \
+               (cd $(top_srcdir); patch -N -p1) < $(srcdir)/extN-2.4.18-exports.diff; \
+               (cd $(top_srcdir); patch -p1) < $(srcdir)/extN-2.4.18-ino_sb_fixup.diff; \
+       fi
+       echo timestamp > $@
+
+$(EXTNC) $(EXTNI) $(EXTN_EXTRA) xattr.c: patch-stamp
 
 # Don't distribute any patched files.
 dist-hook:
-       rm -f $(top_srcdir)/fs
-       list='$(EXTNC)'; for f in $$list; do rm -f $(distdir)/$$f; done
+       $(RM) $(top_srcdir)/fs
+       list='$(EXTNC)'; for f in $$list; do $(RM) $(distdir)/$$f; done
        list='$(EXTNI)'; for i in $$list; do                                  \
-               rm -f $(distdir)/../include/linux/$$i;                        \
+               $(RM) $(distdir)/../include/linux/$$i;                        \
        done
+       list='$(EXTN_EXTRA)'; for f in $$list; do $(RM) $(distdir)/../$$f; done