1 EXTRA_DIST = kernel_patches
7 modulefs_DATA = ldiskfs$(KMODEXT)
9 ldiskfs$(KMODEXT): sources
13 ldiskfs_linux_headers := $(addprefix linux/,$(subst ext4,ldiskfs,$(notdir $(linux_headers))))
15 $(filter %.c,$(ldiskfs_patched_sources)): sources $(ldiskfs_linux_headers) $(filter %.h,$(ldiskfs_patched_sources))
18 -e "s/dx_hash_info/ext4_dx_hash_info/g" \
19 -e "s/DX_HASH/EXT4_DX_HASH/g" \
20 -e "s/EXT4/LDISKFS/g" -e "s/ext4/ldiskfs/g"
22 %.c: linux-stage/fs/ext4/%.c
23 sed $(strip $(ldiskfs_sed_flags)) $< > $@
25 %.h: linux-stage/fs/ext4/%.h
26 sed $(strip $(ldiskfs_sed_flags)) $< > $@
28 linux/ldiskfs%.h: linux-stage/include/linux/ext4%.h
29 sed $(strip $(ldiskfs_sed_flags)) $< > $@
31 series := @top_srcdir@/ldiskfs/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
32 patches := @top_srcdir@/ldiskfs/kernel_patches/patches
34 sources: $(backfs_sources) $(backfs_headers) $(linux_headers) $(series) $(trace_headers)
35 rm -rf linux-stage linux sources trace $(ldiskfs_SOURCES)
36 mkdir -p linux-stage/fs/ext4 linux-stage/include/linux \
37 linux-stage/include/trace/events
38 cp $(backfs_sources) $(backfs_headers) $(backfs_extra) linux-stage/fs/ext4
39 if test -n "$(linux_headers)" ; then \
40 cp $(linux_headers) linux-stage/include/linux; \
42 if test -n "$(trace_headers)" ; then \
43 cp $(trace_headers) linux-stage/include/trace/events; \
46 ln -s ../$(patches) linux-stage/patches
47 ln -s ../$(series) linux-stage/series
48 cd linux-stage && quilt push -a -q
50 @echo -n "Applying ext4 patches:"
51 @cd linux-stage && for i in $$(<../$(series)) ; do \
53 patch -s -p1 < ../$(patches)/$$i || exit 1 ; \
57 mkdir -p linux trace/events
58 @echo -n "Replacing 'ext4' with 'ldiskfs':"
59 for i in $(notdir $(backfs_headers) $(backfs_sources)) $(new_sources) ; do \
61 sed $(strip $(ldiskfs_sed_flags)) \
62 linux-stage/fs/ext4/$$i > $$i ; \
64 for i in $(subst ext4,,$(notdir $(backfs_headers))) ; do \
65 if test -f "ext4$$i" ; then \
66 echo -n " ext4$$i" ; \
67 mv ext4$$i ldiskfs$$i ; \
70 for i in $(subst ext4,,$(notdir $(linux_headers) $(new_headers))) ; do \
71 echo -n " ext4$$i" ; \
72 sed $(strip $(ldiskfs_sed_flags)) \
73 linux-stage/include/linux/ext4$$i \
74 > linux/ldiskfs$$i ; \
76 for i in $(subst ext4,,$(notdir $(trace_headers))) ; do \
78 sed $(strip $(ldiskfs_sed_flags)) \
79 linux-stage/include/trace/events/ext4$$i \
80 > trace/events/ldiskfs$$i ; \
82 for i in $(notdir $(linux_new_headers)) ; do \
84 sed $(strip $(ldiskfs_sed_flags)) \
85 linux-stage/include/linux/$$i \
93 @echo "ldiskfs_sources: $(ldiskfs_sources)"
94 @echo "ldiskfs_SOURCES: $(ldiskfs_SOURCES)"
95 @echo "ldiskfs_headers: $(ldiskfs_headers)"
96 @echo "ldiskfs_objects: $(ldiskfs_objects)"
97 @echo "ldiskfs_OBJECTS: $(ldiskfs_OBJECTS)"
98 @echo "ldiskfs_LDADD: $(ldiskfs_LDADD)"
100 MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
101 CLEANFILES = sources $(notdir $(linux_new_headers) $(linux_headers) $(backfs_headers) $(backfs_sources) $(new_sources) $(new_headers) $(trace_headers))
104 rm -rf linux linux-stage ldiskfs*.h trace modules.order