xref: /btstack/port/libusb/Makefile (revision cd5e24b3fa08fbae5967385193ef2e0902564d1d)
18caefee3SMatthias Ringwald# Makefile for libusb based examples
28caefee3SMatthias RingwaldBTSTACK_ROOT = ../..
38caefee3SMatthias Ringwald
459bdfe96SMatthias RingwaldCORE += main.c btstack_stdin_posix.c btstack_tlv_posix.c
58caefee3SMatthias Ringwald
6a7473022SMatthias RingwaldCOMMON  += hci_transport_h2_libusb.c btstack_run_loop_posix.c le_device_db_fs.c btstack_link_key_db_fs.c wav_util.c btstack_network_posix.c
78caefee3SMatthias Ringwald
8bcf00d8fSMatthias Ringwaldinclude ${BTSTACK_ROOT}/example/Makefile.inc
98caefee3SMatthias Ringwald
10249d94cfSMatthias RingwaldCFLAGS  += -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Werror -Wunused-parameter -Wredundant-decls -Wsign-compare
118caefee3SMatthias Ringwald# CFLAGS += -Werror
128caefee3SMatthias Ringwald
13dd9e275cSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/platform/posix \
14d08566fbSMatthias Ringwald		  -I${BTSTACK_ROOT}/platform/embedded \
15d08566fbSMatthias Ringwald		  -I${BTSTACK_ROOT}/3rd-party/tinydir
163edc84c5SMatthias Ringwald
173edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/embedded
18dd9e275cSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/posix
19ff964d8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/libusb
20*cd5e24b3SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/chipset/csr
218caefee3SMatthias Ringwald
228caefee3SMatthias Ringwald# use pkg-config
238caefee3SMatthias RingwaldCFLAGS  += $(shell pkg-config libusb-1.0 --cflags)
248caefee3SMatthias RingwaldLDFLAGS += $(shell pkg-config libusb-1.0 --libs)
258caefee3SMatthias Ringwald
26*cd5e24b3SMatthias RingwaldEXAMPLES += csr_set_bd_addr
27*cd5e24b3SMatthias Ringwald
28*cd5e24b3SMatthias Ringwaldcsr_set_bd_addr: ${CORE_OBJ} ${COMMON_OBJ} btstack_chipset_csr.o csr_set_bd_addr.o
29*cd5e24b3SMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
30*cd5e24b3SMatthias Ringwald
31*cd5e24b3SMatthias Ringwald
32185c8cd4SMatthias Ringwald# use pkg-config for portaudio
339c874703SMilanka Ringwald# CFLAGS  += $(shell pkg-config portaudio-2.0 --cflags) -DHAVE_PORTAUDIO
349c874703SMilanka Ringwald# LDFLAGS += $(shell pkg-config portaudio-2.0 --libs)
3572c514e8SMilanka Ringwald
36185c8cd4SMatthias Ringwald# hard coded flags for portaudio in /usr/local/lib
37185c8cd4SMatthias Ringwald# CFLAGS  += -I/usr/local/include -DHAVE_PORTAUDIO
38185c8cd4SMatthias Ringwald# LDFLAGS += -L/sw/lib -lportaudio -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,Carbon
39185c8cd4SMatthias Ringwald
40037db388SMatthias Ringwaldclean_src:
41037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/src/*.o
42037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/src/classic/*.o
43037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/src/ble/*.o
44037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/platform/embedded/*.o
45037db388SMatthias Ringwald
460e537d1eSMatthias Ringwaldall: ${EXAMPLES}
47037db388SMatthias Ringwald
48