Merge branch 'Makefile' of git://git.denx.de/u-boot-arm
[platform/kernel/u-boot.git] / drivers / mtd / nand_legacy / Makefile
index 95314d8..a1a9cc9 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    := $(obj)libnand_legacy.a
+LIB    := $(obj)libnand_legacy.a
 
-COBJS  := nand_legacy.o
+ifdef CONFIG_CMD_NAND
+COBJS-$(CONFIG_NAND_LEGACY)    := nand_legacy.o
+endif
 
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
 
 all:   $(LIB)