summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Paul Sladen2009-03-29 19:13:36 +0200
committerGravatar Nikias Bassen2009-03-29 19:13:36 +0200
commit968dc229afd75e670a92b24eb48222aa347d756b (patch)
tree46ffbedeff90838b95b643ba6d6a0c966292b452
parent16a161e315c12a6837fcdb15c270ac42feef8e9b (diff)
downloadusbmuxd-968dc229afd75e670a92b24eb48222aa347d756b.tar.gz
usbmuxd-968dc229afd75e670a92b24eb48222aa347d756b.tar.bz2
[PATCH] renamed: usbmuxd.h -> usbmuxd-proto.h
renamed: libusbmuxd.h -> usbmuxd.h Use 'install' in Makefile build libusbmuxd.so (use with '#include <usbmux.h>' and -lusbmuxd add *.so to .gitignore Really this time. Signed-off-by: Nikias Bassen <nikias@gmx.li>
-rw-r--r--Makefile29
-rw-r--r--README1
-rw-r--r--iproxy.c2
-rw-r--r--libusbmuxd.c4
-rw-r--r--main.c2
5 files changed, 23 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 55d396d..e0c8971 100644
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,20 @@
1TARGETS=usbmuxd iproxy 1TARGETS=usbmuxd iproxy libusbmuxd.so
2CFLAGS=-I. -Wall -g -DDEBUG 2CFLAGS=-I. -Wall -g -DDEBUG -fPIC
3LIBS=-lpthread -lusb -lrt 3LIBS=-lpthread -lusb -lrt
4LDFLAGS= 4LDFLAGS=-L.
5INSTALL_PREFIX=/usr 5INSTALL_PREFIX=/usr
6 6
7all: $(TARGETS) 7all: $(TARGETS)
8 8
9main.o: main.c usbmuxd.h sock_stuff.h iphone.h 9main.o: main.c usbmuxd-proto.h sock_stuff.h iphone.h
10iphone.o: iphone.c iphone.h usbmuxd.h sock_stuff.h 10iphone.o: iphone.c iphone.h usbmuxd.h sock_stuff.h
11sock_stuff.o: sock_stuff.c sock_stuff.h 11sock_stuff.o: sock_stuff.c sock_stuff.h
12libusbmuxd.o: libusbmuxd.c libusbmuxd.h usbmuxd.h 12libusbmuxd.o: libusbmuxd.c usbmuxd.h usbmuxd-proto.h
13iproxy.o: iproxy.c sock_stuff.h 13iproxy.o: iproxy.c sock_stuff.h
14libusbmuxd.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
18usbmuxd: main.o sock_stuff.o iphone.o 22usbmuxd: main.o sock_stuff.o iphone.o
19 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) 23 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
20 24
21iproxy: iproxy.o libusbmuxd.o sock_stuff.o 25iproxy: iproxy.o
22 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) 26 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) -lusbmuxd
23 27
24clean: 28clean:
25 rm -f *.o $(TARGETS) 29 rm -f *.o *.so $(TARGETS)
26 30
27realclean: clean 31realclean: clean
28 rm -f *~ 32 rm -f *~
29 33
30install: all 34install: 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
diff --git a/README b/README
index 5cb74f9..b36c0c0 100644
--- a/README
+++ b/README
@@ -3,7 +3,6 @@ Build
3 3
4 make 4 make
5 5
6
7Use 6Use
8=== 7===
9 8
diff --git a/iproxy.c b/iproxy.c
index 56e30ed..527ebf6 100644
--- a/iproxy.c
+++ b/iproxy.c
@@ -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
37static uint16_t listen_port = 0; 37static uint16_t listen_port = 0;
38static uint16_t device_port = 0; 38static 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
diff --git a/main.c b/main.c
index fc8eef2..832ff7f 100644
--- a/main.c
+++ b/main.c
@@ -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"