fs: Move conditional compilation to Makefile
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
diff --git a/fs/fdos/Makefile b/fs/fdos/Makefile
index 2dba0fb..fce2032 100644
--- a/fs/fdos/Makefile
+++ b/fs/fdos/Makefile
@@ -31,10 +31,10 @@
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 271d0e7..b55b6ed 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 @@
return (0);
}
-
-
-#endif
diff --git a/fs/fdos/fat.c b/fs/fdos/fat.c
index 2e2d2b8..5707c19 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 @@
}
return (0);
}
-
-#endif
diff --git a/fs/fdos/fdos.c b/fs/fdos/fdos.c
index 5be6a96..db58562 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 @@
free (name);
return (0);
}
-
-#endif
diff --git a/fs/fdos/fs.c b/fs/fdos/fs.c
index aded670..5acf123 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 @@
free (boot);
return (0);
}
-
-#endif
diff --git a/fs/fdos/subdir.c b/fs/fdos/subdir.c
index 497f554..5e96b0a 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 @@
}
return (read);
}
-#endif
diff --git a/fs/fdos/vfat.c b/fs/fdos/vfat.c
index 0e7883b..9f357a6 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 @@
}
return (ans);
}
-
-
-#endif