xref: /btstack/port/libusb/Makefile (revision 2ca8e4d94cef0a81bb14a4c0207e3a14b23ee4c8)
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
7b88bf5bfSMatthias RingwaldCOMMON += btstack_audio_portaudio.c
88caefee3SMatthias Ringwald
9bcf00d8fSMatthias Ringwaldinclude ${BTSTACK_ROOT}/example/Makefile.inc
108caefee3SMatthias Ringwald
113f0fce8cSMatthias RingwaldCFLAGS  += -g -std=c99 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wunused-parameter -Wredundant-decls -Wsign-compare
128caefee3SMatthias Ringwald# CFLAGS += -Werror
133f0fce8cSMatthias Ringwald# CFLAGS += -pedantic
143f0fce8cSMatthias Ringwald
153f0fce8cSMatthias Ringwald# only LLVM
163f0fce8cSMatthias Ringwald# CFLAGS += -Wnewline-eof
173f0fce8cSMatthias Ringwald# CFLAGS += -Wc11-extensions
183f0fce8cSMatthias Ringwald# CFLAGS += -Wgnu-empty-initializer
198caefee3SMatthias Ringwald
20dd9e275cSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/platform/posix \
21d08566fbSMatthias Ringwald		  -I${BTSTACK_ROOT}/platform/embedded \
22d08566fbSMatthias Ringwald		  -I${BTSTACK_ROOT}/3rd-party/tinydir
233edc84c5SMatthias Ringwald
243edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/embedded
25dd9e275cSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/posix
26ff964d8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/libusb
27cd5e24b3SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/chipset/csr
288caefee3SMatthias Ringwald
298caefee3SMatthias Ringwald# use pkg-config
308caefee3SMatthias RingwaldCFLAGS  += $(shell pkg-config libusb-1.0 --cflags)
318caefee3SMatthias RingwaldLDFLAGS += $(shell pkg-config libusb-1.0 --libs)
328caefee3SMatthias Ringwald
33cd5e24b3SMatthias RingwaldEXAMPLES += csr_set_bd_addr
34cd5e24b3SMatthias Ringwald
35cd5e24b3SMatthias Ringwaldcsr_set_bd_addr: ${CORE_OBJ} ${COMMON_OBJ} btstack_chipset_csr.o csr_set_bd_addr.o
36cd5e24b3SMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
37cd5e24b3SMatthias Ringwald
38cd5e24b3SMatthias Ringwald
39185c8cd4SMatthias Ringwald# use pkg-config for portaudio
40*2ca8e4d9SMatthias Ringwald# CFLAGS  += $(shell pkg-config portaudio-2.0 --cflags) -DHAVE_PORTAUDIO
41*2ca8e4d9SMatthias Ringwald# LDFLAGS += $(shell pkg-config portaudio-2.0 --libs)
4272c514e8SMilanka Ringwald
43185c8cd4SMatthias Ringwald# hard coded flags for portaudio in /usr/local/lib
44185c8cd4SMatthias Ringwald# CFLAGS  += -I/usr/local/include -DHAVE_PORTAUDIO
45185c8cd4SMatthias Ringwald# LDFLAGS += -L/sw/lib -lportaudio -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,Carbon
46185c8cd4SMatthias Ringwald
47037db388SMatthias Ringwaldclean_src:
48037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/src/*.o
49037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/src/classic/*.o
50037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/src/ble/*.o
51037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/platform/embedded/*.o
52037db388SMatthias Ringwald
530e537d1eSMatthias Ringwaldall: ${EXAMPLES}
54037db388SMatthias Ringwald
55