summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 19 insertions, 10 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