## Process this file with automake to produce Makefile.in

# require automake 1.4
# gnu strictness chokes on README being autogenerated
AUTOMAKE_OPTIONS = 1.4 foreign

SUBDIRS = . tests doc

CFLAGS=

configincludedir = $(pkglibdir)/include

bin_SCRIPTS = libusb-config

EXTRA_DIST = LICENSE libusb.spec.in libusb.spec libusb-config.in README.in README INSTALL.libusb.in INSTALL.libusb
EXTRA_libusb_la_SOURCE = linux.c linux.h bsd.c darwin.c

lib_LTLIBRARIES = libusb.la

if LINUX_API
OS_SUPPORT = linux.c linux.h
else
if BSD_API
OS_SUPPORT = bsd.c
else
if DARWIN_API
OS_SUPPORT = darwin.c
CFLAGS_EXT = -no-cpp-precomp
LDADDS = -framework IOKit -framework CoreFoundation
else
OS_SUPPORT = 
endif
endif
endif

CFLAGS+=$(CFLAGS_EXT)

libusb_la_SOURCES = usb.c usbi.h error.c error.h descriptors.c $(OS_SUPPORT)

# Do not add usb.h to *_SOURCES, regardless of dependencies.
# It would be added to the dist tarball, which it shouldn't be.
nodist_include_HEADERS = usb.h

libusb_la_LDFLAGS = \
	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
	-release $(LT_RELEASE) \
	-export-dynamic \
	$(LDADDS)

.PHONY: files release snapshot

files:
	@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
	  echo $$p; \
	done

release:
	rm -rf .deps */.deps
	$(MAKE) distcheck

snapshot:
	$(MAKE) dist distdir=$(PACKAGE)-`date +"%Y%m%d"`

