-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (27 loc) · 1000 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
CC=gcc
CFLAGS=-g -Wall -Wextra -std=c99
EXEC=main
BIN=bin/
HDR=headers/
SRC=src/
all: $(EXEC)
main : main.o plateau.o interface.o structures.o carte.o deck.o
$(CC) $(BIN)interface.o $(BIN)structures.o $(BIN)plateau.o $(BIN)deck.o $(BIN)main.o -o $(BIN)main $(CFLAGS)
main.o : $(SRC)main.c $(HDR)plateau.h $(HDR)interface.h $(HDR)carte.h $(HDR)deck.h
$(CC) -o $(BIN)main.o -c $(SRC)main.c $(CFLAGS)
carte.o : $(SRC)carte.c $(HDR)structures.h $(HDR)carte.h
$(CC) -o $(BIN)carte.o -c $(SRC)carte.c $(CFLAGS)
plateau.o: $(SRC)plateau.c $(HDR)plateau.h $(HDR)carte.h
$(CC) -o $(BIN)plateau.o -c $(SRC)plateau.c $(CFLAGS)
interface.o : $(SRC)interface.c plateau.o structures.o
$(CC) -o $(BIN)interface.o -c $(SRC)interface.c $(CFLAGS)
structures.o : $(SRC)structures.c
$(CC) -o $(BIN)structures.o -c $(SRC)structures.c $(CFLAGS)
deck.o : $(SRC)deck.c
$(CC) -o $(BIN)deck.o -c $(SRC)deck.c $(CFLAGS)
clean:
rm -rf $(BIN)*.o
mrproper: clean
rm -rf $(BIN)$(EXEC)
run:
$(BIN)$(EXEC)