xref: /btstack/port/daemon/src/Makefile.in (revision 71d91108d5de639939e7a25a1b077c91a9a45d6d)
13edc84c5SMatthias RingwaldBTSTACK_ROOT = ../../..
23edc84c5SMatthias Ringwald
33edc84c5SMatthias Ringwaldprefix = @prefix@
43edc84c5SMatthias Ringwald
53edc84c5SMatthias RingwaldCC = @CC@
63edc84c5SMatthias RingwaldLDFLAGS = @LDFLAGS@
73edc84c5SMatthias RingwaldCFLAGS = @CFLAGS@ \
82531c97eSMatthias Ringwald    -I $(BTSTACK_ROOT)/platform/daemon/src \
9dd9e275cSMatthias Ringwald    -I $(BTSTACK_ROOT)/platform/posix \
103edc84c5SMatthias Ringwald    -I $(BTSTACK_ROOT)/src \
113edc84c5SMatthias Ringwald    -I..
123edc84c5SMatthias RingwaldBTSTACK_LIB_LDFLAGS = @BTSTACK_LIB_LDFLAGS@
133edc84c5SMatthias RingwaldBTSTACK_LIB_EXTENSION = @BTSTACK_LIB_EXTENSION@
143edc84c5SMatthias RingwaldLIBUSB_CFLAGS = @LIBUSB_CFLAGS@
153edc84c5SMatthias RingwaldLIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
163edc84c5SMatthias Ringwald
172531c97eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/daemon/src
18f8d88472SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/corefoundation
19ff964d8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/libusb
20ff964d8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/posix
213edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src
223edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble
233edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/classic
243edc84c5SMatthias Ringwald
253edc84c5SMatthias Ringwaldremote_device_db_sources = @REMOTE_DEVICE_DB_SOURCES@
26528a4a3bSMatthias Ringwaldbtstack_run_loop_sources = @btstack_run_loop_SOURCES@
273edc84c5SMatthias Ringwaldusb_sources = @USB_SOURCES@
283edc84c5SMatthias Ringwald
293edc84c5SMatthias RingwaldlibBTstack_SOURCES =    \
303edc84c5SMatthias Ringwald    btstack.c           \
313edc84c5SMatthias Ringwald    socket_connection.c \
32f12924e0SMatthias Ringwald    hci_dump.c          \
3356042629SMatthias Ringwald    hci_cmd.c          \
34a8307d38SMatthias Ringwald    daemon_cmds.c       \
354fd23d47SMatthias Ringwald    btstack_linked_list.c    \
364ab92137SMatthias Ringwald    btstack_run_loop.c  \
373edc84c5SMatthias Ringwald    sdp_util.c          \
38e3f52bebSMatthias Ringwald    spp_server.c        \
39eb886013SMatthias Ringwald    btstack_util.c             \
40528a4a3bSMatthias Ringwald    $(btstack_run_loop_sources) \
413edc84c5SMatthias Ringwald
423edc84c5SMatthias RingwaldBTdaemon_SOURCES =      \
433edc84c5SMatthias Ringwald    $(libBTstack_SOURCES)       \
443edc84c5SMatthias Ringwald    $(usb_sources)              \
453edc84c5SMatthias Ringwald    $(remote_device_db_sources) \
4649232d5cSMatthias Ringwald    ad_parser.c                 \
4749232d5cSMatthias Ringwald    att_db.c                    \
4849232d5cSMatthias Ringwald    att_dispatch.c              \
4949232d5cSMatthias Ringwald    att_server.c                \
5049232d5cSMatthias Ringwald    bnep.c                      \
51b94c7d9dSMatthias Ringwald    btstack_crypto.c            \
5249232d5cSMatthias Ringwald    btstack_memory.c            \
5349232d5cSMatthias Ringwald    btstack_memory_pool.c       \
54e07b53a6SMatthias Ringwald    btstack_tlv.c               \
5549232d5cSMatthias Ringwald    btstack_uart_block_posix.c  \
5649232d5cSMatthias Ringwald    daemon.c                    \
5749232d5cSMatthias Ringwald    gatt_client.c               \
5849232d5cSMatthias Ringwald    hci.c                       \
5949232d5cSMatthias Ringwald    hci_dump.c                  \
6049232d5cSMatthias Ringwald    hci_transport_h4.c          \
6149232d5cSMatthias Ringwald    l2cap.c                     \
6249232d5cSMatthias Ringwald    l2cap_signaling.c           \
6349232d5cSMatthias Ringwald    le_device_db_memory.c       \
6449232d5cSMatthias Ringwald    rfcomm.c                    \
6549232d5cSMatthias Ringwald    sdp_client.c                \
6649232d5cSMatthias Ringwald    sdp_client_rfcomm.c         \
6749232d5cSMatthias Ringwald    sdp_server.c                \
6849232d5cSMatthias Ringwald    sm.c                        \
693edc84c5SMatthias Ringwald
703edc84c5SMatthias Ringwald# use $(CC) for Objective-C files
713edc84c5SMatthias Ringwald.m.o:
723edc84c5SMatthias Ringwald	$(CC) $(CFLAGS) -c -o $@ $<
733edc84c5SMatthias Ringwald
743edc84c5SMatthias Ringwald# libBTstack.a
75ad7ef80bSMatthias Ringwaldall: libBTstack.$(BTSTACK_LIB_EXTENSION) BTdaemon libBTstackServer.$(BTSTACK_LIB_EXTENSION)
763edc84c5SMatthias Ringwald
773edc84c5SMatthias RingwaldlibBTstack.$(BTSTACK_LIB_EXTENSION): $(libBTstack_SOURCES)
783edc84c5SMatthias Ringwald		$(BTSTACK_ROOT)/tool/get_version.sh
79*71d91108SMatthias Ringwald		$(CC) $(CFLAGS) $^ $(LDFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@
803edc84c5SMatthias Ringwald
813edc84c5SMatthias Ringwald# libBTstack.a: $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o)
823edc84c5SMatthias Ringwald#		ar cru $@ $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o)
833edc84c5SMatthias Ringwald#		ranlib $@
843edc84c5SMatthias Ringwald
853edc84c5SMatthias RingwaldBTdaemon: $(BTdaemon_SOURCES)
86*71d91108SMatthias Ringwald		$(CC) $(CFLAGS) $(LIBUSB_CFLAGS) $^ $(LDFLAGS) $(LIBUSB_LDFLAGS) -o $@
87ad7ef80bSMatthias Ringwald
88ad7ef80bSMatthias RingwaldlibBTstackServer.$(BTSTACK_LIB_EXTENSION): $(BTdaemon_SOURCES)
89ad7ef80bSMatthias Ringwald		$(BTSTACK_ROOT)/tool/get_version.sh
90*71d91108SMatthias Ringwald		$(CC) $(CFLAGS) $(LIBUSB_CFLAGS) $^ $(LDFLAGS) $(LIBUSB_LDFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@
913edc84c5SMatthias Ringwald
923edc84c5SMatthias Ringwaldclean:
933edc84c5SMatthias Ringwald	rm -rf libBTstack* BTdaemon *.o
943edc84c5SMatthias Ringwald
953edc84c5SMatthias Ringwaldinstall:
963edc84c5SMatthias Ringwald	echo "Installing BTdaemon in $(prefix)..."
973edc84c5SMatthias Ringwald	mkdir -p $(prefix)/bin $(prefix)/lib $(prefix)/include
983edc84c5SMatthias Ringwald	# cp libBTstack.a $(prefix)/lib/
993edc84c5SMatthias Ringwald	cp libBTstack.dylib $(prefix)/lib/
1003edc84c5SMatthias Ringwald	cp BTdaemon $(prefix)/bin/
1013edc84c5SMatthias Ringwald	cp -r $(BTSTACK_ROOT)/include/btstack $(prefix)/include
102