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 18dd9e275cSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/posix 193edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/cocoa 203edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src 213edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble 223edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/classic 233edc84c5SMatthias Ringwald 243edc84c5SMatthias Ringwaldremote_device_db_sources = @REMOTE_DEVICE_DB_SOURCES@ 25528a4a3bSMatthias Ringwaldbtstack_run_loop_sources = @btstack_run_loop_SOURCES@ 263edc84c5SMatthias Ringwaldusb_sources = @USB_SOURCES@ 273edc84c5SMatthias Ringwald 283edc84c5SMatthias RingwaldlibBTstack_SOURCES = \ 293edc84c5SMatthias Ringwald btstack.c \ 303edc84c5SMatthias Ringwald socket_connection.c \ 3156042629SMatthias Ringwald hci_cmd.c \ 32a8307d38SMatthias Ringwald daemon_cmds.c \ 334fd23d47SMatthias Ringwald btstack_linked_list.c \ 344ab92137SMatthias Ringwald btstack_run_loop.c \ 353edc84c5SMatthias Ringwald sdp_util.c \ 36*e3f52bebSMatthias Ringwald spp_server.c \ 37eb886013SMatthias Ringwald btstack_util.c \ 38528a4a3bSMatthias Ringwald $(btstack_run_loop_sources) \ 393edc84c5SMatthias Ringwald 403edc84c5SMatthias RingwaldBTdaemon_SOURCES = \ 413edc84c5SMatthias Ringwald daemon.c \ 42ff839116SMatthias Ringwald hci_transport_h4_posix.c \ 433edc84c5SMatthias Ringwald $(libBTstack_SOURCES) \ 443edc84c5SMatthias Ringwald btstack_memory.c \ 453edc84c5SMatthias Ringwald hci.c \ 463edc84c5SMatthias Ringwald hci_dump.c \ 473edc84c5SMatthias Ringwald l2cap.c \ 483edc84c5SMatthias Ringwald l2cap_signaling.c \ 49d2e6c4b7SMatthias Ringwald btstack_memory_pool.c \ 503edc84c5SMatthias Ringwald rfcomm.c \ 513edc84c5SMatthias Ringwald bnep.c \ 52746ccb7eSMatthias Ringwald sdp_server.c \ 533edc84c5SMatthias Ringwald sdp_client.c \ 54efda0b48SMatthias Ringwald sdp_client_rfcomm.c \ 553edc84c5SMatthias Ringwald att_dispatch.c \ 563edc84c5SMatthias Ringwald gatt_client.c \ 57591423b2SMatthias Ringwald att_db.c \ 583edc84c5SMatthias Ringwald att_server.c \ 593edc84c5SMatthias Ringwald sm.c \ 603edc84c5SMatthias Ringwald le_device_db_memory.c \ 613edc84c5SMatthias Ringwald $(usb_sources) \ 623edc84c5SMatthias Ringwald $(remote_device_db_sources) \ 633edc84c5SMatthias Ringwald 643edc84c5SMatthias Ringwald# use $(CC) for Objective-C files 653edc84c5SMatthias Ringwald.m.o: 663edc84c5SMatthias Ringwald $(CC) $(CFLAGS) -c -o $@ $< 673edc84c5SMatthias Ringwald 683edc84c5SMatthias Ringwald# libBTstack.a 693edc84c5SMatthias Ringwaldall: libBTstack.$(BTSTACK_LIB_EXTENSION) BTdaemon 703edc84c5SMatthias Ringwald 713edc84c5SMatthias RingwaldlibBTstack.$(BTSTACK_LIB_EXTENSION): $(libBTstack_SOURCES) 723edc84c5SMatthias Ringwald $(BTSTACK_ROOT)/tool/get_version.sh 733edc84c5SMatthias Ringwald $(CC) $(CFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@ $^ $(LDFLAGS) 743edc84c5SMatthias Ringwald 753edc84c5SMatthias Ringwald# libBTstack.a: $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o) 763edc84c5SMatthias Ringwald# ar cru $@ $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o) 773edc84c5SMatthias Ringwald# ranlib $@ 783edc84c5SMatthias Ringwald 793edc84c5SMatthias RingwaldBTdaemon: $(BTdaemon_SOURCES) 802539bee6SMatthias Ringwald $(CC) $(CFLAGS) -DENABLE_LOG_INTO_HCI_DUMP -o $@ $^ $(LDFLAGS) $(LIBUSB_CFLAGS) $(LIBUSB_LDFLAGS) 813edc84c5SMatthias Ringwald 823edc84c5SMatthias Ringwaldclean: 833edc84c5SMatthias Ringwald rm -rf libBTstack* BTdaemon *.o 843edc84c5SMatthias Ringwald 853edc84c5SMatthias Ringwaldinstall: 863edc84c5SMatthias Ringwald echo "Installing BTdaemon in $(prefix)..." 873edc84c5SMatthias Ringwald mkdir -p $(prefix)/bin $(prefix)/lib $(prefix)/include 883edc84c5SMatthias Ringwald # cp libBTstack.a $(prefix)/lib/ 893edc84c5SMatthias Ringwald cp libBTstack.dylib $(prefix)/lib/ 903edc84c5SMatthias Ringwald cp BTdaemon $(prefix)/bin/ 913edc84c5SMatthias Ringwald cp -r $(BTSTACK_ROOT)/include/btstack $(prefix)/include 92