# $Id: Makefile,v 1.31 1998/03/19 23:40:20 kevine Exp $
include $(TOP)/src/Makefile.conf
#ABI=-n32
DITFLAG=-a
TOOLBIN=$(TOP)/bin
INCLUDE=-I$(TOP)/include
LIB=$(TOP)/lib64

CFLAGS= -OPT:unroll_times_max=0 $(USERCFLAGS)
ASFLAGS= $(USERASFLAGS)
LDFLAGS=$(USERLDFLAGS)
LIBS=$(USERLIBS)
CRT0=$(USERCRT0)
CRTS=$(LIB)/crtS.o

FAKETARGETS=  $(TESTTARGETS)
TARGETS=serial_test serial_test2 serial_test3 ex_reg ipc_test_client\
	ipc_test_server  tlb_test mem_test new_task l4_test \
	l4_test_child tt1 tt2 tt3
T0PROG=serial_test
T0OBJ=serial_test.o
T1PROG=serial_test2
T1OBJ=serial_test2.o
T2PROG=serial_test3
T2OBJ=serial_test3.o
EXPROG=ex_reg
EXOBJ=ex_reg.o
TLBPROG=tlb_test
TLBOBJ=tlb_test.o
ICPROG=ipc_test_client
ICOBJ=ipc_test_client.o ipc_test_client_asm.o ipc_test_timestamp.o
ISPROG=ipc_test_server
ISOBJ=ipc_test_server.o ipc_test_server_asm.o
MPROG=mem_test
MOBJ=mem_test.o
NTOBJ=new_task.o
NTPROG=new_task

L4TPROG=l4_test
L4TOBJ=l4_test.o
#L4TPROG=intr_test
#L4TOBJ=intr_test.o
L4TCPROG=l4_test_child
L4TCOBJ=l4_test_child.o

all: $(FAKETARGETS)

.s.o:
	$(AS) $(ASFLAGS) -o $*.o $*.s
.c.o:
	$(CC) $(CFLAGS) -c $*.c


ipc_test:  its itc nt

itc: $(ICOBJ)
	ld  $(LDFLAGS) -T `$(TOOLBIN)/dit -l ../kernel` -o $(ICPROG) $(CRTS)  $(ICOBJ) $(LIBS)
	$(TOOLBIN)/dit $(DITFLAG) $(ICPROG) ../kernel

its: $(ISOBJ)
	ld  $(LDFLAGS) -T `$(TOOLBIN)/dit -l ../kernel` -o $(ISPROG) $(CRTS)  $(ISOBJ) $(LIBS)
	$(TOOLBIN)/dit $(DITFLAG) $(ISPROG) ../kernel

nt: $(NTOBJ)
	ld  $(LDFLAGS) -T 0x80000 -o $(NTPROG) $(CRT0)  $(NTOBJ) $(LIBS)
	$(TOOLBIN)/dit -n -a $(NTPROG) ../kernel

l4_tester:  l4t l4tc test1 test2 test3

test1: tt1.o
	ld  $(LDFLAGS) -T 0x88000 -o tt1 $(CRT0)  tt1.o $(LIBS)
	$(TOOLBIN)/dit -n -a tt1 ../kernel

test2: tt2.o
	ld  $(LDFLAGS) -T 0x90000 -o tt2 $(CRT0)  tt2.o $(LIBS)
	$(TOOLBIN)/dit -n -a tt2 ../kernel

test3: tt3.o
	ld  $(LDFLAGS) -T 0x98000 -o tt3 $(CRT0)  tt3.o $(LIBS)
	$(TOOLBIN)/dit -n -a tt3 ../kernel


l4tc: $(L4TCOBJ)
	ld  $(LDFLAGS) -T 0x80000 -o $(L4TCPROG) $(CRT0)  $(L4TCOBJ) $(LIBS)
	$(TOOLBIN)/dit -n -a $(L4TCPROG) ../kernel


