1# 2# $FreeBSD$ 3# 4# Makefile for the FreeBSD specific LibUSB 2.0 5# 6 7LIB= usb 8SHLIB_MAJOR= 3 9SHLIB_MINOR= 0 10SRCS= libusb20.c 11SRCS+= libusb20_desc.c 12SRCS+= libusb20_ugen20.c 13INCS+= libusb20.h 14INCS+= libusb20_desc.h 15MAN= libusb.3 libusb20.3 16MKLINT= no 17NOGCCERROR= 18PTHREAD_LIBS?= -lpthread 19 20WARNS?= 2 21 22DPADD= ${LIBPTHREAD} 23LDADD= ${PTHREAD_LIBS} 24 25MLINKS+= libusb.3 usb.3 26 27# libusb 0.1 compat 28INCS+= usb.h 29SRCS+= libusb01.c 30 31# libusb 1.0 compat 32INCS+= libusb.h 33SRCS+= libusb10.c 34SRCS+= libusb10_desc.c 35SRCS+= libusb10_io.c 36 37.if defined(COMPAT_32BIT) 38CFLAGS+= -DCOMPAT_32BIT 39.endif 40 41.ifndef COMPAT_32BIT 42beforeinstall: 43 ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ 44 ${.CURDIR}/libusb-0.1.pc ${DESTDIR}${LIBDATADIR}/pkgconfig 45 ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ 46 ${.CURDIR}/libusb-1.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig 47 ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ 48 ${.CURDIR}/libusb-2.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig 49.endif 50 51# 52# Cross platform support 53# 54# Examples: 55# make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h 56# make COMPAT_32BIT=YES \ 57# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ 58# DEBUG_FLAGS="-g" 59# 60# From Ubuntu 10.04: 61# freebsd-make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ 62# PTHREAD_LIBS="-lpthread -lrt" 63# freebsd-make COMPAT32_BIT=YES \ 64# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ 65# PTHREAD_LIBS="-lpthread -lrt" 66# 67# 68.if defined(LIBUSB_GLOBAL_INCLUDE_FILE) 69CFLAGS+= -DLIBUSB_GLOBAL_INCLUDE_FILE=\"${LIBUSB_GLOBAL_INCLUDE_FILE}\" 70CFLAGS+= -DUSB_GLOBAL_INCLUDE_FILE=\"${LIBUSB_GLOBAL_INCLUDE_FILE}\" 71CFLAGS+= -I ../../sys 72.endif 73 74.include <bsd.lib.mk> 75 76# LibUSB v1.0 77MLINKS += libusb.3 libusb_init.3 78MLINKS += libusb.3 libusb_exit.3 79MLINKS += libusb.3 libusb_strerror.3 80MLINKS += libusb.3 libusb_error_name.3 81MLINKS += libusb.3 libusb_set_debug.3 82MLINKS += libusb.3 libusb_get_device_list.3 83MLINKS += libusb.3 libusb_free_device_list.3 84MLINKS += libusb.3 libusb_get_bus_number.3 85MLINKS += libusb.3 libusb_get_device_address.3 86MLINKS += libusb.3 libusb_get_device_speed.3 87MLINKS += libusb.3 libusb_get_max_packet_size.3 88MLINKS += libusb.3 libusb_get_max_iso_packet_size.3 89MLINKS += libusb.3 libusb_ref_device.3 90MLINKS += libusb.3 libusb_unref_device.3 91MLINKS += libusb.3 libusb_open.3 92MLINKS += libusb.3 libusb_open_device_with_vid_pid.3 93MLINKS += libusb.3 libusb_close.3 94MLINKS += libusb.3 libusb_get_device.3 95MLINKS += libusb.3 libusb_get_configuration.3 96MLINKS += libusb.3 libusb_set_configuration.3 97MLINKS += libusb.3 libusb_claim_interface.3 98MLINKS += libusb.3 libusb_release_interface.3 99MLINKS += libusb.3 libusb_set_interface_alt_setting.3 100MLINKS += libusb.3 libusb_clear_halt.3 101MLINKS += libusb.3 libusb_reset_device.3 102MLINKS += libusb.3 libusb_check_connected.3 103MLINKS += libusb.3 libusb_kernel_driver_active.3 104MLINKS += libusb.3 libusb_get_driver.3 105MLINKS += libusb.3 libusb_get_driver_np.3 106MLINKS += libusb.3 libusb_detach_kernel_driver.3 107MLINKS += libusb.3 libusb_detach_kernel_driver_np.3 108MLINKS += libusb.3 libusb_attach_kernel_driver.3 109MLINKS += libusb.3 libusb_get_device_descriptor.3 110MLINKS += libusb.3 libusb_get_active_config_descriptor.3 111MLINKS += libusb.3 libusb_get_config_descriptor.3 112MLINKS += libusb.3 libusb_get_config_descriptor_by_value.3 113MLINKS += libusb.3 libusb_free_config_descriptor.3 114MLINKS += libusb.3 libusb_get_string_descriptor.3 115MLINKS += libusb.3 libusb_get_string_descriptor_ascii.3 116MLINKS += libusb.3 libusb_parse_ss_endpoint_comp.3 117MLINKS += libusb.3 libusb_free_ss_endpoint_comp.3 118MLINKS += libusb.3 libusb_parse_bos_descriptor.3 119MLINKS += libusb.3 libusb_free_bos_descriptor.3 120MLINKS += libusb.3 libusb_alloc_transfer.3 121MLINKS += libusb.3 libusb_free_transfer.3 122MLINKS += libusb.3 libusb_submit_transfer.3 123MLINKS += libusb.3 libusb_cancel_transfer.3 124MLINKS += libusb.3 libusb_control_transfer.3 125MLINKS += libusb.3 libusb_bulk_transfer.3 126MLINKS += libusb.3 libusb_interrupt_transfer.3 127MLINKS += libusb.3 libusb_try_lock_events.3 128MLINKS += libusb.3 libusb_lock_events.3 129MLINKS += libusb.3 libusb_unlock_events.3 130MLINKS += libusb.3 libusb_event_handling_ok.3 131MLINKS += libusb.3 libusb_event_handler_active.3 132MLINKS += libusb.3 libusb_lock_event_waiters.3 133MLINKS += libusb.3 libusb_unlock_event_waiters.3 134MLINKS += libusb.3 libusb_wait_for_event.3 135MLINKS += libusb.3 libusb_handle_events_timeout_completed.3 136MLINKS += libusb.3 libusb_handle_events_completed.3 137MLINKS += libusb.3 libusb_handle_events_timeout.3 138MLINKS += libusb.3 libusb_handle_events.3 139MLINKS += libusb.3 libusb_handle_events_locked.3 140MLINKS += libusb.3 libusb_get_next_timeout.3 141MLINKS += libusb.3 libusb_set_pollfd_notifiers.3 142MLINKS += libusb.3 libusb_get_pollfds.3 143 144# LibUSB v0.1 145MLINKS += libusb.3 usb_open.3 146MLINKS += libusb.3 usb_close.3 147MLINKS += libusb.3 usb_get_string.3 148MLINKS += libusb.3 usb_get_string_simple.3 149MLINKS += libusb.3 usb_get_descriptor_by_endpoint.3 150MLINKS += libusb.3 usb_get_descriptor.3 151MLINKS += libusb.3 usb_parse_descriptor.3 152MLINKS += libusb.3 usb_parse_configuration.3 153MLINKS += libusb.3 usb_destroy_configuration.3 154MLINKS += libusb.3 usb_fetch_and_parse_descriptors.3 155MLINKS += libusb.3 usb_bulk_write.3 156MLINKS += libusb.3 usb_bulk_read.3 157MLINKS += libusb.3 usb_interrupt_write.3 158MLINKS += libusb.3 usb_interrupt_read.3 159MLINKS += libusb.3 usb_control_msg.3 160MLINKS += libusb.3 usb_set_configuration.3 161MLINKS += libusb.3 usb_claim_interface.3 162MLINKS += libusb.3 usb_release_interface.3 163MLINKS += libusb.3 usb_set_altinterface.3 164MLINKS += libusb.3 usb_resetep.3 165MLINKS += libusb.3 usb_clear_halt.3 166MLINKS += libusb.3 usb_reset.3 167MLINKS += libusb.3 usb_strerror.3 168MLINKS += libusb.3 usb_init.3 169MLINKS += libusb.3 usb_set_debug.3 170MLINKS += libusb.3 usb_find_busses.3 171MLINKS += libusb.3 usb_find_devices.3 172MLINKS += libusb.3 usb_device.3 173MLINKS += libusb.3 usb_get_busses.3 174MLINKS += libusb.3 usb_check_connected.3 175 176# LibUSB v2.0 177MLINKS += libusb20.3 libusb20_tr_close.3 178MLINKS += libusb20.3 libusb20_tr_open.3 179MLINKS += libusb20.3 libusb20_tr_get_pointer.3 180MLINKS += libusb20.3 libusb20_tr_get_time_complete.3 181MLINKS += libusb20.3 libusb20_tr_get_actual_frames.3 182MLINKS += libusb20.3 libusb20_tr_get_actual_length.3 183MLINKS += libusb20.3 libusb20_tr_get_max_frames.3 184MLINKS += libusb20.3 libusb20_tr_get_max_packet_length.3 185MLINKS += libusb20.3 libusb20_tr_get_max_total_length.3 186MLINKS += libusb20.3 libusb20_tr_get_status.3 187MLINKS += libusb20.3 libusb20_tr_pending.3 188MLINKS += libusb20.3 libusb20_tr_callback_wrapper.3 189MLINKS += libusb20.3 libusb20_tr_clear_stall_sync.3 190MLINKS += libusb20.3 libusb20_tr_drain.3 191MLINKS += libusb20.3 libusb20_tr_set_buffer.3 192MLINKS += libusb20.3 libusb20_tr_set_callback.3 193MLINKS += libusb20.3 libusb20_tr_set_flags.3 194MLINKS += libusb20.3 libusb20_tr_get_length.3 195MLINKS += libusb20.3 libusb20_tr_set_length.3 196MLINKS += libusb20.3 libusb20_tr_set_priv_sc0.3 197MLINKS += libusb20.3 libusb20_tr_set_priv_sc1.3 198MLINKS += libusb20.3 libusb20_tr_set_timeout.3 199MLINKS += libusb20.3 libusb20_tr_set_total_frames.3 200MLINKS += libusb20.3 libusb20_tr_setup_bulk.3 201MLINKS += libusb20.3 libusb20_tr_setup_control.3 202MLINKS += libusb20.3 libusb20_tr_setup_intr.3 203MLINKS += libusb20.3 libusb20_tr_setup_isoc.3 204MLINKS += libusb20.3 libusb20_tr_bulk_intr_sync.3 205MLINKS += libusb20.3 libusb20_tr_start.3 206MLINKS += libusb20.3 libusb20_tr_stop.3 207MLINKS += libusb20.3 libusb20_tr_submit.3 208MLINKS += libusb20.3 libusb20_tr_get_priv_sc0.3 209MLINKS += libusb20.3 libusb20_tr_get_priv_sc1.3 210MLINKS += libusb20.3 libusb20_dev_get_backend_name.3 211MLINKS += libusb20.3 libusb20_dev_get_info.3 212MLINKS += libusb20.3 libusb20_dev_get_iface_desc.3 213MLINKS += libusb20.3 libusb20_dev_get_desc.3 214MLINKS += libusb20.3 libusb20_dev_close.3 215MLINKS += libusb20.3 libusb20_dev_detach_kernel_driver.3 216MLINKS += libusb20.3 libusb20_dev_set_config_index.3 217MLINKS += libusb20.3 libusb20_dev_get_debug.3 218MLINKS += libusb20.3 libusb20_dev_get_fd.3 219MLINKS += libusb20.3 libusb20_dev_kernel_driver_active.3 220MLINKS += libusb20.3 libusb20_dev_open.3 221MLINKS += libusb20.3 libusb20_dev_process.3 222MLINKS += libusb20.3 libusb20_dev_request_sync.3 223MLINKS += libusb20.3 libusb20_dev_req_string_sync.3 224MLINKS += libusb20.3 libusb20_dev_req_string_simple_sync.3 225MLINKS += libusb20.3 libusb20_dev_reset.3 226MLINKS += libusb20.3 libusb20_dev_check_connected.3 227MLINKS += libusb20.3 libusb20_dev_set_power_mode.3 228MLINKS += libusb20.3 libusb20_dev_get_power_mode.3 229MLINKS += libusb20.3 libusb20_dev_get_port_path.3 230MLINKS += libusb20.3 libusb20_dev_get_power_usage.3 231MLINKS += libusb20.3 libusb20_dev_set_alt_index.3 232MLINKS += libusb20.3 libusb20_dev_get_device_desc.3 233MLINKS += libusb20.3 libusb20_dev_alloc_config.3 234MLINKS += libusb20.3 libusb20_dev_alloc.3 235MLINKS += libusb20.3 libusb20_dev_get_address.3 236MLINKS += libusb20.3 libusb20_dev_get_parent_address.3 237MLINKS += libusb20.3 libusb20_dev_get_parent_port.3 238MLINKS += libusb20.3 libusb20_dev_get_bus_number.3 239MLINKS += libusb20.3 libusb20_dev_get_mode.3 240MLINKS += libusb20.3 libusb20_dev_get_speed.3 241MLINKS += libusb20.3 libusb20_dev_get_config_index.3 242MLINKS += libusb20.3 libusb20_dev_free.3 243MLINKS += libusb20.3 libusb20_dev_set_debug.3 244MLINKS += libusb20.3 libusb20_dev_wait_process.3 245MLINKS += libusb20.3 libusb20_be_get_template.3 246MLINKS += libusb20.3 libusb20_be_set_template.3 247MLINKS += libusb20.3 libusb20_be_get_dev_quirk.3 248MLINKS += libusb20.3 libusb20_be_get_quirk_name.3 249MLINKS += libusb20.3 libusb20_be_add_dev_quirk.3 250MLINKS += libusb20.3 libusb20_be_remove_dev_quirk.3 251MLINKS += libusb20.3 libusb20_be_alloc_default.3 252MLINKS += libusb20.3 libusb20_be_device_foreach.3 253MLINKS += libusb20.3 libusb20_be_dequeue_device.3 254MLINKS += libusb20.3 libusb20_be_enqueue_device.3 255MLINKS += libusb20.3 libusb20_be_free.3 256MLINKS += libusb20.3 libusb20_me_get_1.3 257MLINKS += libusb20.3 libusb20_me_get_2.3 258MLINKS += libusb20.3 libusb20_me_encode.3 259MLINKS += libusb20.3 libusb20_me_decode.3 260MLINKS += libusb20.3 libusb20_desc_foreach.3 261MLINKS += libusb20.3 libusb20_strerror.3 262MLINKS += libusb20.3 libusb20_error_name.3 263