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 \ 36eb886013SMatthias Ringwald btstack_util.c \ 37528a4a3bSMatthias Ringwald $(btstack_run_loop_sources) \ 383edc84c5SMatthias Ringwald 393edc84c5SMatthias RingwaldBTdaemon_SOURCES = \ 403edc84c5SMatthias Ringwald daemon.c \ 41ff839116SMatthias Ringwald hci_transport_h4_posix.c \ 423edc84c5SMatthias Ringwald $(libBTstack_SOURCES) \ 433edc84c5SMatthias Ringwald btstack_memory.c \ 443edc84c5SMatthias Ringwald hci.c \ 453edc84c5SMatthias Ringwald hci_dump.c \ 463edc84c5SMatthias Ringwald l2cap.c \ 473edc84c5SMatthias Ringwald l2cap_signaling.c \ 48d2e6c4b7SMatthias Ringwald btstack_memory_pool.c \ 493edc84c5SMatthias Ringwald rfcomm.c \ 503edc84c5SMatthias Ringwald bnep.c \ 51746ccb7eSMatthias Ringwald sdp_server.c \ 523edc84c5SMatthias Ringwald sdp_client.c \ 53*efda0b48SMatthias Ringwald sdp_client_rfcomm.c \ 543edc84c5SMatthias Ringwald att_dispatch.c \ 553edc84c5SMatthias Ringwald gatt_client.c \ 56591423b2SMatthias Ringwald att_db.c \ 573edc84c5SMatthias Ringwald att_server.c \ 583edc84c5SMatthias Ringwald sm.c \ 593edc84c5SMatthias Ringwald le_device_db_memory.c \ 603edc84c5SMatthias Ringwald $(usb_sources) \ 613edc84c5SMatthias Ringwald $(remote_device_db_sources) \ 623edc84c5SMatthias Ringwald 633edc84c5SMatthias Ringwald# use $(CC) for Objective-C files 643edc84c5SMatthias Ringwald.m.o: 653edc84c5SMatthias Ringwald $(CC) $(CFLAGS) -c -o $@ $< 663edc84c5SMatthias Ringwald 673edc84c5SMatthias Ringwald# libBTstack.a 683edc84c5SMatthias Ringwaldall: libBTstack.$(BTSTACK_LIB_EXTENSION) BTdaemon 693edc84c5SMatthias Ringwald 703edc84c5SMatthias RingwaldlibBTstack.$(BTSTACK_LIB_EXTENSION): $(libBTstack_SOURCES) 713edc84c5SMatthias Ringwald $(BTSTACK_ROOT)/tool/get_version.sh 723edc84c5SMatthias Ringwald $(CC) $(CFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@ $^ $(LDFLAGS) 733edc84c5SMatthias Ringwald 743edc84c5SMatthias Ringwald# libBTstack.a: $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o) 753edc84c5SMatthias Ringwald# ar cru $@ $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o) 763edc84c5SMatthias Ringwald# ranlib $@ 773edc84c5SMatthias Ringwald 783edc84c5SMatthias RingwaldBTdaemon: $(BTdaemon_SOURCES) 792539bee6SMatthias Ringwald $(CC) $(CFLAGS) -DENABLE_LOG_INTO_HCI_DUMP -o $@ $^ $(LDFLAGS) $(LIBUSB_CFLAGS) $(LIBUSB_LDFLAGS) 803edc84c5SMatthias Ringwald 813edc84c5SMatthias Ringwaldclean: 823edc84c5SMatthias Ringwald rm -rf libBTstack* BTdaemon *.o 833edc84c5SMatthias Ringwald 843edc84c5SMatthias Ringwaldinstall: 853edc84c5SMatthias Ringwald echo "Installing BTdaemon in $(prefix)..." 863edc84c5SMatthias Ringwald mkdir -p $(prefix)/bin $(prefix)/lib $(prefix)/include 873edc84c5SMatthias Ringwald # cp libBTstack.a $(prefix)/lib/ 883edc84c5SMatthias Ringwald cp libBTstack.dylib $(prefix)/lib/ 893edc84c5SMatthias Ringwald cp BTdaemon $(prefix)/bin/ 903edc84c5SMatthias Ringwald cp -r $(BTSTACK_ROOT)/include/btstack $(prefix)/include 91