#########################################################################
#
# Copyright (c) 2002 Xilinx, Inc.  All rights reserved.
#
# Xilinx, Inc.
# XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 
# COURTESY TO YOU.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
# ONE POSSIBLE   IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 
# STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
# IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 
# FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.  
# XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 
# THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 
# ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 
# FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 
# AND FITNESS FOR A PARTICULAR PURPOSE.
# 
# File   : Makefile
# Date   : 2002, March 20.
# Company: Xilinx
#
# $Id: Makefile.sh,v 1.1.2.2 2003/03/13 23:37:07 mohan Exp $
#
############################################################################
ARCH_PREFIX = powerpc-eabi
ARCH_DEFINE = PPC_XILKERNEL
#
# gnu tools for Makefile
#
CC = $(ARCH_PREFIX)-gcc 
AR = $(ARCH_PREFIX)-ar
CP = cp

COMPILER_FLAGS= -O2 -g -Wl,-defsym -Wl,_HEAP_SIZE=0 -Wl,-T -Wl,./klinker_script
COMPILER_FLAGST= -O2 -g -Wl,-defsym -Wl,_HEAP_SIZE=100 -Wl,-T -Wl,./klinker_script
COMPILER_FLAGS0= -O0 -g -Wl,-defsym -Wl,_HEAP_SIZE=600 -Wl,-T -Wl,./klinker_script
EXTRA_COMPILER_FLAGS0=-Wl,-defsym -Wl,_START_ADDR=0x00f00000
EXTRA_COMPILER_FLAGS1=-Wl,-defsym -Wl,_START_ADDR=0x00f10000
EXTRA_COMPILER_FLAGS2=-Wl,-defsym -Wl,_START_ADDR=0x00f20000


#TOPDIR = ../../..
#SYSTEMDIR = ../../../../../..
#INCLUDEDIR = $(SYSTEMDIR)/include
#LIBDIR = ${SYSTEMDIR}/lib
#INCLUDES = -I${TOPDIR}/include -I$(INCLUDEDIR)
#LIBS = -L${LIBDIR} -L${TOPDIR}

SYSTEMDIR = ../ppc405_i
XILKERNELDIR = $(SYSTEMDIR)/libsrc/xilkernel_v1_00_a/src
#TOPDIR = ../../..
INCLUDEDIR = $(SYSTEMDIR)/include
LIBDIR = ${SYSTEMDIR}/lib
INCLUDES = -I${XILKERNELDIR}/include -I$(INCLUDEDIR)
LIBS = -L${LIBDIR} -L${XILKERNELDIR}


EXECS=  print1.elf print2.elf print3.elf

FIRST_TASK=crt0.o

all: ${FIRST_TASK} $(EXECS)

crt0.o:
	${AR} -x ${LIBDIR}/libxil.a crt0.o

print1.elf: print1.c
	$(CC) print1.c -o print1.elf $(EXTRA_COMPILER_FLAGS0) $(COMPILER_FLAGS) $(INCLUDES) $(LIBS)

print2.elf: print2.c
	$(CC) print2.c -o print2.elf $(EXTRA_COMPILER_FLAGS1) $(COMPILER_FLAGS) $(INCLUDES) $(LIBS)

print3.elf: print3.c
	$(CC) print3.c -o print3.elf $(EXTRA_COMPILER_FLAGS2) $(COMPILER_FLAGS) $(INCLUDES) $(LIBS)


clean:
	rm -rf ${EXECS}

