Windows: Fix wIndex in setup packet for config descriptor request
[platform/upstream/libusb.git] / libusb / Makefile.am
1 all: libusb-1.0.la libusb-1.0.dll
2
3 AUTOMAKE_OPTIONS = subdir-objects
4
5 lib_LTLIBRARIES = libusb-1.0.la
6
7 POSIX_POLL_SRC = os/poll_posix.c
8 LINUX_USBFS_SRC = os/linux_usbfs.c
9 DARWIN_USB_SRC = os/darwin_usb.c
10 OPENBSD_USB_SRC = os/openbsd_usb.c
11 NETBSD_USB_SRC = os/netbsd_usb.c
12 WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc libusb-1.0.def
13 WINCE_USB_SRC = os/wince_usb.c os/wince_usb.h
14
15 DIST_SUBDIRS = 
16
17 EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \
18         $(NETBSD_USB_SRC) $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \
19         $(POSIX_POLL_SRC) \
20         os/threads_posix.c os/threads_windows.c \
21         os/linux_udev.c os/linux_netlink.c
22
23 dist-hook:
24         -cp -r os/haiku $(distdir)/os/haiku
25
26 if OS_LINUX
27
28 if USE_UDEV
29 OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
30         os/linux_udev.c
31 else
32 OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
33         os/linux_netlink.c
34 endif
35
36 endif
37
38 if OS_DARWIN
39 OS_SRC = $(DARWIN_USB_SRC) $(POSIX_POLL_SRC)
40 AM_CFLAGS_EXT = -no-cpp-precomp
41 endif
42
43 if OS_OPENBSD
44 OS_SRC = $(OPENBSD_USB_SRC) $(POSIX_POLL_SRC)
45 endif
46
47 if OS_NETBSD
48 OS_SRC = $(NETBSD_USB_SRC) $(POSIX_POLL_SRC)
49 endif
50
51 if OS_HAIKU
52 OS_SRC = $(POSIX_POLL_SRC)
53 SUBDIRS = os/haiku
54 endif
55
56 if OS_WINDOWS
57 OS_SRC = $(WINDOWS_USB_SRC)
58
59 .rc.lo:
60         $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@
61
62 libusb-1.0.rc: version.h version_nano.h
63 endif
64
65 libusb-1.0.dll: libusb-1.0.def libusb-1.0.la
66 if CREATE_IMPORT_LIB
67 # Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged
68         $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a
69 endif
70
71 if THREADS_POSIX
72 THREADS_SRC = os/threads_posix.h os/threads_posix.c
73 else
74 THREADS_SRC = os/threads_windows.h os/threads_windows.c
75 endif
76
77 libusb_1_0_la_CFLAGS = $(AM_CFLAGS)
78 libusb_1_0_la_LDFLAGS = $(LTLDFLAGS)
79 libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c strerror.c sync.c \
80         os/linux_usbfs.h os/darwin_usb.h os/windows_usb.h os/windows_common.h \
81         hotplug.h hotplug.c $(THREADS_SRC) $(OS_SRC) \
82         os/poll_posix.h os/poll_windows.h
83
84 if OS_HAIKU
85 libusb_1_0_la_LIBADD = os/haiku/libhaikuusb.la
86 endif
87
88 hdrdir = $(includedir)/libusb-1.0
89 hdr_HEADERS = libusb.h