-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (26 loc) · 777 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
38
39
40
41
42
43
44
45
46
47
CC = gcc
CFLAGS = -std=c99 -Wall -g -pedantic -I.
LDFLAGS = -L.
LIBS = -lprotocol -lm
TARGETS = objStore libprotocol.a client
OBJS = protocol.o message.o object.o user.o list.o stats.o worker.o
SOCKNAME = objstore.sock
LOG = testout.log
DIR = ./data
.PHONY: all test clean
all: $(TARGETS)
objStore: stats.o message.o list.o user.o object.o worker.o
$(CC) $(CFLAGS) [email protected] -o $@ $^ -lpthread -lm
client: libprotocol.a
$(CC) $(CFLAGS) [email protected] -o $@ $^ $(LDFLAGS) $(LIBS)
worker.o: stats.o message.o list.o user.o object.o
protocol.o: message.o
user.o: object.o
%.o: %.c %.h
libprotocol.a: protocol.o message.o common.h
$(AR) rvs $@ $^
test: objStore client
@./test_clients.sh
clean:
$(RM) $(TARGETS) $(OBJS) $(SOCKNAME) ${LOG} *~
$(RM) -r ${DIR}