btstack/Makefile.iphone
2009-07-06 16:37:53 +00:00

65 lines
1.9 KiB
Makefile

NAME = BTdaemon
# set IP address of your phone. this is using USB and Internet Tethering
IPHONE = 192.168.20.1
SRCDIR = src
VPATH = src
# These paths must be changed to match the compilation environment
DEVELOPER_PATH = /Developer/Platforms/iPhoneOS.platform/Developer
SDK_VERSION = 2.0
SDK_PATH = $(DEVELOPER_PATH)/SDKs/iPhoneOS$(SDK_VERSION).sdk
GCC_VERSION = 4.0.1
#
CC = $(DEVELOPER_PATH)/usr/bin/arm-apple-darwin9-gcc-$(GCC_VERSION)
CFLAGS = -g0 -O2 -Wall -Werror -I. -Iinclude \
-I$(SDK_PATH)/usr/include \
-I$(SDK_PATH)/usr/lib/gcc/arm-apple-darwin9/4.0.1/include \
-F$(SDK_PATH)/System/Library/Frameworks \
LDFLAGS = \
-multiply_defined suppress \
-L$(SDK_PATH)/usr/lib \
-framework CoreFoundation \
-L$(SDK_PATH)/System/Library/Frameworks/IOKit.framework/Versions/A \
-lIOKit
SRCS = \
bt_control_iphone.c \
daemon.c \
hci.c \
hci_dump.c \
hci_transport_h4.c \
l2cap.c \
main.c \
run_loop.c \
socket_server.c \
HEADERS = \
bt_control.h \
bt_control_iphone.h \
hci.h \
hci_dump.h \
hci_transport.h \
hci_transport_h4.h \
l2cap.h \
run_loop.h \
socket_server.h \
all: $(NAME)
clean:
rm -fr $(NAME) *.o
$(SRCS): $(HEADERS)
$(NAME): $(SRCS)
$(CC) $(CFLAGS) -o $(NAME) $(filter %.mm,$^) $(filter %.m,$^) $(filter %.c,$^) $(LDFLAGS)
export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $(NAME)
ssh mobile@$(IPHONE) rm -f /var/mobile/$(NAME)
scp $(NAME) mobile@$(IPHONE):/var/mobile
.PHONY: all clean