-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
36 lines (28 loc) · 889 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
# The executable to generate :
EXEC=boardgame
# .o files to generate if necessary
DEP=
all: $(EXEC)
#Variables personnalisées
CC=gcc
CFLAGS=-Wall
LDFLAGS=
%.o: %.c boardgame.h
$(CC) -o $@ -c $< $(CFLAGS)
$(EXEC): $(EXEC).c $(DEP) boardgame.h
$(CC) $(CFLAGS) -o $@ $(DEP) $<
###################### REMINDER ###############################
#
# $@ Name of the target
# $< Name of the first dependance for the target
# $ˆ List of dependencies for the target
# $? List of dependencies newer than the target File name (without its suffix)
# $* File name (without its suffix)
# % Allows to take one element after another in a list of targets
###############################################################
#delete the *.o files
clean:
rm -rf *.o $(EXEC)
#delete *.o files and executables
mrproper: clean
rm -rf $(EXEC)