l4t: $(L4TOBJ)
	ld  $(LDFLAGS) -T `$(TOOLBIN)/dit -l ../kernel` -o $(L4TPROG) $(CRTS)  $(L4TOBJ) $(LIBS)
	$(TOOLBIN)/dit $(DITFLAG) $(L4TPROG) ../kernel



mem: $(MOBJ)
	ld  $(LDFLAGS) -T `$(TOOLBIN)/dit -l ../kernel` -o $(MPROG) $(CRT0)  $(MOBJ) $(LIBS)
	$(TOOLBIN)/dit $(DITFLAG) $(MPROG) ../kernel

t0: $(T0OBJ)
	ld  $(LDFLAGS) -T `$(TOOLBIN)/dit -l ../kernel` -o $(T0PROG) $(CRT0)  $(T0OBJ) $(LIBS)
	$(TOOLBIN)/dit $(DITFLAG) $(T0PROG) ../kernel

t1: $(T1OBJ)
	ld  $(LDFLAGS) -T `$(TOOLBIN)/dit -l ../kernel` -o $(T1PROG) $(CRT0)  $(T1OBJ) $(LIBS)
	$(TOOLBIN)/dit $(DITFLAG) $(T1PROG) ../kernel

t2: $(T2OBJ)
	ld  $(LDFLAGS) -T `$(TOOLBIN)/dit -l ../kernel` -o $(T2PROG) $(CRT0)  $(T2OBJ) $(LIBS)
	$(TOOLBIN)/dit $(DITFLAG) $(T2PROG) ../kernel

tlb: $(TLBOBJ)
	ld  $(LDFLAGS) -T `$(TOOLBIN)/dit -l ../kernel` -o $(TLBPROG) $(CRT0)  $(TLBOBJ) $(LIBS)
	$(TOOLBIN)/dit $(DITFLAG) $(TLBPROG) ../kernel

ex: $(EXOBJ)
	ld  $(LDFLAGS) -T `$(TOOLBIN)/dit -l ../kernel` -o $(EXPROG) $(CRT0)  $(EXOBJ) $(LIBS)
	$(TOOLBIN)/dit $(DITFLAG) $(EXPROG) ../kernel

mun:
	$(TOOLBIN)/dit $(DITFLAG) tmp/mungi ../kernel
	$(TOOLBIN)/dit -n $(DITFLAG) tmp/spare ../kernel
	$(TOOLBIN)/dit -n $(DITFLAG) tmp/test ../kernel


install:


clean:
	-rm *.o $(TARGETS)

realclean:
	-rm -f *.o $(TARGETS) *.bak *~
dep:
	-makedepend $(INCLUDE) *.s 
	-makedepend $(INCLUDE) *.c

# DO NOT DELETE

