|
| 1 | +AUTOMAKE_OPTIONS = subdir-objects |
| 2 | + |
| 3 | +AM_CFLAGS += -fvisibility=hidden $(THREAD_CFLAGS) |
| 4 | +AM_CXXFLAGS += -fvisibility=hidden $(THREAD_CFLAGS) |
| 5 | + |
1 | 6 | lib_LTLIBRARIES = libusb-1.0.la
|
2 | 7 |
|
3 |
| -LINUX_USBFS_SRC = os/linux_usbfs.c |
4 |
| -DARWIN_USB_SRC = os/darwin_usb.c |
5 |
| -OPENBSD_USB_SRC = os/openbsd_usb.c |
6 |
| -WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc \ |
7 |
| - libusb-1.0.def |
| 8 | +POSIX_PLATFORM_SRC = os/events_posix.h os/events_posix.c \ |
| 9 | + os/threads_posix.h os/threads_posix.c |
| 10 | +WINDOWS_PLATFORM_SRC = os/events_windows.h os/events_windows.c \ |
| 11 | + os/threads_windows.h os/threads_windows.c |
| 12 | + |
| 13 | +if PLATFORM_POSIX |
| 14 | +PLATFORM_SRC = $(POSIX_PLATFORM_SRC) |
| 15 | +else |
| 16 | +PLATFORM_SRC = $(WINDOWS_PLATFORM_SRC) |
| 17 | +endif |
| 18 | + |
| 19 | +OS_DARWIN_SRC = os/darwin_usb.h os/darwin_usb.c |
| 20 | +OS_HAIKU_SRC = os/haiku_usb.h os/haiku_usb_backend.cpp \ |
| 21 | + os/haiku_pollfs.cpp os/haiku_usb_raw.h os/haiku_usb_raw.cpp |
| 22 | +OS_LINUX_SRC = os/linux_usbfs.h os/linux_usbfs.c |
| 23 | +OS_EMSCRIPTEN_SRC = os/emscripten_webusb.cpp |
| 24 | +OS_NETBSD_SRC = os/netbsd_usb.c |
| 25 | +OS_NULL_SRC = os/null_usb.c |
| 26 | +OS_OPENBSD_SRC = os/openbsd_usb.c |
| 27 | +OS_SUNOS_SRC = os/sunos_usb.h os/sunos_usb.c |
| 28 | +OS_WINDOWS_SRC = libusb-1.0.def libusb-1.0.rc \ |
| 29 | + os/windows_common.h os/windows_common.c \ |
| 30 | + os/windows_usbdk.h os/windows_usbdk.c \ |
| 31 | + os/windows_winusb.h os/windows_winusb.c |
8 | 32 |
|
9 |
| -EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \ |
10 |
| - $(WINDOWS_USB_SRC) os/threads_posix.c os/threads_windows.c |
| 33 | +if OS_DARWIN |
| 34 | +OS_SRC = $(OS_DARWIN_SRC) |
| 35 | +endif |
| 36 | + |
| 37 | +noinst_LTLIBRARIES = |
| 38 | + |
| 39 | +if OS_HAIKU |
| 40 | +noinst_LTLIBRARIES += libusb_haiku.la |
| 41 | +libusb_haiku_la_SOURCES = $(OS_HAIKU_SRC) |
| 42 | +libusb_1_0_la_LIBADD = libusb_haiku.la |
| 43 | +endif |
11 | 44 |
|
12 | 45 | if OS_LINUX
|
13 |
| -OS_SRC = $(LINUX_USBFS_SRC) |
| 46 | +OS_SRC = $(OS_LINUX_SRC) |
| 47 | +if USE_UDEV |
| 48 | +OS_SRC += os/linux_udev.c |
| 49 | +else |
| 50 | +OS_SRC += os/linux_netlink.c |
| 51 | +endif |
14 | 52 | endif
|
15 | 53 |
|
16 |
| -if OS_DARWIN |
17 |
| -OS_SRC = $(DARWIN_USB_SRC) |
18 |
| -AM_CFLAGS_EXT = -no-cpp-precomp |
| 54 | +if OS_EMSCRIPTEN |
| 55 | +noinst_LTLIBRARIES += libusb_emscripten.la |
| 56 | +libusb_emscripten_la_SOURCES = $(OS_EMSCRIPTEN_SRC) |
| 57 | +AM_CXXFLAGS += -std=c++20 |
| 58 | +libusb_1_0_la_LIBADD = libusb_emscripten.la |
| 59 | +endif |
| 60 | + |
| 61 | +if OS_NETBSD |
| 62 | +OS_SRC = $(OS_NETBSD_SRC) |
| 63 | +endif |
| 64 | + |
| 65 | +if OS_NULL |
| 66 | +OS_SRC = $(OS_NULL_SRC) |
19 | 67 | endif
|
20 | 68 |
|
21 | 69 | if OS_OPENBSD
|
22 |
| -OS_SRC = $(OPENBSD_USB_SRC) |
| 70 | +OS_SRC = $(OS_OPENBSD_SRC) |
| 71 | +endif |
| 72 | + |
| 73 | +if OS_SUNOS |
| 74 | +OS_SRC = $(OS_SUNOS_SRC) |
23 | 75 | endif
|
24 | 76 |
|
25 | 77 | if OS_WINDOWS
|
26 |
| -OS_SRC = $(WINDOWS_USB_SRC) |
| 78 | +OS_SRC = $(OS_WINDOWS_SRC) |
27 | 79 |
|
28 |
| -.rc.lo: |
29 |
| - $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@ |
| 80 | +include Makefile.am.extra |
30 | 81 |
|
31 |
| -libusb-1.0.rc: version.h |
32 |
| -endif |
| 82 | +# Dependencies for compiling libusb-1.0.lo from libusb-1.0.rc |
| 83 | +-include ./$(DEPDIR)/libusb-1.0.Plo |
33 | 84 |
|
34 |
| -if THREADS_POSIX |
35 |
| -THREADS_SRC = os/threads_posix.h os/threads_posix.c |
36 |
| -else |
37 |
| -THREADS_SRC = os/threads_windows.h os/threads_windows.c |
| 85 | +if CREATE_IMPORT_LIB |
| 86 | +all-local: .libs/libusb-1.0.dll.a |
| 87 | +# Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged |
| 88 | +.libs/libusb-1.0.dll.a: libusb-1.0.def libusb-1.0.la |
| 89 | + $(AM_V_DLLTOOL)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $< --dllname libusb-1.0.dll --output-lib $@ |
| 90 | +endif |
38 | 91 | endif
|
39 | 92 |
|
40 |
| -libusb_1_0_la_CFLAGS = $(AM_CFLAGS) \ |
41 |
| - -DLIBUSB_DESCRIBE=\"`git --git-dir "$(top_srcdir)/.git" describe --tags 2>/dev/null`\" |
42 |
| -libusb_1_0_la_LDFLAGS = $(LTLDFLAGS) |
43 |
| -libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC) \ |
44 |
| - os/linux_usbfs.h os/darwin_usb.h os/windows_usb.h \ |
45 |
| - $(THREADS_SRC) \ |
46 |
| - os/poll_posix.h os/poll_windows.h |
| 93 | +libusb_1_0_la_LDFLAGS = $(LT_LDFLAGS) $(EXTRA_LDFLAGS) |
| 94 | +libusb_1_0_la_SOURCES = libusbi.h version.h version_nano.h \ |
| 95 | + core.c descriptor.c hotplug.c io.c strerror.c sync.c \ |
| 96 | + $(PLATFORM_SRC) $(OS_SRC) |
47 | 97 |
|
48 |
| -hdrdir = $(includedir)/libusb-1.0 |
49 |
| -hdr_HEADERS = libusb.h |
| 98 | +pkginclude_HEADERS = libusb.h |
0 commit comments