summaryrefslogtreecommitdiffstats
path: root/Makefile
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 /Makefile
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>
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 @@
-TARGETS=usbmuxd iproxy
-CFLAGS=-I. -Wall -g -DDEBUG
+TARGETS=usbmuxd iproxy libusbmuxd.so
+CFLAGS=-I. -Wall -g -DDEBUG -fPIC
LIBS=-lpthread -lusb -lrt
-LDFLAGS=
+LDFLAGS=-L.
INSTALL_PREFIX=/usr
all: $(TARGETS)
-main.o: main.c usbmuxd.h sock_stuff.h iphone.h
+main.o: main.c usbmuxd-proto.h sock_stuff.h iphone.h
iphone.o: iphone.c iphone.h usbmuxd.h sock_stuff.h
sock_stuff.o: sock_stuff.c sock_stuff.h
-libusbmuxd.o: libusbmuxd.c libusbmuxd.h usbmuxd.h
+libusbmuxd.o: libusbmuxd.c usbmuxd.h usbmuxd-proto.h
iproxy.o: iproxy.c sock_stuff.h
+libusbmuxd.so: libusbmuxd.o sock_stuff.o
+
+%.so: %.o
+ $(CC) -o $@ -shared -Wl,-soname,$@.1 $^
%.o: %.c
$(CC) -o $@ $(CFLAGS) -c $<
@@ -18,17 +22,22 @@ iproxy.o: iproxy.c sock_stuff.h
usbmuxd: main.o sock_stuff.o iphone.o
$(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
-iproxy: iproxy.o libusbmuxd.o sock_stuff.o
- $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
+iproxy: iproxy.o
+ $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) -lusbmuxd
clean:
- rm -f *.o $(TARGETS)
+ rm -f *.o *.so $(TARGETS)
realclean: clean
rm -f *~
install: all
- cp usbmuxd $(INSTALL_PREFIX)/sbin/
- cp usbmuxd.h $(INSTALL_PREFIX)/include/
+ install -m 755 usbmuxd $(INSTALL_PREFIX)/sbin/
+ # protocol
+ install -m 644 usbmuxd-proto.h $(INSTALL_PREFIX)/include/
+ # iproxy
+ install -m 644 libusbmux.so $(INSTALL_PREFIX)/lib/
+ install -m 644 usbmuxd.h $(INSTALL_PREFIX)/include/
+ install -m 755 iproxy $(INSTALL_PREFIX)/bin/
.PHONY: all clean realclean