-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
31 lines (22 loc) · 1001 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
CC = gcc
CFLAGS = -Wall -std=c89
LDFLAGS = -L./lib
all: client server other
client: client.c lib/tcp.o lib/utility.o lib/game.o
$(CC) $(CFLAGS) $(LDFLAGS) -o client client.c lib/tcp.o lib/utility.o lib/game.o
server: server.c lib/tcp.o lib/utility.o lib/game.o
$(CC) $(CFLAGS) $(LDFLAGS) -o server server.c lib/tcp.o lib/utility.o lib/game.o
other: other.c lib/tcp.o lib/utility.o lib/game.o
$(CC) $(CFLAGS) $(LDFLAGS) -o other other.c lib/tcp.o lib/utility.o lib/game.o
lib/tcp.o: lib/tcp.c lib/tcp.h
$(CC) $(CFLAGS) -c -o lib/tcp.o lib/tcp.c
lib/utility.o: lib/utility.c lib/utility.h
$(CC) $(CFLAGS) -c -o lib/utility.o lib/utility.c
lib/game.o: lib/game.c lib/game.h
$(CC) $(CFLAGS) -c -o lib/game.o lib/game.c
# dichiaro che il target "clean" non rappresenta un file fisico, se esistesse un file chiamato clean e non usassi l'annotazione .PHONY
# il comando make potrebbe non funzionare correttamente
# .PHONY: clean
# pulisco rimuovendo
clean:
rm -f client server other lib/*.o