xref: /btstack/port/libusb/Makefile (revision f07246c408fa7da16cb0e3a3151ad576544aa3cb)
1# Makefile for libusb based examples
2BTSTACK_ROOT ?= ../..
3
4CORE += main.c btstack_stdin_posix.c btstack_tlv_posix.c hci_dump_posix_fs.c
5
6COMMON += 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
7COMMON += btstack_audio_portaudio.c btstack_chipset_zephyr.c btstack_chipset_realtek.c rijndael.c btstack_signal.c
8
9include ${BTSTACK_ROOT}/example/Makefile.inc
10
11CFLAGS  += -g -std=c99 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wunused-parameter -Wredundant-decls -Wsign-compare -Wswitch-default
12# CFLAGS += -Werror
13# CFLAGS += -pedantic
14
15# only LLVM
16# CFLAGS += -Wnewline-eof
17# CFLAGS += -Wc11-extensions
18# CFLAGS += -Wgnu-empty-initializer
19
20CFLAGS += -I${BTSTACK_ROOT}/platform/posix    \
21		  -I${BTSTACK_ROOT}/platform/embedded \
22		  -I${BTSTACK_ROOT}/3rd-party/tinydir \
23		  -I${BTSTACK_ROOT}/3rd-party/rijndael \
24		  -I${BTSTACK_ROOT}/chipset/realtek \
25		  -I${BTSTACK_ROOT}/chipset/zephyr
26
27VPATH += ${BTSTACK_ROOT}/3rd-party/rijndael
28VPATH += ${BTSTACK_ROOT}/platform/embedded
29VPATH += ${BTSTACK_ROOT}/platform/posix
30VPATH += ${BTSTACK_ROOT}/platform/libusb
31VPATH += ${BTSTACK_ROOT}/chipset/csr
32VPATH += ${BTSTACK_ROOT}/chipset/realtek
33VPATH += ${BTSTACK_ROOT}/chipset/zephyr
34
35# use pkg-config
36CFLAGS  += $(shell pkg-config libusb-1.0 --cflags)
37LDFLAGS += $(shell pkg-config libusb-1.0 --libs)
38
39# add pthread for ctrl-c signal handler
40LDFLAGS += -lpthread
41
42EXAMPLES = ${EXAMPLES_GENERAL} ${EXAMPLES_CLASSIC_ONLY} ${EXAMPLES_LE_ONLY} ${EXAMPLES_DUAL_MODE}
43EXAMPLES += pan_lwip_http_server
44EXAMPLES += csr_set_bd_addr
45
46csr_set_bd_addr: ${CORE_OBJ} ${COMMON_OBJ} btstack_chipset_csr.o csr_set_bd_addr.o
47	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
48
49# use pkg-config for portaudio
50# CFLAGS  += $(shell pkg-config portaudio-2.0 --cflags) -DHAVE_PORTAUDIO
51# LDFLAGS += $(shell pkg-config portaudio-2.0 --libs)
52
53clean_src:
54	rm -rf * ${BTSTACK_ROOT}/src/*.o
55	rm -rf * ${BTSTACK_ROOT}/src/classic/*.o
56	rm -rf * ${BTSTACK_ROOT}/src/ble/*.o
57	rm -rf * ${BTSTACK_ROOT}/platform/embedded/*.o
58
59all: ${EXAMPLES}
60
61