Whamcloud - gitweb
Branch b1_6
[fs/lustre-release.git] / ldiskfs / ldiskfs / autoMakefile.am
index 4fd32d4..f7b83ad 100644 (file)
@@ -1,17 +1,15 @@
-if MODULES
-if LDISKFS
 modulefs_DATA = ldiskfs$(KMODEXT)
-endif
-endif
 
 ldiskfs_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs,$(notdir $(linux_headers))))
 
-$(filter %.c,$(ldiskfs_sources)): sources $(ldiskfs_linux_headers) $(filter %.h,$(ldiskfs_sources))
+$(filter %.c,$(ldiskfs_patched_sources)): sources $(ldiskfs_linux_headers) $(filter %.h,$(ldiskfs_patched_sources))
 
 ldiskfs_sed_flags = \
        -e "s/dx_hash_info/ext3_dx_hash_info/g" \
        -e "s/dir_private_info/ext3_dir_private_info/g" \
        -e "s/DX_HASH/EXT3_DX_HASH/g" \
+       -e "s/reserve_window/ext3_reserve_window/g" \
+       -e "s/rsv_window_add/ext3_rsv_window_add/g" \
        -e "s/EXT3/LDISKFS/g" -e "s/ext3/ldiskfs/g"
 
 %.c: linux-stage/fs/ext3/%.c
@@ -23,29 +21,26 @@ ldiskfs_sed_flags = \
 linux/ldiskfs%.h: linux-stage/include/linux/ext3%.h
        sed $(strip $(ldiskfs_sed_flags)) $< > $@
 
-#
-# FIXME: we need to grab the series in configure somehow
-# (see bug 1679)
-#
-series := @top_srcdir@/lustre/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
-patches := @top_srcdir@/lustre/kernel_patches/patches
+series := @top_srcdir@/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
+patches := @top_srcdir@/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
        cp $(ext3_sources) $(ext3_headers) $(ext3_extra) linux-stage/fs/ext3
        cp $(linux_headers) linux-stage/include/linux
-       cd linux-stage && quilt push -a -q
 if USE_QUILT
-       cd linux-stage && quilt setup -l ../$(series) -d ../$(patches)
+       ln -s ../$(patches) linux-stage/patches
+       ln -s ../$(series) linux-stage/series
        cd linux-stage && quilt push -a -q
 else
+       @echo -n "Applying ext3 patches:"
        @cd linux-stage && for i in $$(<../$(series)) ; do \
-               echo "patch -p1 < ../$(patches)/$$i" ; \
-               patch -p1 < ../$(patches)/$$i || exit 1 ; \
+               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 \
@@ -53,7 +48,7 @@ endif
                sed $(strip $(ldiskfs_sed_flags)) \
                        linux-stage/fs/ext3/$$i > $$i ; \
        done
-       @for i in $(subst ext3,,$(notdir $(linux_headers)) $(new_linux_hearders)) ; do \
+       @for i in $(subst ext3,,$(notdir $(linux_headers) $(new_headers))) ; do \
                echo -n " ext3$$i" ; \
                sed $(strip $(ldiskfs_sed_flags)) \
                        linux-stage/include/linux/ext3$$i \
@@ -70,8 +65,8 @@ foo-check:
        @echo "ldiskfs_OBJECTS: $(ldiskfs_OBJECTS)"
        @echo "ldiskfs_LDADD: $(ldiskfs_LDADD)"
 
-MOSTLYCLEANFILES = *.o *.ko *.mod.c
-CLEANFILES = sources *.c *.h
+MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ 
+CLEANFILES = sources $(notdir $(linux_headers) $(ext3_headers) $(ext3_sources) $(new_sources) $(new_headers))
 
 clean: clean-am
        rm -rf linux linux-stage