#$Id: Makefile,v 1.1 2004/03/14 10:23:19 morsiani Exp $
#Makefile for mipsel-linux
#This Makefile is used to build the cross-compiled parts of mps project

CC = mipsel-linux-gcc 
CCFLAGS = -ansi -pedantic -Wall -c
AS = mipsel-linux-as -KPIC 
LD = mipsel-linux-ld


# Main target

all: bios.rom.mps coreboot.rom.mps tapeboot.rom.mps libmps.o crtso.o


# generic kernel startup function 

crtso.o: crtso.s 
	$(AS) crtso.s -o crtso.o

# kernel support library

libmps.o: libmps.s
	$(AS) libmps.s -o libmps.o


# bios target

bios.rom.mps: bios
	mps-elf2mps -b bios

bios: bios.s
	$(AS) bios.s -o bios


# coreboot target
coreboot.rom.mps: coreboot
	mps-elf2mps -b coreboot

coreboot: coreboot.s
	$(AS) coreboot.s -o coreboot

# tapeboot target
tapeboot.rom.mps: tapeboot
	mps-elf2mps -b tapeboot

tapeboot: tapeboot.s
	$(AS) tapeboot.s -o tapeboot


clean: 
	-rm bios
	-rm coreboot
	-rm tapeboot
	-rm *.o 

distclean: clean
	-rm *.rom.mps
