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 \ 101686c0edSMatthias Ringwald -I $(BTSTACK_ROOT)/platform/windows \ 113edc84c5SMatthias Ringwald -I $(BTSTACK_ROOT)/src \ 123edc84c5SMatthias Ringwald -I.. 133edc84c5SMatthias RingwaldBTSTACK_LIB_LDFLAGS = @BTSTACK_LIB_LDFLAGS@ 143edc84c5SMatthias RingwaldBTSTACK_LIB_EXTENSION = @BTSTACK_LIB_EXTENSION@ 1551102e18SMatthias RingwaldUSB_CFLAGS = @USB_CFLAGS@ 1651102e18SMatthias RingwaldUSB_LDFLAGS = @USB_LDFLAGS@ 173edc84c5SMatthias Ringwald 182531c97eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/daemon/src 19f8d88472SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/corefoundation 20ff964d8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/libusb 21ff964d8eSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/posix 221686c0edSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/windows 233edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src 243edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble 253edc84c5SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/classic 263edc84c5SMatthias Ringwald 273edc84c5SMatthias Ringwaldremote_device_db_sources = @REMOTE_DEVICE_DB_SOURCES@ 28528a4a3bSMatthias Ringwaldbtstack_run_loop_sources = @btstack_run_loop_SOURCES@ 293edc84c5SMatthias Ringwaldusb_sources = @USB_SOURCES@ 302ab22389SMatthias Ringwalduart_sources = @UART_SOURCES@ 313edc84c5SMatthias Ringwald 323edc84c5SMatthias RingwaldlibBTstack_SOURCES = \ 33*de9043e0SMatthias Ringwald btstack.o \ 34*de9043e0SMatthias Ringwald socket_connection.o \ 35*de9043e0SMatthias Ringwald hci_dump.o \ 36*de9043e0SMatthias Ringwald hci_cmd.o \ 37*de9043e0SMatthias Ringwald daemon_cmds.o \ 38*de9043e0SMatthias Ringwald btstack_linked_list.o \ 39*de9043e0SMatthias Ringwald btstack_run_loop.o \ 40*de9043e0SMatthias Ringwald sdp_util.o \ 41*de9043e0SMatthias Ringwald spp_server.o \ 42*de9043e0SMatthias Ringwald btstack_util.o \ 43528a4a3bSMatthias Ringwald $(btstack_run_loop_sources) \ 443edc84c5SMatthias Ringwald 453edc84c5SMatthias RingwaldBTdaemon_SOURCES = \ 463edc84c5SMatthias Ringwald $(libBTstack_SOURCES) \ 473edc84c5SMatthias Ringwald $(usb_sources) \ 482ab22389SMatthias Ringwald $(uart_sources) \ 493edc84c5SMatthias Ringwald $(remote_device_db_sources) \ 50*de9043e0SMatthias Ringwald ad_parser.o \ 51*de9043e0SMatthias Ringwald att_db.o \ 52*de9043e0SMatthias Ringwald att_dispatch.o \ 53*de9043e0SMatthias Ringwald att_server.o \ 54*de9043e0SMatthias Ringwald bnep.o \ 55*de9043e0SMatthias Ringwald btstack_crypto.o \ 56*de9043e0SMatthias Ringwald btstack_memory.o \ 57*de9043e0SMatthias Ringwald btstack_memory_pool.o \ 58*de9043e0SMatthias Ringwald btstack_tlv.o \ 59*de9043e0SMatthias Ringwald btstack_tlv_posix.o \ 60*de9043e0SMatthias Ringwald btstack_link_key_db_tlv.o \ 61*de9043e0SMatthias Ringwald daemon.o \ 62*de9043e0SMatthias Ringwald gatt_client.o \ 63*de9043e0SMatthias Ringwald hci.o \ 64*de9043e0SMatthias Ringwald hci_dump.o \ 65*de9043e0SMatthias Ringwald hci_transport_h4.o \ 66*de9043e0SMatthias Ringwald l2cap.o \ 67*de9043e0SMatthias Ringwald l2cap_signaling.o \ 68*de9043e0SMatthias Ringwald le_device_db_tlv.o \ 69*de9043e0SMatthias Ringwald rfcomm.o \ 70*de9043e0SMatthias Ringwald sdp_client.o \ 71*de9043e0SMatthias Ringwald sdp_client_rfcomm.o \ 72*de9043e0SMatthias Ringwald sdp_server.o \ 73*de9043e0SMatthias Ringwald sm.o \ 743edc84c5SMatthias Ringwald 753edc84c5SMatthias Ringwald# use $(CC) for Objective-C files 763edc84c5SMatthias Ringwald.m.o: 773edc84c5SMatthias Ringwald $(CC) $(CFLAGS) -c -o $@ $< 783edc84c5SMatthias Ringwald 793edc84c5SMatthias Ringwald# libBTstack.a 80ad7ef80bSMatthias Ringwaldall: libBTstack.$(BTSTACK_LIB_EXTENSION) BTdaemon libBTstackServer.$(BTSTACK_LIB_EXTENSION) 813edc84c5SMatthias Ringwald 823edc84c5SMatthias RingwaldlibBTstack.$(BTSTACK_LIB_EXTENSION): $(libBTstack_SOURCES) 833edc84c5SMatthias Ringwald $(BTSTACK_ROOT)/tool/get_version.sh 8471d91108SMatthias Ringwald $(CC) $(CFLAGS) $^ $(LDFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@ 853edc84c5SMatthias Ringwald 863edc84c5SMatthias Ringwald# libBTstack.a: $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o) 873edc84c5SMatthias Ringwald# ar cru $@ $(libBTstack_SOURCES:.c=.o) $(libBTstack_SOURCES:.m=.o) 883edc84c5SMatthias Ringwald# ranlib $@ 893edc84c5SMatthias Ringwald 903edc84c5SMatthias RingwaldBTdaemon: $(BTdaemon_SOURCES) 9151102e18SMatthias Ringwald $(CC) $(CFLAGS) $(USB_CFLAGS) $^ $(LDFLAGS) $(USB_LDFLAGS) -o $@ 92ad7ef80bSMatthias Ringwald 93ad7ef80bSMatthias RingwaldlibBTstackServer.$(BTSTACK_LIB_EXTENSION): $(BTdaemon_SOURCES) 94ad7ef80bSMatthias Ringwald $(BTSTACK_ROOT)/tool/get_version.sh 9551102e18SMatthias Ringwald $(CC) $(CFLAGS) $(USB_CFLAGS) $^ $(LDFLAGS) $(USB_LDFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@ 963edc84c5SMatthias Ringwald 973edc84c5SMatthias Ringwaldclean: 983edc84c5SMatthias Ringwald rm -rf libBTstack* BTdaemon *.o 993edc84c5SMatthias Ringwald 1003edc84c5SMatthias Ringwaldinstall: 1013edc84c5SMatthias Ringwald echo "Installing BTdaemon in $(prefix)..." 1023edc84c5SMatthias Ringwald mkdir -p $(prefix)/bin $(prefix)/lib $(prefix)/include 1033edc84c5SMatthias Ringwald # cp libBTstack.a $(prefix)/lib/ 1043edc84c5SMatthias Ringwald cp libBTstack.dylib $(prefix)/lib/ 1053edc84c5SMatthias Ringwald cp BTdaemon $(prefix)/bin/ 1063edc84c5SMatthias Ringwald cp -r $(BTSTACK_ROOT)/include/btstack $(prefix)/include 107