summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 55d396d0b3ba3599eefead30c2c1f2a5ecb207a9 (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
TARGETS=usbmuxd iproxy
CFLAGS=-I. -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: 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
iproxy.o: iproxy.c sock_stuff.h

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

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

iproxy: iproxy.o libusbmuxd.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