X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=post%2FMakefile;h=a402e6adccaae32e3f2b37b7495c8d1b1ae6961e;hb=84666476841cef3ef6df5c5a2a110d43b0936999;hp=e0ce902133d73e1e035648339b00d93555452f59;hpb=4532cb696eb717419022dbaa8d408e7df7df7b68;p=u-boot diff --git a/post/Makefile b/post/Makefile index e0ce902133..a402e6adcc 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,13 +21,51 @@ # MA 02111-1307 USA # +include $(TOPDIR)/config.mk +include $(OBJTREE)/include/autoconf.mk -SUBDIRS = cpu +LIB = libpost.a +GPLIB-$(CONFIG_HAS_POST) += libgenpost.a +COBJS-$(CONFIG_HAS_POST) += post.o tests.o -LIB = libpost.a +SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.a +SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \ + "lib_$(ARCH)/libpost$(ARCH).a"; fi) +SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH)/fpu ]; then echo \ + "lib_$(ARCH)/fpu/libpost$(ARCH)fpu.a"; fi) +SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d cpu/$(CPU) ]; then echo \ + "cpu/$(CPU)/libpost$(CPU).a"; fi) +SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d board/$(BOARD) ]; then echo \ + "board/$(BOARD)/libpost$(BOARD).a"; fi) -AOBJS = cache_8xx.o -COBJS = post.o tests.o cpu.o rtc.o watchdog.o memory.o i2c.o cache.o sysmon.o -COBJS += uart.o ether.o usb.o spr.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) + +# generic POST library +$(GPLIB): $(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +# specific POST libraries +$(SPLIB): $(obj).depend + $(MAKE) -C $(dir $(subst $(obj),,$@)) + +# the POST lib archive +$(LIB): $(GPLIB) $(SPLIB) + (echo create $(LIB); for lib in $(GPLIB) $(SPLIB) ; \ + do echo addlib $$lib; done; echo save) \ + | $(AR) -M + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################