include ../../makevars

CFLAGS+= -I../include

SRCS=cjctapi.c cjt1.c cjio.c cjio_user.c

OBJS=$(SRCS:.c=.o)

HDRS=cj.h cjio.h cjio_user.h cjt1.h

all: libctapi-ecom.a

%.o: %.c
	$(CC) $(CFLAGS) -o $@ -c $^

libso: $(OBJS)
	ld -x --shared -o libctapi-ecom.so $(OBJS)

libctapi-ecom.a: $(OBJS)
	ar r $@ $(OBJS)
	-if test -s /bin/ranlib; then /bin/ranlib $@; \
	else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $@; \
	else exit 0; fi; fi

test: test.o libctapi-ecom.a
	$(CC) $(CFLAGS) -lusb -o $@ $^

clean:
	rm -f *.o *.a *.so test

