xref: /btstack/port/libusb/Makefile (revision f07246c408fa7da16cb0e3a3151ad576544aa3cb)
18caefee3SMatthias Ringwald# Makefile for libusb based examples
2f67eb7c2SMatthias RingwaldBTSTACK_ROOT ?= ../..
38caefee3SMatthias Ringwald
47435ec7bSMatthias RingwaldCORE += main.c btstack_stdin_posix.c btstack_tlv_posix.c hci_dump_posix_fs.c
58caefee3SMatthias Ringwald
66f122aa3SMatthias RingwaldCOMMON += hci_transport_h2_libusb.c btstack_run_loop_posix.c le_device_db_tlv.c btstack_link_key_db_tlv.c wav_util.c btstack_network_posix.c
7*f07246c4SMatthias RingwaldCOMMON += btstack_audio_portaudio.c btstack_chipset_zephyr.c btstack_chipset_realtek.c rijndael.c btstack_signal.c
88caefee3SMatthias Ringwald
9bcf00d8fSMatthias Ringwaldinclude ${BTSTACK_ROOT}/example/Makefile.inc
108caefee3SMatthias Ringwald
119d30a519SMatthias RingwaldCFLAGS  += -g -std=c99 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wunused-parameter -Wredundant-decls -Wsign-compare -Wswitch-default
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 \
22f9563b89SMatthias Ringwald		  -I${BTSTACK_ROOT}/3rd-party/tinydir \
237cdc89a5SMatthias Ringwald		  -I${BTSTACK_ROOT}/3rd-party/rijndael \
24df9a25acSMatthias Ringwald		  -I${BTSTACK_ROOT}/chipset/realtek \
25f9563b89SMatthias Ringwald		  -I${BTSTACK_ROOT}/chipset/zephyr
263edc84c5SMatthias Ringwald
277cdc89a5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/rijndael
283edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/embedded
29dd9e275cSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/posix
30ff964d8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/libusb
31cd5e24b3SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/chipset/csr
32df9a25acSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/chipset/realtek
33f9563b89SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/chipset/zephyr
348caefee3SMatthias Ringwald
358caefee3SMatthias Ringwald# use pkg-config
368caefee3SMatthias RingwaldCFLAGS  += $(shell pkg-config libusb-1.0 --cflags)
378caefee3SMatthias RingwaldLDFLAGS += $(shell pkg-config libusb-1.0 --libs)
388caefee3SMatthias Ringwald
39f11fd9a9SMatthias Ringwald# add pthread for ctrl-c signal handler
40f11fd9a9SMatthias RingwaldLDFLAGS += -lpthread
41f11fd9a9SMatthias Ringwald
42bdc352b1SMatthias RingwaldEXAMPLES = ${EXAMPLES_GENERAL} ${EXAMPLES_CLASSIC_ONLY} ${EXAMPLES_LE_ONLY} ${EXAMPLES_DUAL_MODE}
4397dc5e69SMatthias RingwaldEXAMPLES += pan_lwip_http_server
44cd5e24b3SMatthias RingwaldEXAMPLES += csr_set_bd_addr
45cd5e24b3SMatthias Ringwald
46cd5e24b3SMatthias Ringwaldcsr_set_bd_addr: ${CORE_OBJ} ${COMMON_OBJ} btstack_chipset_csr.o csr_set_bd_addr.o
47cd5e24b3SMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
48cd5e24b3SMatthias Ringwald
49185c8cd4SMatthias Ringwald# use pkg-config for portaudio
507d94e05fSMatthias Ringwald# CFLAGS  += $(shell pkg-config portaudio-2.0 --cflags) -DHAVE_PORTAUDIO
517d94e05fSMatthias Ringwald# LDFLAGS += $(shell pkg-config portaudio-2.0 --libs)
52185c8cd4SMatthias Ringwald
53037db388SMatthias Ringwaldclean_src:
54037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/src/*.o
55037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/src/classic/*.o
56037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/src/ble/*.o
57037db388SMatthias Ringwald	rm -rf * ${BTSTACK_ROOT}/platform/embedded/*.o
58037db388SMatthias Ringwald
590e537d1eSMatthias Ringwaldall: ${EXAMPLES}
60037db388SMatthias Ringwald
61