summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: ece8ebbce2d27ee1d85bfc86c47804b76db2bf78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
TARGETS=usbmuxd iproxy testclient
CFLAGS=-Wall -g -DDEBUG
LIBS=-lpthread -lusb -lrt
LDFLAGS=
INSTALL_PREFIX=/usr

all:	$(TARGETS)

main.o: main.c usbmuxd.h sock_stuff.h iphone.h
iphone.o: iproxy.c iphone.h usbmuxd.h sock_stuff.h
sock_stuff.o: sock_stuff.c sock_stuff.h
testclient.o: testclient.c sock_stuff.h

%.o:    %.c
	$(CC) -o $@ $(CFLAGS) -c $< 

usbmuxd: main.o sock_stuff.o iphone.o
	$(CC) -o $@ $(LDFLAGS) $^ $(LIBS)

testclient: testclient.o sock_stuff.o
	$(CC) -o $@ $(LDFLAGS) $^ $(LIBS)

iproxy: iproxy.o sock_stuff.o
	$(CC) -o $@ $(LDFLAGS) $^ $(LIBS)

clean:
	rm -f *.o $(TARGETS)

realclean: clean
	rm -f *~

install: all
	cp usbmuxd $(INSTALL_PREFIX)/sbin/
	cp usbmuxd.h $(INSTALL_PREFIX)/include/

.PHONY: all clean realclean