X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=post%2FMakefile;h=200e2f1b9adcf80ce7060efb6a2c5c48bef9b1a0;hb=6fcc059f81e5c4900d22fe0b1e954330ebbeb720;hp=4ee429de4e51a47ccb9f4b4f4963f6038423e1ca;hpb=79fa88f3ede051ca860667d5397e6cdc7e74a6d0;p=karo-tx-uboot.git diff --git a/post/Makefile b/post/Makefile index 4ee429de4e..200e2f1b9a 100644 --- a/post/Makefile +++ b/post/Makefile @@ -1,5 +1,5 @@ # -# (C) Copyright 2002 +# (C) Copyright 2002-2006 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. # # See file CREDITS for list of people who contributed to this @@ -21,15 +21,55 @@ # MA 02111-1307 USA # +include $(TOPDIR)/config.mk +include $(OBJTREE)/include/autoconf.mk -SUBDIRS = cpu +LIB = libpost.o +GPLIB-$(CONFIG_HAS_POST) += libgenpost.o +COBJS-$(CONFIG_HAS_POST) += post.o +COBJS-$(CONFIG_POST_STD_LIST) += tests.o -LIB = libpost.a +SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.o +SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \ + "lib_$(ARCH)/libpost$(ARCH).o"; fi) +SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH)/fpu ]; then echo \ + "lib_$(ARCH)/fpu/libpost$(ARCH)fpu.o"; fi) +SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d cpu/$(CPU) ]; then echo \ + "cpu/$(CPU)/libpost$(CPU).o"; fi) +SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d board/$(BOARD) ]; then echo \ + "board/$(BOARD)/libpost$(BOARD).o"; fi) -AOBJS = cache_8xx.o -COBJS = cache.o codec.o cpu.o dsp.o ether.o -COBJS += i2c.o memory.o post.o rtc.o -COBJS += spr.o sysmon.o tests.o uart.o -COBJS += usb.o watchdog.o +GPLIB := $(addprefix $(obj),$(GPLIB-y)) +SPLIB := $(addprefix $(obj),$(SPLIB-y)) +COBJS := $(COBJS-y) +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +LIB := $(obj)$(LIB) -include $(TOPDIR)/post/rules.mk +all: $(LIB) + +postdeps: + @for lib in $(SPLIB-y) ; do \ + $(MAKE) -C `dirname $$lib` all ; \ + done + +# generic POST library +$(GPLIB): $(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# specific POST libraries +$(SPLIB): $(obj).depend postdeps + $(MAKE) -C $(dir $(subst $(obj),,$@)) + +# the POST lib archive +$(LIB): $(GPLIB) $(SPLIB) + $(call cmd_link_o_target, $^) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################