3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # See file CREDITS for list of people who contributed to this
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 include $(TOPDIR)/config.mk
30 SRC = update.c flash.c flash_hw.c utils.c cmd_flash.c string.c ctype.c dummy.c
32 OBJS = $(SRC:.c=.o) $(ASRC:.S=.o)
34 LIB = $(TOPDIR)/examples/libstubs.a
36 LIBCOBJS= $(TOPDIR)/examples/stubs.o
37 LIBOBJS = $(LIBAOBJS) $(LIBCOBJS)
39 CPPFLAGS += -I$(TOPDIR) -I$(TOPDIR)/board/MAI/AmigaOneG3SE
40 CFLAGS += -I$(TOPDIR)/board/MAI/AmigaOneG3SE
42 all: .depend $(LIB) $(PROG)
44 #########################################################################
45 $(LIB): .depend $(LIBOBJS)
46 $(AR) crv $@ $(LIBOBJS)
49 $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e $(<:.o=) $< $(LIB)
50 $(OBJCOPY) -O srec $(<:.o=) $@
53 $(CC) $(CPPFLAGS) -c $<
56 $(CC) $(CPPFLAGS) -c $<
58 #########################################################################
60 updater: $(OBJS) $(LIB) $(TOPDIR)/board/MAI/AmigaOneG3SE/memio.o
61 $(LD) -g -Ttext $(LOAD_ADDR) -o updater -e _main $(OBJS) $(LIB) \
62 $(TOPDIR)/board/MAI/AmigaOneG3SE/memio.o
63 $(OBJCOPY) -O binary updater updater.bin
65 updater.image: updater $(TOPDIR)/u-boot.bin
66 cat >/tmp/tempimage updater.bin junk $(TOPDIR)/u-boot.bin
67 $(TOPDIR)/tools/mkimage -A ppc -O u-boot -T standalone -C none -a $(LOAD_ADDR) \
68 -e `ppc-elf32-nm updater | grep _main | cut --bytes=0-8` \
69 -n "Firmware Updater" -d /tmp/tempimage updater.image
71 cp updater.image /tftpboot
73 updater.image2: updater $(TOPDIR)/u-boot.bin
74 cat >/tmp/tempimage updater.bin junk ../../create_image/image
75 $(TOPDIR)/tools/mkimage -A ppc -O u-boot -T standalone -C none -a $(LOAD_ADDR) \
76 -e `ppc-elf32-nm updater | grep _main | cut --bytes=0-8` \
77 -n "Firmware Updater" -d /tmp/tempimage updater.image
79 cp updater.image /tftpboot
81 .depend: Makefile $(SRC) $(ASRC) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)
82 $(CC) -M $(CFLAGS) $(SRC) $(ASRC) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S) > $@
86 #########################################################################