# Makefile for owcapi example program -- invoked separately from this directory
# $Id$

CFLAGS = -g -I@prefix@/include

OBJS = owcapiexample.o

all:	owcapiexample

ifeq "$(shell uname)" "Darwin"

# Compile-flags for MacOSX
DARWINLDFLAGS = -L@prefix@/lib -lowcapi -low @LIBUSB_LIBS@

owcapiexample: $(OBJS)
	gcc $(CFLAGS) -o $@ $(OBJS) $(DARWINLDFLAGS)

else

# Compile-flags for Linux and Cygwin
LDFLAGS = -L@prefix@/lib -Wl,--rpath -Wl,@prefix@/lib -lowcapi

owcapiexample: $(OBJS)
	gcc $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)

endif

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

clean:
	$(RM) -f owcapiexample *.o *~ .~ Makefile
