fs: Move conditional compilation to Makefile
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
diff --git a/fs/fat/Makefile b/fs/fat/Makefile
index 87af73b..b711460 100644
--- a/fs/fat/Makefile
+++ b/fs/fat/Makefile
@@ -24,10 +24,10 @@
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)