diff options
| -rw-r--r-- | Makefile | 29 | ||||
| -rw-r--r-- | README | 1 | ||||
| -rw-r--r-- | iproxy.c | 2 | ||||
| -rw-r--r-- | libusbmuxd.c | 4 | ||||
| -rw-r--r-- | main.c | 2 |
5 files changed, 23 insertions, 15 deletions
| @@ -1,16 +1,20 @@ | |||
| 1 | TARGETS=usbmuxd iproxy | 1 | TARGETS=usbmuxd iproxy libusbmuxd.so |
| 2 | CFLAGS=-I. -Wall -g -DDEBUG | 2 | CFLAGS=-I. -Wall -g -DDEBUG -fPIC |
| 3 | LIBS=-lpthread -lusb -lrt | 3 | LIBS=-lpthread -lusb -lrt |
| 4 | LDFLAGS= | 4 | LDFLAGS=-L. |
| 5 | INSTALL_PREFIX=/usr | 5 | INSTALL_PREFIX=/usr |
| 6 | 6 | ||
| 7 | all: $(TARGETS) | 7 | all: $(TARGETS) |
| 8 | 8 | ||
| 9 | main.o: main.c usbmuxd.h sock_stuff.h iphone.h | 9 | main.o: main.c usbmuxd-proto.h sock_stuff.h iphone.h |
| 10 | iphone.o: iphone.c iphone.h usbmuxd.h sock_stuff.h | 10 | iphone.o: iphone.c iphone.h usbmuxd.h sock_stuff.h |
| 11 | sock_stuff.o: sock_stuff.c sock_stuff.h | 11 | sock_stuff.o: sock_stuff.c sock_stuff.h |
| 12 | libusbmuxd.o: libusbmuxd.c libusbmuxd.h usbmuxd.h | 12 | libusbmuxd.o: libusbmuxd.c usbmuxd.h usbmuxd-proto.h |
| 13 | iproxy.o: iproxy.c sock_stuff.h | 13 | iproxy.o: iproxy.c sock_stuff.h |
| 14 | libusbmuxd.so: libusbmuxd.o sock_stuff.o | ||
| 15 | |||
| 16 | %.so: %.o | ||
| 17 | $(CC) -o $@ -shared -Wl,-soname,$@.1 $^ | ||
| 14 | 18 | ||
| 15 | %.o: %.c | 19 | %.o: %.c |
| 16 | $(CC) -o $@ $(CFLAGS) -c $< | 20 | $(CC) -o $@ $(CFLAGS) -c $< |
| @@ -18,17 +22,22 @@ iproxy.o: iproxy.c sock_stuff.h | |||
| 18 | usbmuxd: main.o sock_stuff.o iphone.o | 22 | usbmuxd: main.o sock_stuff.o iphone.o |
| 19 | $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) | 23 | $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) |
| 20 | 24 | ||
| 21 | iproxy: iproxy.o libusbmuxd.o sock_stuff.o | 25 | iproxy: iproxy.o |
| 22 | $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) | 26 | $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) -lusbmuxd |
| 23 | 27 | ||
| 24 | clean: | 28 | clean: |
| 25 | rm -f *.o $(TARGETS) | 29 | rm -f *.o *.so $(TARGETS) |
| 26 | 30 | ||
| 27 | realclean: clean | 31 | realclean: clean |
| 28 | rm -f *~ | 32 | rm -f *~ |
| 29 | 33 | ||
| 30 | install: all | 34 | install: all |
| 31 | cp usbmuxd $(INSTALL_PREFIX)/sbin/ | 35 | install -m 755 usbmuxd $(INSTALL_PREFIX)/sbin/ |
| 32 | cp usbmuxd.h $(INSTALL_PREFIX)/include/ | 36 | # protocol |
| 37 | install -m 644 usbmuxd-proto.h $(INSTALL_PREFIX)/include/ | ||
| 38 | # iproxy | ||
| 39 | install -m 644 libusbmux.so $(INSTALL_PREFIX)/lib/ | ||
| 40 | install -m 644 usbmuxd.h $(INSTALL_PREFIX)/include/ | ||
| 41 | install -m 755 iproxy $(INSTALL_PREFIX)/bin/ | ||
| 33 | 42 | ||
| 34 | .PHONY: all clean realclean | 43 | .PHONY: all clean realclean |
| @@ -3,7 +3,6 @@ Build | |||
| 3 | 3 | ||
| 4 | make | 4 | make |
| 5 | 5 | ||
| 6 | |||
| 7 | Use | 6 | Use |
| 8 | === | 7 | === |
| 9 | 8 | ||
| @@ -32,7 +32,7 @@ | |||
| 32 | #include <arpa/inet.h> | 32 | #include <arpa/inet.h> |
| 33 | #include <pthread.h> | 33 | #include <pthread.h> |
| 34 | #include "sock_stuff.h" | 34 | #include "sock_stuff.h" |
| 35 | #include "libusbmuxd.h" | 35 | #include "usbmuxd.h" |
| 36 | 36 | ||
| 37 | static uint16_t listen_port = 0; | 37 | static uint16_t listen_port = 0; |
| 38 | static uint16_t device_port = 0; | 38 | static uint16_t device_port = 0; |
diff --git a/libusbmuxd.c b/libusbmuxd.c index ed331aa..1a9b4b8 100644 --- a/libusbmuxd.c +++ b/libusbmuxd.c | |||
| @@ -8,9 +8,9 @@ | |||
| 8 | #include <unistd.h> | 8 | #include <unistd.h> |
| 9 | 9 | ||
| 10 | // usbmuxd public interface | 10 | // usbmuxd public interface |
| 11 | #include <libusbmuxd.h> | ||
| 12 | // usbmuxd protocol | ||
| 13 | #include <usbmuxd.h> | 11 | #include <usbmuxd.h> |
| 12 | // usbmuxd protocol | ||
| 13 | #include <usbmuxd-proto.h> | ||
| 14 | // socket utility functions | 14 | // socket utility functions |
| 15 | #include "sock_stuff.h" | 15 | #include "sock_stuff.h" |
| 16 | 16 | ||
| @@ -34,7 +34,7 @@ | |||
| 34 | #include <stdint.h> | 34 | #include <stdint.h> |
| 35 | #include <usb.h> | 35 | #include <usb.h> |
| 36 | 36 | ||
| 37 | #include "usbmuxd.h" | 37 | #include "usbmuxd-proto.h" |
| 38 | #include "sock_stuff.h" | 38 | #include "sock_stuff.h" |
| 39 | 39 | ||
| 40 | #include "iphone.h" | 40 | #include "iphone.h" |
