13edc84c5SMatthias RingwaldBTSTACK_ROOT = ../../.. 23edc84c5SMatthias Ringwald 33edc84c5SMatthias Ringwaldprefix = @prefix@ 43edc84c5SMatthias Ringwald 53edc84c5SMatthias RingwaldCC = @CC@ 63edc84c5SMatthias RingwaldLDFLAGS = @LDFLAGS@ 73edc84c5SMatthias RingwaldCFLAGS = @CFLAGS@ \ 8*fb4ddcf3SMatthias Ringwald -I ${BTSTACK_ROOT}/3rd-party/micro-ecc \ 9*fb4ddcf3SMatthias Ringwald -I $(BTSTACK_ROOT)/platform/daemon/src \ 102531c97eSMatthias Ringwald -I $(BTSTACK_ROOT)/platform/daemon/src \ 11dd9e275cSMatthias Ringwald -I $(BTSTACK_ROOT)/platform/posix \ 121686c0edSMatthias Ringwald -I $(BTSTACK_ROOT)/platform/windows \ 133edc84c5SMatthias Ringwald -I $(BTSTACK_ROOT)/src \ 143edc84c5SMatthias Ringwald -I.. 153edc84c5SMatthias RingwaldBTSTACK_LIB_LDFLAGS = @BTSTACK_LIB_LDFLAGS@ 163edc84c5SMatthias RingwaldBTSTACK_LIB_EXTENSION = @BTSTACK_LIB_EXTENSION@ 1751102e18SMatthias RingwaldUSB_CFLAGS = @USB_CFLAGS@ 1851102e18SMatthias RingwaldUSB_LDFLAGS = @USB_LDFLAGS@ 193edc84c5SMatthias Ringwald 20*fb4ddcf3SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc 212531c97eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/daemon/src 22f8d88472SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/corefoundation 23ff964d8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/libusb 24ff964d8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/posix 251686c0edSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/windows 263edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src 273edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble 283edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/classic 293edc84c5SMatthias Ringwald 303edc84c5SMatthias Ringwaldremote_device_db_sources = @REMOTE_DEVICE_DB_SOURCES@ 31528a4a3bSMatthias Ringwaldbtstack_run_loop_sources = @btstack_run_loop_SOURCES@ 323edc84c5SMatthias Ringwaldusb_sources = @USB_SOURCES@ 332ab22389SMatthias Ringwalduart_sources = @UART_SOURCES@ 343edc84c5SMatthias Ringwald 353edc84c5SMatthias RingwaldlibBTstack_SOURCES = \ 36de9043e0SMatthias Ringwald btstack.o \ 37de9043e0SMatthias Ringwald socket_connection.o \ 38de9043e0SMatthias Ringwald hci_dump.o \ 39de9043e0SMatthias Ringwald hci_cmd.o \ 40de9043e0SMatthias Ringwald daemon_cmds.o \ 41de9043e0SMatthias Ringwald btstack_linked_list.o \ 42de9043e0SMatthias Ringwald btstack_run_loop.o \ 43de9043e0SMatthias Ringwald sdp_util.o \ 44de9043e0SMatthias Ringwald spp_server.o \ 45de9043e0SMatthias Ringwald btstack_util.o \ 46528a4a3bSMatthias Ringwald $(btstack_run_loop_sources) \ 473edc84c5SMatthias Ringwald 483edc84c5SMatthias RingwaldBTdaemon_SOURCES = \ 493edc84c5SMatthias Ringwald $(libBTstack_SOURCES) \ 503edc84c5SMatthias Ringwald $(usb_sources) \ 512ab22389SMatthias Ringwald $(uart_sources) \ 523edc84c5SMatthias Ringwald $(remote_device_db_sources) \ 53de9043e0SMatthias Ringwald ad_parser.o \ 54de9043e0SMatthias Ringwald att_db.o \ 55de9043e0SMatthias Ringwald att_dispatch.o \ 56de9043e0SMatthias Ringwald att_server.o \ 57de9043e0SMatthias Ringwald bnep.o \ 58de9043e0SMatthias Ringwald btstack_crypto.o \ 59de9043e0SMatthias Ringwald btstack_memory.o \ 60de9043e0SMatthias Ringwald btstack_memory_pool.o \ 61de9043e0SMatthias Ringwald btstack_tlv.o \ 62de9043e0SMatthias Ringwald btstack_tlv_posix.o \ 63de9043e0SMatthias Ringwald btstack_link_key_db_tlv.o \ 64de9043e0SMatthias Ringwald daemon.o \ 65de9043e0SMatthias Ringwald gatt_client.o \ 66de9043e0SMatthias Ringwald hci.o \ 67de9043e0SMatthias Ringwald hci_dump.o \ 68de9043e0SMatthias Ringwald hci_transport_h4.o \ 69de9043e0SMatthias Ringwald l2cap.o \ 70de9043e0SMatthias Ringwald l2cap_signaling.o \ 71de9043e0SMatthias Ringwald le_device_db_tlv.o \ 72de9043e0SMatthias Ringwald rfcomm.o \ 73de9043e0SMatthias Ringwald sdp_client.o \ 74de9043e0SMatthias Ringwald sdp_client_rfcomm.o \ 75de9043e0SMatthias Ringwald sdp_server.o \ 76de9043e0SMatthias Ringwald sm.o \ 77*fb4ddcf3SMatthias Ringwald uECC.o \ 783edc84c5SMatthias Ringwald 793edc84c5SMatthias Ringwald# use $(CC) for Objective-C files 803edc84c5SMatthias Ringwald.m.o: 813edc84c5SMatthias Ringwald $(CC) $(CFLAGS) -c -o $@ $< 823edc84c5SMatthias Ringwald 833edc84c5SMatthias Ringwald# libBTstack.a 84ad7ef80bSMatthias Ringwaldall: libBTstack.$(BTSTACK_LIB_EXTENSION) BTdaemon libBTstackServer.$(BTSTACK_LIB_EXTENSION) 853edc84c5SMatthias Ringwald 863edc84c5SMatthias RingwaldlibBTstack.$(BTSTACK_LIB_EXTENSION): $(libBTstack_SOURCES) 873edc84c5SMatthias Ringwald $(BTSTACK_ROOT)/tool/get_version.sh 8871d91108SMatthias Ringwald $(CC) $(CFLAGS) $^ $(LDFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@ 893edc84c5SMatthias Ringwald 903edc84c5SMatthias Ringwald# libBTstack.a: $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o) 913edc84c5SMatthias Ringwald# ar cru $@ $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o) 923edc84c5SMatthias Ringwald# ranlib $@ 933edc84c5SMatthias Ringwald 943edc84c5SMatthias RingwaldBTdaemon: $(BTdaemon_SOURCES) 9551102e18SMatthias Ringwald $(CC) $(CFLAGS) $(USB_CFLAGS) $^ $(LDFLAGS) $(USB_LDFLAGS) -o $@ 96ad7ef80bSMatthias Ringwald 97ad7ef80bSMatthias RingwaldlibBTstackServer.$(BTSTACK_LIB_EXTENSION): $(BTdaemon_SOURCES) 98ad7ef80bSMatthias Ringwald $(BTSTACK_ROOT)/tool/get_version.sh 9951102e18SMatthias Ringwald $(CC) $(CFLAGS) $(USB_CFLAGS) $^ $(LDFLAGS) $(USB_LDFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@ 1003edc84c5SMatthias Ringwald 1013edc84c5SMatthias Ringwaldclean: 1023edc84c5SMatthias Ringwald rm -rf libBTstack* BTdaemon *.o 1033edc84c5SMatthias Ringwald 1043edc84c5SMatthias Ringwaldinstall: 1053edc84c5SMatthias Ringwald echo "Installing BTdaemon in $(prefix)..." 1063edc84c5SMatthias Ringwald mkdir -p $(prefix)/bin $(prefix)/lib $(prefix)/include 1073edc84c5SMatthias Ringwald # cp libBTstack.a $(prefix)/lib/ 1083edc84c5SMatthias Ringwald cp libBTstack.dylib $(prefix)/lib/ 1093edc84c5SMatthias Ringwald cp BTdaemon $(prefix)/bin/ 1103edc84c5SMatthias Ringwald cp -r $(BTSTACK_ROOT)/include/btstack $(prefix)/include 111