-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile
74 lines (56 loc) · 2.7 KB
/
Makefile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
AR := ar
CC := gcc
CFLAGS = -I./include/libusb -I./libusbip -I/usr/local/include -I/opt/local/include
LDFLAGS = -L/usr/lib -L/opt/local/lib
LIBS = -lusb-1.0
LIBUSBIP_TARGET = libusbip/libusbip.a
LIBUSBIP_OBJECTS = libusbip/libusbip.o libusbip/proto.o libusbip/client.o libusbip/server.o libusbip/error.o libusbip/warning.o include/tpl/tpl.o
LIBUSBIP_CFLAGS = $(CFLAGS)
LIBUSBIP_LDFLAGS = $(LDFLAGS)
LIBUSBIP_LIBS = $(LIBS)
RPCSERVER_TARGET = examples/rpc_server
RPCSERVER_OBJECTS = examples/rpc_server.o libusbip/libusbip.a
RPCSERVER_CFLAGS = $(CFLAGS)
RPCSERVER_LDFLAGS = $(LDFLAGS)
RPCSERVER_LIBS = $(LIBS)
RPCCLIENT_TARGET = examples/rpc_client
RPCCLIENT_OBJECTS = examples/rpc_client.o libusbip/libusbip.a
RPCCLIENT_CFLAGS = $(CFLAGS)
RPCCLIENT_LDFLAGS = $(LDFLAGS)
RPCCLIENT_LIBS = $(LIBS)
IDEVSEARCH_TARGET = examples/idev_search
IDEVSEARCH_OBJECTS = examples/idev_search.o libusbip/libusbip.a
IDEVSEARCH_CFLAGS = $(CFLAGS)
IDEVSEARCH_LDFLAGS = $(LDFLAGS)
IDEVSEARCH_LIBS = $(LIBS)
IDEVSERIAL_TARGET = examples/idev_serial
IDEVSERIAL_OBJECTS = examples/idev_serial.o libusbip/libusbip.a
IDEVSERIAL_CFLAGS = $(CFLAGS)
IDEVSERIAL_LDFLAGS = $(LDFLAGS)
IDEVSERIAL_LIBS = $(LIBS)
IDEVCMD_TARGET = examples/idev_cmd
IDEVCMD_OBJECTS = examples/idev_cmd.o libusbip/libusbip.a
IDEVCMD_CFLAGS = $(CFLAGS)
IDEVCMD_LDFLAGS = $(LDFLAGS)
IDEVCMD_LIBS = $(LIBS)
TARGETS = $(LIBUSBIP_TARGET) $(RPCSERVER_TARGET) $(RPCCLIENT_TARGET) $(IDEVSEARCH_TARGET) $(IDEVSERIAL_TARGET) $(IDEVCMD_TARGET)
OBJECTS = $(LIBUSBIP_OBJECTS) $(RPCSERVER_OBJECTS) $(RPCCLIENT_OBJECTS) $(IDEVSEARCH_OBJECTS) $(IDEVSERIAL_OBJECTS) $(IDEVCMD_OBJECTS)
%.o: %.S
$(CC) -c $(<) -o $(@) $(CFLAGS)
%.o: %.c
$(CC) -c $(<) -o $(@) $(CFLAGS)
$(LIBUSBIP_TARGET): $(LIBUSBIP_OBJECTS)
$(AR) rs $(LIBUSBIP_TARGET) $(LIBUSBIP_OBJECTS)
$(RPCSERVER_TARGET): $(RPCSERVER_OBJECTS)
$(CC) -o $(RPCSERVER_TARGET) $(RPCSERVER_OBJECTS) $(RPCSERVER_CFLAGS) $(RPCSERVER_LDFLAGS) $(RPCSERVER_LIBS)
$(RPCCLIENT_TARGET): $(RPCCLIENT_OBJECTS)
$(CC) -o $(RPCCLIENT_TARGET) $(RPCCLIENT_OBJECTS) $(RPCCLIENT_CFLAGS) $(RPCCLIENT_LDFLAGS) $(RPCCLIENT_LIBS)
$(IDEVSEARCH_TARGET): $(IDEVSEARCH_OBJECTS)
$(CC) -o $(IDEVSEARCH_TARGET) $(IDEVSEARCH_OBJECTS) $(IDEVSEARCH_CFLAGS) $(IDEVSEARCH_LDFLAGS) $(IDEVSEARCH_LIBS)
$(IDEVSERIAL_TARGET): $(IDEVSERIAL_OBJECTS)
$(CC) -o $(IDEVSERIAL_TARGET) $(IDEVSERIAL_OBJECTS) $(IDEVSERIAL_CFLAGS) $(IDEVSERIAL_LDFLAGS) $(IDEVSERIAL_LIBS)
$(IDEVCMD_TARGET): $(IDEVCMD_OBJECTS)
$(CC) -o $(IDEVCMD_TARGET) $(IDEVCMD_OBJECTS) $(IDEVCMD_CFLAGS) $(IDEVCMD_LDFLAGS) $(IDEVCMD_LIBS)
all: $(TARGETS)
clean:
$(RM) $(LIBUSBIP_TARGET) $(RPCSERVER_TARGET) $(RPCCLIENT_TARGET) $(IDEVSEARCH_TARGET) $(IDEVSERIAL_TARGET) $(IDEVCMD_TARGET) libusbip/*.o examples/*.o include/tpl/*.o