diff --git a/fs/Makefile b/fs/Makefile index 95ac0e93fe2ca40e955b4fc844f3f3f9267d0744..8bbd5632493cf7ab4b6e87b87a3788281aa62455 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -22,7 +22,15 @@ # # -SUBDIRS := jffs2 cramfs fdos fat reiserfs ext2 yaffs2 +subdirs-$(CONFIG_CMD_CRAMFS) := cramfs +subdirs-$(CONFIG_CMD_EXT2) += ext2 +subdirs-$(CONFIG_CMD_FAT) += fat +subdirs-$(CONFIG_CMD_FDOS) += fdos +subdirs-$(CONFIG_CMD_JFFS2) += jffs2 +subdirs-$(CONFIG_CMD_REISER) += reiserfs +subdirs-$(CONFIG_YAFFS2) += yaffs2 + +SUBDIRS := $(subdirs-y) $(obj).depend all: @for dir in $(SUBDIRS) ; do \ diff --git a/fs/cramfs/Makefile b/fs/cramfs/Makefile index 13c043fcde90d5fc27c9cad722ed1a0bd892fbf9..7b6cc0ad3e50a69f090db72616f9aa7ef36d700d 100644 --- a/fs/cramfs/Makefile +++ b/fs/cramfs/Makefile @@ -26,10 +26,11 @@ include $(TOPDIR)/config.mk LIB = $(obj)libcramfs.a AOBJS = -COBJS = cramfs.o uncompress.o +COBJS-$(CONFIG_CMD_CRAMFS) := cramfs.o +COBJS-$(CONFIG_CMD_CRAMFS) += uncompress.o -SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS)) +SRCS := $(AOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS-y)) #CPPFLAGS += diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c index e53c783e5a4bed7a2c95452b15ffbf973abdc2d4..2956d390da048f899f3cbb54389eb93907f9a636 100644 --- a/fs/cramfs/cramfs.c +++ b/fs/cramfs/cramfs.c @@ -26,9 +26,6 @@ #include <common.h> #include <malloc.h> - -#if defined(CONFIG_CMD_CRAMFS) - #include <asm/byteorder.h> #include <linux/stat.h> #include <jffs2/jffs2.h> @@ -343,5 +340,3 @@ int cramfs_check (struct part_info *info) } return 1; } - -#endif /* CFG_FS_CRAMFS */ diff --git a/fs/cramfs/uncompress.c b/fs/cramfs/uncompress.c index cf67967904befae8405bb14bbd9de10c29c05f89..39dd2751be7572e1b96450b2dd2e6268a2e15a80 100644 --- a/fs/cramfs/uncompress.c +++ b/fs/cramfs/uncompress.c @@ -25,8 +25,6 @@ #include <watchdog.h> #include <zlib.h> -#if defined(CONFIG_CMD_CRAMFS) - static z_stream stream; void *zalloc(void *, unsigned, unsigned); @@ -86,5 +84,3 @@ int cramfs_uncompress_exit (void) inflateEnd (&stream); return 0; } - -#endif /* CFG_FS_CRAMFS */ diff --git a/fs/ext2/Makefile b/fs/ext2/Makefile index 8313cdc17c2d7d9b8418038d375b2c0e5e678b73..712e348395bed3108fbc75cdff78e04b169b842b 100644 --- a/fs/ext2/Makefile +++ b/fs/ext2/Makefile @@ -30,10 +30,10 @@ include $(TOPDIR)/config.mk LIB = $(obj)libext2fs.a AOBJS = -COBJS = ext2fs.o dev.o +COBJS-$(CONFIG_CMD_EXT2) := ext2fs.o dev.o -SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS)) +SRCS := $(AOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS-y)) #CPPFLAGS += diff --git a/fs/ext2/dev.c b/fs/ext2/dev.c index 1728b34fc8d5c4d5a394c53dd171aa46e6a46349..3b49650bae3f987e827b98ee95dce7def4efdd31 100644 --- a/fs/ext2/dev.c +++ b/fs/ext2/dev.c @@ -25,8 +25,6 @@ #include <common.h> -#if defined(CONFIG_CMD_EXT2) - #include <config.h> #include <ext2fs.h> @@ -139,4 +137,3 @@ int ext2fs_devread (int sector, int byte_offset, int byte_len, char *buf) { } return (1); } -#endif diff --git a/fs/ext2/ext2fs.c b/fs/ext2/ext2fs.c index 78335510e2ba58a08bdd754050cdbd62f8c14add..436f4a4aa92a0f7eaef694743c172b4f8c2482e3 100644 --- a/fs/ext2/ext2fs.c +++ b/fs/ext2/ext2fs.c @@ -24,8 +24,6 @@ */ #include <common.h> - -#if defined(CONFIG_CMD_EXT2) #include <ext2fs.h> #include <malloc.h> #include <asm/byteorder.h> @@ -874,5 +872,3 @@ fail: ext2fs_root = NULL; return (0); } - -#endif diff --git a/fs/fat/Makefile b/fs/fat/Makefile index 87af73b7ebbb36d0b3434ae6dd764c68cdf3bd86..b711460f3a83b9ff0846c4dd599ea9ac1cc35d22 100644 --- a/fs/fat/Makefile +++ b/fs/fat/Makefile @@ -24,10 +24,10 @@ include $(TOPDIR)/config.mk LIB = $(obj)libfat.a AOBJS = -COBJS = fat.o file.o +COBJS-$(CONFIG_CMD_FAT) := fat.o file.o -SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS)) +SRCS := $(AOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS-y)) all: $(LIB) $(AOBJS) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 49c78ed79ac000aa5eb3259fdb51aa011fc94cdf..2f0bd8c14d2147e85cdfd426b3046c92dff3deb4 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -31,8 +31,6 @@ #include <asm/byteorder.h> #include <part.h> -#if defined(CONFIG_CMD_FAT) - /* * Convert a string to lowercase. */ @@ -1024,5 +1022,3 @@ file_fat_read(const char *filename, void *buffer, unsigned long maxsize) printf("reading %s\n",filename); return do_fat_read(filename, buffer, maxsize, LS_NO); } - -#endif diff --git a/fs/fat/file.c b/fs/fat/file.c index 514dbaecba8129bdb62c318ee7ac281530aacccd..e8707344022097b51085b26f90d87629d50e947c 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c @@ -32,8 +32,6 @@ #include <linux/stat.h> #include <linux/time.h> -#if defined(CONFIG_CMD_FAT) - /* Supported filesystems */ static const struct filesystem filesystems[] = { { file_fat_detectfs, file_fat_ls, file_fat_read, "FAT" }, @@ -204,5 +202,3 @@ file_read(const char *filename, void *buffer, unsigned long maxsize) return filesystems[current_filesystem].read(arg, buffer, maxsize); } - -#endif diff --git a/fs/fdos/Makefile b/fs/fdos/Makefile index 2dba0fb690d39c914ad89eef781706d753f1cf01..fce2032bddc1b1bc09bffb66e021a957ee702d13 100644 --- a/fs/fdos/Makefile +++ b/fs/fdos/Makefile @@ -31,10 +31,10 @@ include $(TOPDIR)/config.mk LIB = $(obj)libfdos.a AOBJS = -COBJS = fat.o vfat.o dev.o fdos.o fs.o subdir.o +COBJS-$(CONFIG_CMD_FDOS) := fat.o vfat.o dev.o fdos.o fs.o subdir.o -SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS)) +SRCS := $(AOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS-y)) #CPPFLAGS += diff --git a/fs/fdos/dev.c b/fs/fdos/dev.c index 271d0e790b7a1b815a174c77880a9a06bba5765e..b55b6ed2d63e8dc14f845372d1e4afff70c46ce8 100644 --- a/fs/fdos/dev.c +++ b/fs/fdos/dev.c @@ -28,8 +28,6 @@ #include "dos.h" #include "fdos.h" -#if defined(CONFIG_CMD_FDOS) - #define NB_HEADS 2 #define NB_TRACKS 80 #define NB_SECTORS 18 @@ -190,6 +188,3 @@ int check_dev (BootSector_t *boot, Fs_t *fs) return (0); } - - -#endif diff --git a/fs/fdos/fat.c b/fs/fdos/fat.c index 2e2d2b8cefb0ee0ad48a2ce7982dc2afaa326548..5707c1952cbd90dc5cd96edbac231ebcaf3544ab 100644 --- a/fs/fdos/fat.c +++ b/fs/fdos/fat.c @@ -26,8 +26,6 @@ #include <config.h> #include <malloc.h> -#if defined(CONFIG_CMD_FDOS) - #include "dos.h" #include "fdos.h" @@ -138,5 +136,3 @@ int read_fat (BootSector_t *boot, Fs_t *fs) } return (0); } - -#endif diff --git a/fs/fdos/fdos.c b/fs/fdos/fdos.c index 5be6a960e7ac2352240e28dff1457cd1a3fd4f61..db585623c6616cd76668f32ff45e7e0d40ab3f3c 100644 --- a/fs/fdos/fdos.c +++ b/fs/fdos/fdos.c @@ -24,9 +24,8 @@ #include <common.h> #include <config.h> - -#if defined(CONFIG_CMD_FDOS) #include <malloc.h> + #include "dos.h" #include "fdos.h" @@ -171,5 +170,3 @@ int dos_dir (void) free (name); return (0); } - -#endif diff --git a/fs/fdos/fs.c b/fs/fdos/fs.c index aded6708d1f20cbbce87ba725b5af7c8d61d6c56..5acf1232c72384bd735bd92e34a47276c24e460c 100644 --- a/fs/fdos/fs.c +++ b/fs/fdos/fs.c @@ -26,8 +26,6 @@ #include <config.h> #include <malloc.h> -#if defined(CONFIG_CMD_FDOS) - #include "dos.h" #include "fdos.h" @@ -114,5 +112,3 @@ int fs_init (Fs_t *fs) free (boot); return (0); } - -#endif diff --git a/fs/fdos/subdir.c b/fs/fdos/subdir.c index 497f554f915c3ef572b16f2507ea0bced54ba360..5e96b0a65dd71ddfe76bcb221b182986902b0cdf 100644 --- a/fs/fdos/subdir.c +++ b/fs/fdos/subdir.c @@ -26,8 +26,6 @@ #include <config.h> #include <malloc.h> -#if defined(CONFIG_CMD_FDOS) - #include "dos.h" #include "fdos.h" @@ -345,4 +343,3 @@ int read_file (Fs_t *fs, } return (read); } -#endif diff --git a/fs/fdos/vfat.c b/fs/fdos/vfat.c index 0e7883b0ab370f529f4a0246ad318f1442df1e71..9f357a62122ddab3138f26988540cb93cc7ba7d2 100644 --- a/fs/fdos/vfat.c +++ b/fs/fdos/vfat.c @@ -24,8 +24,6 @@ #include <common.h> #include <config.h> - -#if defined(CONFIG_CMD_FDOS) #include <linux/ctype.h> #include "dos.h" @@ -352,6 +350,3 @@ static char *conv_name (char *name, char *ext, char Case, char *ans) } return (ans); } - - -#endif diff --git a/fs/jffs2/Makefile b/fs/jffs2/Makefile index a071af1f6e5d737cc743fdd73f794bf181c4ea32..fd6a1050c67d14a4f7e03e9afd34fc7fa215da59 100644 --- a/fs/jffs2/Makefile +++ b/fs/jffs2/Makefile @@ -26,13 +26,15 @@ include $(TOPDIR)/config.mk LIB = $(obj)libjffs2.a AOBJS = -COBJS-y += jffs2_1pass.o +ifdef CONFIG_CMD_JFFS2 +COBJS-$(CONFIG_JFFS2_LZO_LZARI) += compr_lzari.o +COBJS-$(CONFIG_JFFS2_LZO_LZARI) += compr_lzo.o COBJS-y += compr_rtime.o COBJS-y += compr_rubin.o COBJS-y += compr_zlib.o +COBJS-y += jffs2_1pass.o COBJS-y += mini_inflate.o -COBJS-y += compr_lzo.o -COBJS-y += compr_lzari.o +endif COBJS := $(COBJS-y) SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c) diff --git a/fs/jffs2/compr_lzari.c b/fs/jffs2/compr_lzari.c index f64bc74a9ee7ad9bc24ae55a04d37f4f63c7cf3a..6a296085620a6a86b57fb58e41f53d45689bdc20 100644 --- a/fs/jffs2/compr_lzari.c +++ b/fs/jffs2/compr_lzari.c @@ -50,8 +50,6 @@ All rights reserved. Permission granted for non-commercial use. #include <config.h> -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI) - #include <linux/stddef.h> #include <jffs2/jffs2.h> @@ -259,4 +257,3 @@ int lzari_decompress(unsigned char *data_in, unsigned char *cpage_out, { return Decode(data_in, cpage_out, srclen, destlen); } -#endif diff --git a/fs/jffs2/compr_lzo.c b/fs/jffs2/compr_lzo.c index a32b9934e4f62ed577e5406d74b4468050367d67..e648ec4fb2e2cf2dc97fd1bf511fc28a9604183f 100644 --- a/fs/jffs2/compr_lzo.c +++ b/fs/jffs2/compr_lzo.c @@ -67,8 +67,6 @@ #include <config.h> -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI) - #include <linux/stddef.h> #include <jffs2/jffs2.h> #include <jffs2/compr_rubin.h> @@ -401,5 +399,3 @@ int lzo_decompress(unsigned char *data_in, unsigned char *cpage_out, lzo_uint outlen = destlen; return lzo1x_decompress (data_in, srclen, cpage_out, &outlen, NULL); } - -#endif diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c index 144263c4225fc119bd767c46881fdda8fd486825..89b9f2f13eb8df9391a0959fe2e68f53856b9113 100644 --- a/fs/jffs2/compr_rtime.c +++ b/fs/jffs2/compr_rtime.c @@ -46,8 +46,6 @@ */ #include <config.h> -#if defined(CONFIG_CMD_JFFS2) - #include <jffs2/jffs2.h> void rtime_decompress(unsigned char *data_in, unsigned char *cpage_out, @@ -87,5 +85,3 @@ void rtime_decompress(unsigned char *data_in, unsigned char *cpage_out, } } } - -#endif diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c index f6f3fa1b5887c1f3bfc2ebc85e77e9242a63fe53..9ff2217738261e210d19f5d135e12b266bb5c1ea 100644 --- a/fs/jffs2/compr_rubin.c +++ b/fs/jffs2/compr_rubin.c @@ -39,8 +39,6 @@ */ #include <config.h> -#if defined(CONFIG_CMD_JFFS2) - #include <jffs2/jffs2.h> #include <jffs2/compr_rubin.h> @@ -122,5 +120,3 @@ void dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out, rubin_do_decompress(bits, data_in+8, cpage_out, dstlen); } - -#endif diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c index 29dfe1b66401c52682e90dda39185f7f43cca98f..d306b6dc4cfe8961c8d8f228087e04b2333904f5 100644 --- a/fs/jffs2/compr_zlib.c +++ b/fs/jffs2/compr_zlib.c @@ -37,8 +37,6 @@ #include <common.h> #include <config.h> -#if defined(CONFIG_CMD_JFFS2) - #include <jffs2/jffs2.h> #include <jffs2/mini_inflate.h> @@ -48,5 +46,3 @@ long zlib_decompress(unsigned char *data_in, unsigned char *cpage_out, return (decompress_block(cpage_out, data_in + 2, (void *) ldr_memcpy)); } - -#endif diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c index b5e7ab8b19e382b68b17e2e4039369d0a0abe47a..5d22dd78e97c77c204e3c5e9fd671b2679aababe 100644 --- a/fs/jffs2/jffs2_1pass.c +++ b/fs/jffs2/jffs2_1pass.c @@ -117,9 +117,6 @@ #include <linux/stat.h> #include <linux/time.h> #include <watchdog.h> - -#if defined(CONFIG_CMD_JFFS2) - #include <jffs2/jffs2.h> #include <jffs2/jffs2_1pass.h> @@ -1394,5 +1391,3 @@ jffs2_1pass_info(struct part_info * part) } return 1; } - -#endif diff --git a/fs/jffs2/jffs2_nand_1pass.c b/fs/jffs2/jffs2_nand_1pass.c index 9f6de7d32a5b3f97a39a8a37116e3b3e8136a8d6..e288d5a84a4dc3b64c6de8c62bd3e56c1f6c60f6 100644 --- a/fs/jffs2/jffs2_nand_1pass.c +++ b/fs/jffs2/jffs2_nand_1pass.c @@ -1,6 +1,6 @@ #include <common.h> -#if !defined(CONFIG_NAND_LEGACY) && defined(CONFIG_CMD_JFFS2) +#if !defined(CONFIG_NAND_LEGACY) #include <malloc.h> #include <linux/stat.h> diff --git a/fs/jffs2/mini_inflate.c b/fs/jffs2/mini_inflate.c index 4c50fc32dc20f6c53561c394ad9605c9f32d9914..bd40a575ed524ae365474e3b1046cf3872369d39 100644 --- a/fs/jffs2/mini_inflate.c +++ b/fs/jffs2/mini_inflate.c @@ -24,9 +24,6 @@ */ #include <config.h> - -#if defined(CONFIG_CMD_JFFS2) - #include <jffs2/mini_inflate.h> /* The order that the code lengths in section 3.2.7 are in */ @@ -392,5 +389,3 @@ long decompress_block(unsigned char *dest, unsigned char *source, #endif return stream.error ? -stream.error : stream.decoded; } - -#endif diff --git a/fs/reiserfs/Makefile b/fs/reiserfs/Makefile index e8711a411a294cac8a64c3ab6a1ae5303dcf6d23..9cef8ee91076723a71b86089a4c60c40fb031952 100644 --- a/fs/reiserfs/Makefile +++ b/fs/reiserfs/Makefile @@ -30,10 +30,10 @@ include $(TOPDIR)/config.mk LIB = $(obj)libreiserfs.a AOBJS = -COBJS = reiserfs.o dev.o mode_string.o +COBJS-$(CONFIG_CMD_REISER) := reiserfs.o dev.o mode_string.o -SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS)) +SRCS := $(AOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS-y)) #CPPFLAGS += diff --git a/fs/reiserfs/dev.c b/fs/reiserfs/dev.c index 46dc41463f130d7deafe892dab657f53b74c3391..1facfaf182d70491884cafbd85111109ce5a482e 100644 --- a/fs/reiserfs/dev.c +++ b/fs/reiserfs/dev.c @@ -19,8 +19,6 @@ #include <common.h> -#if defined(CONFIG_CMD_REISER) - #include <config.h> #include <reiserfs.h> @@ -119,5 +117,3 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf) return 1; } - -#endif diff --git a/fs/reiserfs/mode_string.c b/fs/reiserfs/mode_string.c index 3e57ee4a938259f3c0a5f549ca604aaf9beb6303..801263d881fa8f2ba2c7cba87222a75f58084c94 100644 --- a/fs/reiserfs/mode_string.c +++ b/fs/reiserfs/mode_string.c @@ -25,7 +25,6 @@ #include <common.h> -#if defined(CONFIG_CMD_REISER) #include <linux/stat.h> #if ( S_ISUID != 04000 ) || ( S_ISGID != 02000 ) || ( S_ISVTX != 01000 ) \ @@ -137,5 +136,3 @@ const char *bb_mode_string(int mode) } #endif - -#endif diff --git a/fs/reiserfs/reiserfs.c b/fs/reiserfs/reiserfs.c index aa96361638e9320456d4ac0063108eaab0f753c4..d84fb20bc74e6762c780a7b345355f5ec288ac2d 100644 --- a/fs/reiserfs/reiserfs.c +++ b/fs/reiserfs/reiserfs.c @@ -29,8 +29,6 @@ */ #include <common.h> -#if defined(CONFIG_CMD_REISER) - #include <malloc.h> #include <linux/ctype.h> #include <linux/time.h> @@ -982,5 +980,3 @@ reiserfs_open (char *filename) } return filemax; } - -#endif