]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - fs/fat/Makefile
FAT: Fix file contents listed as directory
[karo-tx-uboot.git] / fs / fat / Makefile
index 87af73b7ebbb36d0b3434ae6dd764c68cdf3bd86..9635d36fcf9caa4f2023c94b9a48bd08ec13517b 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = $(obj)libfat.a
+LIB    = $(obj)libfat.o
 
 AOBJS  =
-COBJS  = fat.o file.o
+COBJS-$(CONFIG_CMD_FAT)        := fat.o
+COBJS-$(CONFIG_FAT_WRITE):= fat_write.o
 
-SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS))
+ifndef CONFIG_SPL_BUILD
+COBJS-$(CONFIG_CMD_FAT)        += file.o
+endif
+
+SRCS   := $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 all:   $(LIB) $(AOBJS)
 
 $(LIB):        $(obj).depend $(OBJS)
-       $(AR) $(ARFLAGS) $@ $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
 
 
 #########################################################################