-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (32 loc) · 1.07 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
CC = gcc
CFLAGS = -std=c99 -g -pedantic -Wall -Wmissing-field-initializers -D_POSIX_C_SOURCE=200809L
.PHONY: clean test
all: server utils libobjectstore client
server: src/server.c src/worker.c src/handler.c src/utils.c src/signal_thread.c
@echo "Compilo Server"
$(CC) $(CFLAGS) $^ -o [email protected] -lpthread
utils: src/utils.c
$(CC) $(CFLAGS) $^ -c -o [email protected]
libobjectstore: src/libobjectstore.c
@echo "Compilo Libreria"
$(CC) $(CFLAGS) $^ -c -o [email protected]
ar rvs [email protected] [email protected] utils.o
client: src/client.c
@echo "Compilo Client"
$(CC) $(CFLAGS) $^ -o [email protected] -L . -lobjectstore
testclient: src/utils.c src/tclient.c
@echo "Compilo Client di prova"
$(CC) $(CFLAGS) $^ -o [email protected] -L . -lobjectstore
clean:
@echo "Pulizia"
-rm -f *.a
-rm -f *.o
-rm -f *.log
-rm -f *.sock
-rm -rf data
test:
@echo 'Inizio fase di test'
seq 1 50 | xargs -n 1 -P50 -I{} ./client.o client{} 1 1>>testout.log;
(seq 1 30 | xargs -n 1 -P30 -I{} ./client.o client{} 2 1>>testout.log) &
(seq 31 50 | xargs -n 1 -P20 -I{} ./client.o client{} 3 1>>testout.log) &