85 lines
2.7 KiB
Makefile
Executable File
85 lines
2.7 KiB
Makefile
Executable File
#
|
|
# (C) Copyright 2000-2003
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
#
|
|
# See file CREDITS for list of people who contributed to this
|
|
# project.
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License as
|
|
# published by the Free Software Foundation; either version 2 of
|
|
# the License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
# MA 02111-1307 USA
|
|
#
|
|
|
|
include $(TOPDIR)/mk/config.mk
|
|
|
|
libchipid_name:=$(notdir $(shell find $(TOPDIR)/drivers/dram/$(PLATFORM)/lib-chipid-all/ -maxdepth 1 -iname libchipid_$(CP_BOARD)))
|
|
lib-chipid-all_check=$(shell if [ -d $(TOPDIR)/drivers/dram/$(PLATFORM)/lib-chipid-all ]; then echo yes; else echo no; fi;)
|
|
|
|
LIB = libdram.o
|
|
|
|
COBJS-y += sunxi_dram.o
|
|
|
|
ifeq ($(notdir $(shell find $(PLATFORM) -name lib-dram)),lib-dram)
|
|
LIBS-y += drivers/dram/$(PLATFORM)/libdram$(DRAM_TYPE_NAME)
|
|
else ifeq ($(CFG_FPGA_PLATFORM)$(notdir $(shell find $(PLATFORM) -name libdram-fpga)),ylibdram-fpga)
|
|
LIBS-y += drivers/dram/$(PLATFORM)/libdram-fpga$(DRAM_TYPE_NAME)
|
|
else
|
|
LIBS-y += drivers/dram/$(PLATFORM)/libdram$(DRAM_TYPE_NAME)
|
|
endif
|
|
|
|
ifeq (x$(TARGET_BUILD_VARIANT), xtina)
|
|
LIBS-y += drivers/dram/$(PLATFORM)/libchipid
|
|
else ifneq (x$(MELIS_BASE), x)
|
|
LIBS-y += drivers/dram/$(PLATFORM)/libchipid
|
|
else
|
|
ifeq ($(shell echo $(libchipid_name) | tr A-Z a-z), $(shell echo "libchipid_$(CP_BOARD)" | tr A-Z a-z))
|
|
LIBS-y += drivers/dram/$(PLATFORM)/lib-chipid-all/$(libchipid_name)
|
|
else
|
|
ifeq (x$(lib-chipid-all_check), xyes)
|
|
LIBS-y += drivers/dram/$(PLATFORM)/lib-chipid-all/libchipid
|
|
else
|
|
LIBS-y += drivers/dram/$(PLATFORM)/libchipid
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
LIBS := $(addprefix $(TOPDIR)/,$(sort $(LIBS-y)))
|
|
|
|
|
|
SRCS := $(COBJS-y:.o=.c)
|
|
OBJS := $(addprefix $(obj),$(COBJS-y))
|
|
OBJS += $(LIBS)
|
|
all: $(obj).depend $(LIB)
|
|
|
|
$(LIB): $(OBJS) $(LIBS)
|
|
$(call cmd_link_o_target, $(OBJS))
|
|
|
|
# add LIBS_TO_BUILD to deleted possiable repeated "drivers/dram/$(PLATFORM)"
|
|
# from drivers/dram/$(PLATFORM)/libchipid
|
|
# and drivers/dram/$(PLATFORM)/libdram
|
|
LIBS_TO_BUILD := $(sort $(dir $(subst $(OBJTREE),,$(LIBS))))
|
|
|
|
$(LIBS): depend $(LIBS_TO_BUILD)
|
|
|
|
.PHONY:$(LIBS_TO_BUILD)
|
|
$(LIBS_TO_BUILD):
|
|
$(MAKE) -C $(dir $(subst $(OBJTREE),,$@))
|
|
#########################################################################
|
|
|
|
depend: $(obj).depend
|
|
.PHONY: depend
|
|
|
|
# defines $(obj).depend target
|
|
include $(TOPDIR)/mk/rules.mk
|