-# 8xxROM - Startup Code for the FADS8xx series of Embedded Boards
-# Copyright (C) 1999 Magnus Damm <damm@kieraypc01.p.y.ki.era.ericsson.se>
#
-# 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 Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# (C) Copyright 2000
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
-# 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.
+# See file CREDITS for list of people who contributed to this
+# project.
#
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+# 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 Foundation; 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
+#
+
+ARCH := ppc
+CPU := mpc8xx
+BOARD := tqm8xx
+#XXX#KERNEL := /home/wd/ppc/linux-2.2.13
+KERNEL :=
+
+HOSTARCH := $(shell uname -m | \
+ sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+
+ifeq ($(HOSTARCH),ppc)
+CROSS_COMPILE =
+else
+CROSS_COMPILE = powerpc-linux-
+endif
+
+export ARCH CPU BOARD KERNEL CROSS_COMPILE HOSTARCH
-TOPLEVEL = .
+SUBDIRS = $(ARCH) $(CPU) $(BOARD) common examples tools
-all: s19
+# ppcboot objects....order is important (i.e. start must be first)
+OBJS = $(CPU)/start.o \
+ common/libcommon.a \
+ $(BOARD)/lib$(BOARD).a \
+ $(CPU)/lib$(CPU).a \
+ $(ARCH)/lib$(ARCH).a
-include $(TOPLEVEL)/Make.config
+#########################################################################
-SUBDIRS = romsys lib board disk fs
-EXTRAOBJS = board/libboard.a disk/libdisk.a fs/libfs.a \
- romsys/libsys.a lib/liblib.a
+TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
+export TOPDIR
-# Rom objects....order is important (i.e. start must be first)
-OBJS = romsys/start.o main.o memstuff.o extable.o elf.o $(EXTRAOBJS)
+include $(TOPDIR)/config.mk
-8xxrom: $(SUBDIRS) $(OBJS) ppcrom.lds
- @for i in $(SUBDIRS); do $(MAKE) -C $$i; done
- $(LD) $(LINKFLAGS) $(OBJS) -o 8xxrom
+#########################################################################
-$(EXTRAOBJS):
- @for i in $(SUBDIRS); do $(MAKE) -C $$i; done
+all: ppcboot.srec
-# I ran this though 'dd' because on some NFS mounted file systems this
-# was pretty slow due to the printf. The 'dd' buffers it into
-# more efficient blocks.
-s19: 8xxrom mkrombin bintos19
- $(OBJCOPY) $(OBJCPARAM) -O elf32-powerpc 8xxrom 8xxrom.elf
- $(OBJCOPY) -O srec 8xxrom.elf 8xxrom.elf.s19
- ./mkrombin 8xxrom
- ./bintos19 8xxrom.bin | dd of=8xxrom.bin.s19
+install: all
+ cp ppcboot.srec /net/gatekeeper/tftpboot/moni.srec
-mkrombin: mkrombin.c
- cc -O2 -Ilinux/include -o mkrombin mkrombin.c
+#ppcboot.elf: ppcboot
+# $(OBJCOPY) $(OBJCFLAGS) -O elf32-powerpc $< $@
+#
+#ppcboot.srec: ppcboot.elf
+# $(OBJCOPY) -O srec $< $@
+
+ppcboot.srec: ppcboot
+ $(OBJCOPY) -O srec $< $@
+
+ppcboot: $(SUBDIRS) $(OBJS) include/ppcboot.lds
+ $(LD) $(LDFLAGS) $(OBJS) -o ppcboot
+
+$(SUBDIRS): dummy
+ @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
-bintos19: bintos19.c
- cc -O2 -o bintos19 bintos19.c
+dummy:
+
+#########################################################################
clean:
- @for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
- rm -f $(OBJS) 8xxrom*
+ @for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean; done
+
+clobber distclean: clean
+ @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir distclean; done
+ rm -f $(OBJS) *.bak
+ rm -f ppcboot ppcboot.bin ppcboot.elf ppcboot.srec
+
+backup:
+ F=`basename $(TOPDIR)` ; cd .. ; \
+ gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
-distclean: clean
- @for i in $(SUBDIRS); do $(MAKE) -C $$i distclean; done
- rm -f bintos19 mkrombin
+#########################################################################
-# Dependencies.....This should either be automatic or finished.
-main.o: Makefile
+depend dep:
+ @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir $@ ; done
-# vim: ts=4 noexpandtab nonu
+#########################################################################
+# DO NOT DELETE
# Use native tools and options
#
CPPFLAGS = -Wall -pedantic -O
-CFLAGS = $(CPPFLAGS)
+CFLAGS = $(CPPFLAGS) -I../include
CC = $(HOSTCC)
MAKEDEPEND = makedepend
$(CC) $(CFLAGS) -s -o $@ $^
mkimage: mkimage.o crc32.o
- $(CC) -g $(CFLAGS) -I../include -o $@ $^
-
+ $(CC) -g $(CFLAGS) -o $@ $^
+
crc32.o: crc32.c
- $(CC) -g $(CFLAGS) -I../include -c $^
-
+ $(CC) -g $(CFLAGS) -c $<
+
mkimage.o: mkimage.c
- $(CC) -g $(CFLAGS) -I../include -c $^
+ $(CC) -g $(CFLAGS) -c $<
clean:
rm -f $(OBJS)
#########################################################################
depend dep:
- $(MAKEDEPEND) -- $(CPPFLAGS) -- $(OBJS:.o=.c)
+ $(MAKEDEPEND) -- $(CPPFLAGS) -I../include -- $(OBJS:.o=.c)
#########################################################################
img2srec.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
img2srec.o: /usr/include/ctype.h /usr/include/string.h /usr/include/elf.h
img2srec.o: /usr/include/stdint.h
+mkimage.o: /usr/include/errno.h /usr/include/features.h
+mkimage.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+mkimage.o: /usr/include/bits/errno.h /usr/include/linux/errno.h
+mkimage.o: /usr/include/asm/errno.h /usr/include/fcntl.h
+mkimage.o: /usr/include/bits/fcntl.h /usr/include/sys/types.h
+mkimage.o: /usr/include/bits/types.h
+mkimage.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
+mkimage.o: /usr/include/time.h /usr/include/endian.h
+mkimage.o: /usr/include/bits/endian.h /usr/include/sys/select.h
+mkimage.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
+mkimage.o: /usr/include/sys/sysmacros.h /usr/include/stdio.h
+mkimage.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
+mkimage.o: /usr/include/libio.h /usr/include/_G_config.h
+mkimage.o: /usr/include/bits/stdio_lim.h /usr/include/stdlib.h
+mkimage.o: /usr/include/alloca.h /usr/include/string.h
+mkimage.o: /usr/include/netinet/in.h /usr/include/stdint.h
+mkimage.o: /usr/include/bits/socket.h /usr/include/bits/sockaddr.h
+mkimage.o: /usr/include/asm/socket.h /usr/include/asm/sockios.h
+mkimage.o: /usr/include/bits/in.h /usr/include/bits/byteswap.h
+mkimage.o: /usr/include/sys/mman.h /usr/include/bits/mman.h
+mkimage.o: /usr/include/sys/stat.h /usr/include/bits/stat.h
+mkimage.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
+mkimage.o: /usr/include/bits/confname.h /usr/include/getopt.h
+mkimage.o: ../include/image.h
+crc32.o: ../include/zlib.h