#######################################################################
#
# Makefile for libw.a build
# 
#######################################################################

# CC = powerpc-eabi-gcc 
# ARCHIVER = powerpc-eabi-ar
LCFLAGS = -O0  -c 

TOPDIR = ../../..
SYSTEMDIR = ../../../../../..
INCLUDEDIR = $(SYSTEMDIR)/include
INCLUDES = -I${TOPDIR}/include -I$(INCLUDEDIR)
# INCLUDES = -I$(TOPDIR)/include -I$(PROJDIR)/$(SYSTEMNAME)/include 
# LIBS = -L$(PROJDIR)/$(SYSTEMNAME)/lib
# INCLUDES = -I../../../ppc405_i/include -I../include
# LIBS = -L../../../ppc405_i/lib
LIBSYSCALL = ${TOPDIR}/libw.a

OBJS = libprocess.o libthread.o libsema.o libmsgq.o libshm.o libmem.o libmutex.o do_syscall.o do_syscall_asm.o

all : $(LIBSYSCALL)

$(LIBSYSCALL): $(OBJS)
	$(AR) -r ${LIBSYSCALL} $(OBJS)
	make clean

%.o:%.c
	$(CC) $(LCFLAGS)  $< $(INCLUDES)

%.o:%.s
	$(CC) -c $< 

clean:
	rm -f $(OBJS) 
