2 # (C) Copyright 2007 Semihalf
4 # See file CREDITS for list of people who contributed to this
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundatio; either version 2 of
10 # the License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 include $(TOPDIR)/config.mk
32 ELF-$(CONFIG_API) += demo
33 BIN-$(CONFIG_API) += demo.bin
39 COBJS-$(CONFIG_API) += $(ELF:=.o)
40 SOBJS-$(CONFIG_API) += crt0.o
42 SOBJS-$(CONFIG_API) += ppcstring.o
48 LIBCOBJS-$(CONFIG_API) += glue.o
49 LIBCOBJS-$(CONFIG_API) += crc32.o
50 LIBCOBJS-$(CONFIG_API) += ctype.o
51 LIBCOBJS-$(CONFIG_API) += string.o
52 LIBCOBJS-$(CONFIG_API) += vsprintf.o
53 LIBCOBJS-$(CONFIG_API) += libgenwrap.o
54 LIBCOBJS := $(LIBCOBJS-y)
56 LIBOBJS += $(addprefix $(obj),$(SOBJS))
57 LIBOBJS += $(addprefix $(obj),$(LIBCOBJS))
59 SRCS += $(COBJS:.o=.c)
60 SRCS += $(LIBCOBJS:.o=.c)
61 SRCS += $(SOBJS:.o=.S)
62 OBJS := $(addprefix $(obj),$(COBJS))
63 ELF := $(addprefix $(obj),$(ELF))
64 BIN := $(addprefix $(obj),$(BIN))
66 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
70 all: $(obj).depend $(OBJS) $(LIB) $(ELF) $(BIN)
72 #########################################################################
73 $(LIB): $(obj).depend $(LIBOBJS)
74 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
77 $(obj)%: $(obj)%.o $(LIB)
78 $(LD) $(obj)crt0.o -Ttext $(LOAD_ADDR) \
84 $(OBJCOPY) -O binary $< $@ 2>/dev/null
88 ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c
92 ln -s $(src)../lib_generic/ctype.c $(obj)ctype.c
96 ln -s $(src)../lib_generic/string.c $(obj)string.c
99 @rm -f $(obj)vsprintf.c
100 ln -s $(src)../lib_generic/vsprintf.c $(obj)vsprintf.c
104 @rm -f $(obj)ppcstring.S
105 ln -s $(src)../lib_ppc/ppcstring.S $(obj)ppcstring.S
108 #########################################################################
110 # defines $(obj).depend target
111 include $(SRCTREE)/rules.mk
113 sinclude $(obj).depend
115 #########################################################################