Whamcloud - gitweb
b=3031
[fs/lustre-release.git] / ldiskfs / ldiskfs / autoMakefile.am
index 11838d6..0d82a44 100644 (file)
@@ -27,15 +27,26 @@ linux/ldiskfs%.h: linux-stage/include/linux/ext3%.h
 # FIXME: we need to grab the series in configure somehow
 # (see bug 1679)
 #
-series := @top_srcdir@/kernel_patches/series/ldiskfs-2.6-suse.series
+series := @top_srcdir@/lustre/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
+patches := @top_srcdir@/lustre/kernel_patches/patches
 
 sources: $(ext3_sources) $(ext3_headers) $(linux_headers) $(series)
        rm -rf linux-stage linux sources $(ldiskfs_SOURCES)
        mkdir -p linux-stage/fs/ext3 linux-stage/include/linux
-       cd linux-stage && quilt setup -l ../$(series)
        cp $(ext3_sources) $(ext3_headers) $(ext3_extra) linux-stage/fs/ext3
        cp $(linux_headers) linux-stage/include/linux
+if USE_QUILT
+       cd linux-stage && quilt setup -l ../$(series) -d ../$(patches)
        cd linux-stage && quilt push -a -q
+else
+       @echo -n "Applying ext3 patches:"
+       @cd linux-stage && for i in $$(<../$(series)) ; do \
+               echo -n " $$i" ; \
+               patch -s -p1 < ../$(patches)/$$i || exit 1 ; \
+       done
+       @echo
+endif
+
        mkdir linux
        @echo -n "Replacing 'ext3' with 'ldiskfs':"
        @for i in $(notdir $(ext3_headers) $(ext3_sources)) $(new_sources) ; do \
@@ -43,12 +54,13 @@ sources: $(ext3_sources) $(ext3_headers) $(linux_headers) $(series)
                sed $(strip $(ldiskfs_sed_flags)) \
                        linux-stage/fs/ext3/$$i > $$i ; \
        done
-       @for i in $(subst ext3,,$(notdir $(linux_headers))) ; do \
+       @for i in $(subst ext3,,$(notdir $(linux_headers)) $(new_linux_hearders)) ; do \
                echo -n " ext3$$i" ; \
                sed $(strip $(ldiskfs_sed_flags)) \
                        linux-stage/include/linux/ext3$$i \
                        > linux/ldiskfs$$i ; \
        done
+       @echo
        touch sources
 
 foo-check:
@@ -59,7 +71,7 @@ foo-check:
        @echo "ldiskfs_OBJECTS: $(ldiskfs_OBJECTS)"
        @echo "ldiskfs_LDADD: $(ldiskfs_LDADD)"
 
-MOSTLYCLEANFILES = *.o *.ko *.mod.c
+MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ 
 CLEANFILES = sources *.c *.h
 
 clean: clean-am