xref: /btstack/port/daemon/src/Makefile.in (revision f12924e0a61c0582b548a1e70cea1bd59ba21f1d)
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 \
32*f12924e0SMatthias 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    daemon.c            \
44f708cc53SMatthias Ringwald    btstack_uart_block_posix.c \
45bd021c4eSMatthias Ringwald    hci_transport_h4.c  \
463edc84c5SMatthias Ringwald    $(libBTstack_SOURCES) \
473edc84c5SMatthias Ringwald    btstack_memory.c    \
483edc84c5SMatthias Ringwald    hci.c               \
493edc84c5SMatthias Ringwald    hci_dump.c          \
503edc84c5SMatthias Ringwald    l2cap.c             \
513edc84c5SMatthias Ringwald    l2cap_signaling.c   \
52d2e6c4b7SMatthias Ringwald    btstack_memory_pool.c       \
533edc84c5SMatthias Ringwald    rfcomm.c            \
543edc84c5SMatthias Ringwald    bnep.c              \
55746ccb7eSMatthias Ringwald    sdp_server.c               \
563edc84c5SMatthias Ringwald    sdp_client.c        \
57efda0b48SMatthias Ringwald    sdp_client_rfcomm.c  \
583edc84c5SMatthias Ringwald    att_dispatch.c      \
593edc84c5SMatthias Ringwald    gatt_client.c       \
60591423b2SMatthias Ringwald    att_db.c               \
613edc84c5SMatthias Ringwald    att_server.c        \
623edc84c5SMatthias Ringwald    sm.c                \
633edc84c5SMatthias Ringwald    le_device_db_memory.c \
643edc84c5SMatthias Ringwald    $(usb_sources)                \
653edc84c5SMatthias Ringwald    $(remote_device_db_sources)   \
663edc84c5SMatthias Ringwald
673edc84c5SMatthias Ringwald# use $(CC) for Objective-C files
683edc84c5SMatthias Ringwald.m.o:
693edc84c5SMatthias Ringwald	$(CC) $(CFLAGS) -c -o $@ $<
703edc84c5SMatthias Ringwald
713edc84c5SMatthias Ringwald# libBTstack.a
723edc84c5SMatthias Ringwaldall: libBTstack.$(BTSTACK_LIB_EXTENSION) BTdaemon
733edc84c5SMatthias Ringwald
743edc84c5SMatthias RingwaldlibBTstack.$(BTSTACK_LIB_EXTENSION): $(libBTstack_SOURCES)
753edc84c5SMatthias Ringwald		$(BTSTACK_ROOT)/tool/get_version.sh
763edc84c5SMatthias Ringwald		$(CC) $(CFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@ $^ $(LDFLAGS)
773edc84c5SMatthias Ringwald
783edc84c5SMatthias Ringwald# libBTstack.a: $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o)
793edc84c5SMatthias Ringwald#		ar cru $@ $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o)
803edc84c5SMatthias Ringwald#		ranlib $@
813edc84c5SMatthias Ringwald
823edc84c5SMatthias RingwaldBTdaemon: $(BTdaemon_SOURCES)
83*f12924e0SMatthias Ringwald		$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBUSB_CFLAGS) $(LIBUSB_LDFLAGS)
843edc84c5SMatthias Ringwald
853edc84c5SMatthias Ringwaldclean:
863edc84c5SMatthias Ringwald	rm -rf libBTstack* BTdaemon *.o
873edc84c5SMatthias Ringwald
883edc84c5SMatthias Ringwaldinstall:
893edc84c5SMatthias Ringwald	echo "Installing BTdaemon in $(prefix)..."
903edc84c5SMatthias Ringwald	mkdir -p $(prefix)/bin $(prefix)/lib $(prefix)/include
913edc84c5SMatthias Ringwald	# cp libBTstack.a $(prefix)/lib/
923edc84c5SMatthias Ringwald	cp libBTstack.dylib $(prefix)/lib/
933edc84c5SMatthias Ringwald	cp BTdaemon $(prefix)/bin/
943edc84c5SMatthias Ringwald	cp -r $(BTSTACK_ROOT)/include/btstack $(prefix)/include
95