diff options
author | Rafal Jaworowski <raj@semihalf.com> | 2008-01-09 19:39:36 +0100 |
---|---|---|
committer | Rafal Jaworowski <raj@semihalf.com> | 2008-01-09 19:39:36 +0100 |
commit | 500856eb1707ed17d9204baa61dd59948d3b2899 (patch) | |
tree | e29338498cbf1b92ad496271e65934b890115545 /api_examples/Makefile | |
parent | 26a41790f8eba19ad450e18ae91351daf485b3e2 (diff) | |
download | u-boot-imx-500856eb1707ed17d9204baa61dd59948d3b2899.zip u-boot-imx-500856eb1707ed17d9204baa61dd59948d3b2899.tar.gz u-boot-imx-500856eb1707ed17d9204baa61dd59948d3b2899.tar.bz2 |
API for external applications.
This is an API for external (standalone) applications running on top of
U-Boot, and is meant to be more extensible and robust than the existing
jumptable mechanism. It is similar to UNIX syscall approach. See api/README
for more details.
Included is the demo application using this new framework (api_examples).
Please note this is still an experimental feature, and is turned off by
default.
Signed-off-by: Rafal Jaworowski <raj@semihalf.com>
Diffstat (limited to 'api_examples/Makefile')
-rw-r--r-- | api_examples/Makefile | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/api_examples/Makefile b/api_examples/Makefile new file mode 100644 index 0000000..5812bcd --- /dev/null +++ b/api_examples/Makefile @@ -0,0 +1,103 @@ +# +# (C) Copyright 2007 Semihalf +# +# 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 Foundatio; 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 +# + +ifeq ($(ARCH),ppc) +LOAD_ADDR = 0x40000 +endif + +#ifeq ($(ARCH),arm) +#LOAD_ADDR = 0xc100000 +#endif + +include $(TOPDIR)/config.mk + +ELF += demo +BIN += demo.bin + +#CFLAGS += -v + +COBJS := $(ELF:=.o) +SOBJS := crt0.o +ifeq ($(ARCH),ppc) +SOBJS += ppcstring.o +endif + +LIB = $(obj)libglue.a +LIBCOBJS= glue.o crc32.o ctype.o string.o vsprintf.o libgenwrap.o + +LIBOBJS = $(addprefix $(obj),$(SOBJS) $(LIBCOBJS)) + +SRCS := $(COBJS:.o=.c) $(LIBCOBJS:.o=.c) $(SOBJS:.o=.S) +OBJS := $(addprefix $(obj),$(COBJS)) +ELF := $(addprefix $(obj),$(ELF)) +BIN := $(addprefix $(obj),$(BIN)) + +gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`) + +CPPFLAGS += -I.. + +all: $(obj).depend $(OBJS) $(LIB) $(BIN) $(ELF) + +######################################################################### +$(LIB): $(obj).depend $(LIBOBJS) + $(AR) $(ARFLAGS) $@ $(LIBOBJS) + +$(ELF): +$(obj)%: $(obj)%.o $(LIB) + $(LD) $(obj)crt0.o -Ttext $(LOAD_ADDR) \ + -o $@ $< $(LIB) \ + -L$(gcclibdir) -lgcc + +$(BIN): +$(obj)%.bin: $(obj)% + $(OBJCOPY) -O binary $< $@ 2>/dev/null + +$(obj)crc32.c: + @rm -f $(obj)crc32.c + ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c + +$(obj)ctype.c: + @rm -f $(obj)ctype.c + ln -s $(src)../lib_generic/ctype.c $(obj)ctype.c + +$(obj)string.c: + @rm -f $(obj)string.c + ln -s $(src)../lib_generic/string.c $(obj)string.c + +$(obj)vsprintf.c: + @rm -f $(obj)vsprintf.c + ln -s $(src)../lib_generic/vsprintf.c $(obj)vsprintf.c + +ifeq ($(ARCH),ppc) +$(obj)ppcstring.S: + @rm -f $(obj)ppcstring.S + ln -s $(src)../lib_ppc/ppcstring.S $(obj)ppcstring.S +endif + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### |