X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=ldiskfs%2Fldiskfs%2FautoMakefile.am;h=a64b8bb5dea0b0452cf4354326933d542ab02ab5;hb=f641913a348ec0179cdc599baa93f74aa64f9943;hp=b24081e0af1c9298252acc669710d910b63d2609;hpb=bd1b99d7caa6ab2b7c771524af9178a3da69eeab;p=fs%2Flustre-release.git diff --git a/ldiskfs/ldiskfs/autoMakefile.am b/ldiskfs/ldiskfs/autoMakefile.am index b24081e..a64b8bb 100644 --- a/ldiskfs/ldiskfs/autoMakefile.am +++ b/ldiskfs/ldiskfs/autoMakefile.am @@ -1,52 +1,82 @@ -if LDISKFS modulefs_DATA = ldiskfs$(KMODEXT) -endif -ldiskfs_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs,$(notdir $(linux_headers)))) +ldiskfs_linux_headers := $(addprefix linux/,$(subst ext4,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/EXT3/LDISKFS/g" -e "s/ext3/ldiskfs/g" + -e "s/dx_hash_info/ext4_dx_hash_info/g" \ + -e "s/DX_HASH/EXT4_DX_HASH/g" \ + -e "s/EXT4/LDISKFS/g" -e "s/ext4/ldiskfs/g" -%.c: linux-stage/fs/ext3/%.c +%.c: linux-stage/fs/ext4/%.c sed $(strip $(ldiskfs_sed_flags)) $< > $@ -%.h: linux-stage/fs/ext3/%.h +%.h: linux-stage/fs/ext4/%.h sed $(strip $(ldiskfs_sed_flags)) $< > $@ -linux/ldiskfs%.h: linux-stage/include/linux/ext3%.h +linux/ldiskfs%.h: linux-stage/include/linux/ext4%.h sed $(strip $(ldiskfs_sed_flags)) $< > $@ -# -# 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@/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 - 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 +sources: $(backfs_sources) $(backfs_headers) $(linux_headers) $(series) $(trace_headers) + rm -rf linux-stage linux sources trace $(ldiskfs_SOURCES) + mkdir -p linux-stage/fs/ext4 linux-stage/include/linux \ + linux-stage/include/trace/events + cp $(backfs_sources) $(backfs_headers) $(backfs_extra) linux-stage/fs/ext4 + if test -n "$(linux_headers)" ; then \ + cp $(linux_headers) linux-stage/include/linux; \ + fi + if test -n "$(trace_headers)" ; then \ + cp $(trace_headers) linux-stage/include/trace/events; \ + fi +if USE_QUILT + ln -s ../$(patches) linux-stage/patches + ln -s ../$(series) linux-stage/series cd linux-stage && quilt push -a -q - mkdir linux - @echo -n "Replacing 'ext3' with 'ldiskfs':" - @for i in $(notdir $(ext3_headers) $(ext3_sources)) $(new_sources) ; do \ +else + @echo -n "Applying ext4 patches:" + @cd linux-stage && for i in $$(<../$(series)) ; do \ + echo -n " $$i" ; \ + patch -s -p1 < ../$(patches)/$$i || exit 1 ; \ + done + @echo +endif + mkdir -p linux trace/events + @echo -n "Replacing 'ext4' with 'ldiskfs':" + for i in $(notdir $(backfs_headers) $(backfs_sources)) $(new_sources) ; do \ echo -n " $$i" ; \ sed $(strip $(ldiskfs_sed_flags)) \ - linux-stage/fs/ext3/$$i > $$i ; \ + linux-stage/fs/ext4/$$i > $$i ; \ + done + for i in $(subst ext4,,$(notdir $(backfs_headers))) ; do \ + if test -f "ext4$$i" ; then \ + echo -n " ext4$$i" ; \ + mv ext4$$i ldiskfs$$i ; \ + fi ; \ done - @for i in $(subst ext3,,$(notdir $(linux_headers))) ; do \ - echo -n " ext3$$i" ; \ + for i in $(subst ext4,,$(notdir $(linux_headers) $(new_headers))) ; do \ + echo -n " ext4$$i" ; \ sed $(strip $(ldiskfs_sed_flags)) \ - linux-stage/include/linux/ext3$$i \ + linux-stage/include/linux/ext4$$i \ > linux/ldiskfs$$i ; \ done + for i in $(subst ext4,,$(notdir $(trace_headers))) ; do \ + echo -n " ext4$$i"; \ + sed $(strip $(ldiskfs_sed_flags)) \ + linux-stage/include/trace/events/ext4$$i \ + > trace/events/ldiskfs$$i ; \ + done + for i in $(notdir $(linux_new_headers)) ; do \ + echo -n " $$i"; \ + sed $(strip $(ldiskfs_sed_flags)) \ + linux-stage/include/linux/$$i \ + > linux/$$i ; \ + done + + @echo touch sources foo-check: @@ -57,8 +87,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_new_headers) $(linux_headers) $(backfs_headers) $(backfs_sources) $(new_sources) $(new_headers) $(trace_headers)) clean: clean-am - rm -rf linux linux-stage + rm -rf linux linux-stage ldiskfs*.h trace