This repository has been archived by the owner on May 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (55 loc) · 1.72 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
INCLUDE_DIR=include
SRC_DIR=src
BIN_DIR=bin
BUILD_DIR=build
CC=gcc
CC_FLAGS=-Wall
LD_FLAGS=
TEST_PORT=9900
default: all
all: erase tsock test
tsock: main.o
@mkdir -p $(BIN_DIR) ||:
@$(CC) -o $(BIN_DIR)/tsock $(BUILD_DIR)/*.o $(LD_FLAGS) ||:
@chmod +x $(BIN_DIR)/tsock
@echo " tsock compilé avec succès."
main.o: puits.o source.o
puits.o: affichage.o reseau.o
source.o: affichage.o reseau.o
affichage.o: config.o
reseau.o: config.o
config.o: erreurs.o
pre:
@mkdir -p $(BUILD_DIR) ||:
%.o: $(SRC_DIR)/%.c pre
@echo " + Compilation de $<..."
@$(CC) -o $(BUILD_DIR)/$@ -c $< $(CC_FLAGS) ||:
test: test.tcp test.udp test.async
test.tcp: tsock
@echo Test de tsock avec le protocole TCP...
$(BIN_DIR)/tsock -p -n 10 -l 45 $(TEST_PORT) &
$(BIN_DIR)/tsock -l 45 -s $(TEST_PORT)
test.udp: tsock
@echo Test de tsock avec le protocole UDP...
$(BIN_DIR)/tsock -up -n 10 -l 45 $(TEST_PORT) &
$(BIN_DIR)/tsock -us $(TEST_PORT)
test.async: test.async.tcp test.async.udp
test.async.tcp: tsock
@echo Test de la gestion asynchrone des requêtes TCP...
$(BIN_DIR)/tsock -a -l 100 -p $(TEST_PORT) &
# $(BIN_DIR)/tsock -l 100 -n 100 -s $(TEST_PORT) &
# $(BIN_DIR)/tsock -l 100 -n 100 -s $(TEST_PORT) &
# $(BIN_DIR)/tsock -l 100 -n 100 -s $(TEST_PORT) &
$(BIN_DIR)/tsock -l 100 -n 100 -s $(TEST_PORT)
test.async.udp: tsock
@echo Test de la gestion asynchrone des requêtes UDP...
$(BIN_DIR)/tsock -a -l 100 -u -p $(TEST_PORT) &
# $(BIN_DIR)/tsock -l 100 -u -n 100 -s $(TEST_PORT) &
# $(BIN_DIR)/tsock -l 100 -u -n 100 -s $(TEST_PORT) &
# $(BIN_DIR)/tsock -l 100 -u -n 100 -s $(TEST_PORT) &
$(BIN_DIR)/tsock -l 100 -u -n 100 -s $(TEST_PORT)
clean:
@rm -rf $(BUILD_DIR) ||:
erase: clean
@rm -rf $(BIN_DIR) ||:
@echo " - Répertoire nettoyé."