ex_reg.o: /home/kevine/Work/mipsL4/include/libc.h
ex_reg.o: /home/kevine/Work/mipsL4/include/assert.h
ex_reg.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
ex_reg.o: /home/kevine/Work/mipsL4/include/l4/types.h
ex_reg.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
intr_test.o: /home/kevine/Work/mipsL4/include/libc.h
intr_test.o: /home/kevine/Work/mipsL4/include/assert.h
intr_test.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
intr_test.o: /home/kevine/Work/mipsL4/include/l4/types.h
intr_test.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
intr_test.o: /home/kevine/Work/mipsL4/include/l4/sigma0.h
intr_test.o: /home/kevine/Work/mipsL4/include/kernel/machine.h
ipc_test_client.o: /home/kevine/Work/mipsL4/include/libc.h
ipc_test_client.o: /home/kevine/Work/mipsL4/include/assert.h
ipc_test_client.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
ipc_test_client.o: /home/kevine/Work/mipsL4/include/l4/types.h
ipc_test_client.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
ipc_test_client.o: /home/kevine/Work/mipsL4/include/l4/sigma0.h
ipc_test_server.o: /home/kevine/Work/mipsL4/include/libc.h
ipc_test_server.o: /home/kevine/Work/mipsL4/include/assert.h
ipc_test_server.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
ipc_test_server.o: /home/kevine/Work/mipsL4/include/l4/types.h
ipc_test_server.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
ipc_test_timestamp.o: /home/kevine/Work/mipsL4/include/string.h
ipc_test_timestamp.o: /home/kevine/Work/mipsL4/include/libc.h
ipc_test_timestamp.o: /home/kevine/Work/mipsL4/include/assert.h
ipc_test_timestamp.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
ipc_test_timestamp.o: /home/kevine/Work/mipsL4/include/l4/types.h
ipc_test_timestamp.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
ipc_test_timestamp.o: /home/kevine/Work/mipsL4/include/l4/sigma0.h
ipc_test_timestamp.o: /home/kevine/Work/mipsL4/include/kernel/machine.h
ipc_test_timestamp.o: /home/kevine/Work/mipsL4/include/kernel/gt64010a.h
l4_test.o: /home/kevine/Work/mipsL4/include/libc.h
l4_test.o: /home/kevine/Work/mipsL4/include/assert.h
l4_test.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
l4_test.o: /home/kevine/Work/mipsL4/include/l4/types.h
l4_test.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
l4_test.o: /home/kevine/Work/mipsL4/include/l4/sigma0.h
l4_test_child.o: /home/kevine/Work/mipsL4/include/libc.h
l4_test_child.o: /home/kevine/Work/mipsL4/include/assert.h
l4_test_child.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
l4_test_child.o: /home/kevine/Work/mipsL4/include/l4/types.h
l4_test_child.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
l4_test_child.o: /home/kevine/Work/mipsL4/include/l4/sigma0.h
mem_test.o: /home/kevine/Work/mipsL4/include/libc.h
mem_test.o: /home/kevine/Work/mipsL4/include/assert.h
mem_test.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
mem_test.o: /home/kevine/Work/mipsL4/include/l4/types.h
mem_test.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
serial_test.o: /home/kevine/Work/mipsL4/include/libc.h
serial_test.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
serial_test.o: /home/kevine/Work/mipsL4/include/l4/types.h
serial_test.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
serial_test2.o: /home/kevine/Work/mipsL4/include/libc.h
serial_test2.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
serial_test2.o: /home/kevine/Work/mipsL4/include/l4/types.h
serial_test2.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
serial_test3.o: /home/kevine/Work/mipsL4/include/libc.h
serial_test3.o: /home/kevine/Work/mipsL4/include/assert.h
serial_test3.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
serial_test3.o: /home/kevine/Work/mipsL4/include/l4/types.h
serial_test3.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
tlb_test.o: /home/kevine/Work/mipsL4/include/libc.h
tlb_test.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
tlb_test.o: /home/kevine/Work/mipsL4/include/l4/types.h
tlb_test.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
tt1.o: /home/kevine/Work/mipsL4/include/libc.h
tt1.o: /home/kevine/Work/mipsL4/include/assert.h
tt1.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
tt1.o: /home/kevine/Work/mipsL4/include/l4/types.h
tt1.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
tt1.o: /home/kevine/Work/mipsL4/include/l4/sigma0.h
tt2.o: /home/kevine/Work/mipsL4/include/libc.h
tt2.o: /home/kevine/Work/mipsL4/include/assert.h
tt2.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
tt2.o: /home/kevine/Work/mipsL4/include/l4/types.h
tt2.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
tt2.o: /home/kevine/Work/mipsL4/include/l4/sigma0.h
tt3.o: /home/kevine/Work/mipsL4/include/libc.h
tt3.o: /home/kevine/Work/mipsL4/include/assert.h
tt3.o: /home/kevine/Work/mipsL4/include/l4/ipc.h
tt3.o: /home/kevine/Work/mipsL4/include/l4/types.h
tt3.o: /home/kevine/Work/mipsL4/include/l4/syscalls.h
tt3.o: /home/kevine/Work/mipsL4/include/l4/sigma0.h
