-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (43 loc) · 1.18 KB
/
Copy pathMakefile
File metadata and controls
61 lines (43 loc) · 1.18 KB
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
CC = gcc
CFLAGS = -Wall
OPTFLAGS = -O3 -g
AR = ar
ARFLAGS = rvs
INCLUDE = -I./include
LIBFLAG = -L./lib
LIBS = -lpthread -lUtils -lServer_op -lObjStr #-lList
MDIR = ./lib
OUT = ./testout.log
TARGET = server_objstr \
client_objstr
.PHONY : all clean dolib test
% : %.c
$(CC) $(CFLAGS) -o $@ $< $(LIBFLAG) $(LIBS)
%.o : %.c
$(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $<
server_objstr : server_objstr.c dolib
$(CC) $(CFLAGS) $(INCLUDE) $(LIBFLAG) $(LIBS) -o $@ $<
client_objstr : client_objstr.c dolib
$(CC) $(CFLAGS) $(INCLUDE) $(LIBFLAG) $(LIBS) -o $@ $<
all : $(TARGET)
dolib :
$(MAKE) all -C $(MDIR)
clean :
$(MAKE) clean -C $(MDIR)
rm -f server_objstr client_objstr $(OUT)
rm -rf ./data
test :
echo "Start test..." 1>$(OUT);
number=1 ; while [[ $$number -le 50 ]] ; do \
./client_objstr client_$$number 1 1>>$(OUT) ; \
((number = number + 1)) ; \
done
wait
number=1 ; while [[ $$number -le 30 ]] ; do \
./client_objstr client_$$number 2 1>>$(OUT) ; \
((number = number + 1)) ; \
done
number=31 ; while [[ $$number -le 50 ]] ; do \
./client_objstr client_$$number 3 1>>$(OUT) ; \
((number = number + 1)) ; \
done