CC = sh-coff-gcc
AS = sh-coff-as
AR = sh-coff-ar

GCC = F:\PROGRA~1\kpit\GNUSHV~1\Sh-coff

LIBDIR  = .
OBJDIR  = .
SRCDIR  = .
CFLAGS  = -Wall -m2 -I$(GCC)\include\g++-v3
ASFLAGS =
ARFLAGS = rv

OBJS = $(OBJDIR)/cdc_reg.o $(OBJDIR)/cdc_sub.o $(OBJDIR)/cdc_cmn.o \
	$(OBJDIR)/cdc_drv.o $(OBJDIR)/cdc_scd.o $(OBJDIR)/cdc_dev.o \
	$(OBJDIR)/cdc_sel.o $(OBJDIR)/cdc_bif.o $(OBJDIR)/cdc_bio.o \
	$(OBJDIR)/cdc_cfs.o $(OBJDIR)/cdc_unk.o $(OBJDIR)/cdc_mdc.o \
	$(OBJDIR)/cdc_mst.o $(OBJDIR)/cdc_mwn.o $(OBJDIR)/cdc_mfb.o \
	$(OBJDIR)/cdc_mbu.o $(OBJDIR)/cdc_mls.o $(OBJDIR)/cdc_msb.o

TARGET = $(LIBDIR)/cdcrep.a

all: $(TARGET)

$(TARGET): $(OBJS)
	$(AR) $(ARFLAGS) $(_ARFLAGS) $@ $?

.SUFFIXES:
.SUFFIXES: .a .o .src .c

$(OBJDIR)/%.o: $(SRCDIR)/%.c
	$(CC) -c $(CFLAGS) $(_CFLAGS) -o $@ $<

$(OBJDIR)/%.o: $(SRCDIR)/%.src
	$(AS) $< $(ASFLAGS) $(_ASFLAGS) -o $@

clean:
	del *.o
