CC = /usr/local/sh-tools/bin/sh-elf-gcc
AS = /usr/local/sh-tools/bin/sh-elf-as
LD = /usr/local/sh-tools/bin/sh-elf-ld
OBJCPY = /usr/local/sh-tools/bin/sh-elf-objcopy

NEWLIB_BASE=/usr/local/sh-tools/newlib/sh-elf
NEWLIB_INC = $(NEWLIB_BASE)/include
#NEWLIB_LIB = $(NEWLIB_BASE)/lib
GCC_VER = 4.4.0
GCC_LIB = /usr/local/sh-tools/lib/gcc/sh-elf/$(GCC_VER)

TARGET_SYSCALL_LIB_NAME = sh2a72623

NEWLIB_COMMON_INC = ../../../common/newlib_syscalls

all: syscalls.o target_syscalls.o
	$(AR) rcs ../../lib/lib$(TARGET_SYSCALL_LIB_NAME).a syscalls.o target_syscalls.o
target_syscalls.o: target_syscalls.c
	$(CC) -I$(NEWLIB_COMMON_INC) -c $< -I$(NEWLIB_INC) -o target_syscalls.o
syscalls.o: ../../../common/newlib_syscalls/syscalls.c ../../../common/newlib_syscalls/target_syscalls.h
	$(CC) -I$(NEWLIB_COMMON_INC) -I$(NEWLIB_INC) -c $< -o syscalls.o
clean:
	rm *.o
	rm -f ../../lib/lib$(TARGET_SYSCALL_LIB_NAME).a