-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
37 lines (27 loc) · 917 Bytes
/
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
CC = gcc
OFED_PATH = /usr
DEFAULT_CFLAGS = -I${OFED_PATH}/include
DEFAULT_LDFLAGS = -L${OFED_PATH}/lib64 -L${OFED_PATH}/lib
CFLAGS += $(DEFAULT_CFLAGS) -g -Wall
LDFLAGS += $(DEFAULT_LDFLAGS) -libverbs -lpthread
OBJECTS = main.o sock.o file_linkedlist_creat.o readfile.o writefile.o ibcpnet.o ibbuf.o
TARGETS = ibcp
all: $(TARGETS)
ibcp: main.o file_linkedlist_creat.o readfile.o writefile.o ibcpnet.o sock.o ibbuf.o
$(CC) $^ -o $@ $(LDFLAGS) -lm
ibbuf.o:ibbuf.c
$(CC) -c $(CFLAGS) $<
main.o:main.c config.h ibcpnet.o
$(CC) -c $(CFLAGS) -lm $<
ibcpnet.o:ibcpnet.c sock.o sock.c sock.h
$(CC) -c $(CFLAGS) $<
readfile.o:readfile.c
$(CC) -c $(CFLAGS) -lm $<
writefile.o:writefile.c
$(CC) -c $(CFLAGS) -lm $<
file_linkedlist_creat.o: file_linkedlist_creat.c
$(CC) -c $(CFLAGS) $<
sock.o: sock.c sock.h
$(CC) -c $(CFLAGS) $<
clean:
rm -f $(OBJECTS) $(TARGETS)