-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (23 loc) · 926 Bytes
/
Makefile
File metadata and controls
33 lines (23 loc) · 926 Bytes
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
SRC := ./src
BUILD := ./build
INCLUDE := ./include
GTK_FLAGS := `pkg-config --cflags gtk4`
GTK_LIBS := `pkg-config --libs gtk4`
C_FLAGS := $(GTK_FLAGS) -I $(INCLUDE) -Wall -g
C_LIBS := $(GTK_LIBS) -lm -lpthread
C_FILES := $(wildcard $(SRC)/*.c)
HEADERS := $(wildcard $(INCLUDE)/*.h)
OBJS := $(patsubst $(SRC)/%.c, $(BUILD)/%.o, $(C_FILES))
all: $(OBJS) $(HEADERS) $(C_FILES) sortV
# Un fichier objet dépend de sa source mais également des headers.
# Ainsi si un header est modifié on recompile tous les objets pour être sûrs
# que les changements soient bien appliqués partout
$(BUILD)/%.o: $(SRC)/%.c $(HEADERS)
gcc $(C_FLAGS) -c $< -o $@ $(C_LIBS)
sortV: $(OBJS)
gcc $(C_FLAGS) -o sortV $(OBJS) $(C_LIBS)
vg: sortV
valgrind --suppressions=/usr/share/glib-2.0/valgrind/glib.supp --suppressions=/usr/share/gtk-4.0/valgrind/gtk.supp --leak-check=full --log-file=vgdump ./sortV
clean:
rm ./build/*
rm sortV