-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (32 loc) · 1.09 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
# Compilateur utilisé
CC= gcc
# Source C qui va fournir l'exécutable (ou les exécutables)
# MAINSRCS= main.c
MAINSRCS= $(wildcard main*.c)
# Ci-dessous, tous les fichiers *.c à l'exception du ou des précédents, sont
# des librairies avec entêtes *.h
LIBSRCS= $(filter-out $(MAINSRCS), $(wildcard src/*/*.c))
CPPFLAGS= -DDEBUG
CFLAGS= -Wall `pkg-config --cflags gtk+-3.0` # options propres au compilateur C
LDFLAGS=
LDLIBS= -lm `pkg-config --libs gtk+-3.0` # librairies à intégrer à l'édition de liens
EXECS = $(patsubst %.c,%,$(MAINSRCS))
MAINOBJS=$(patsubst %.c,%.o,$(MAINSRCS))
LIBHS=$(LIBSRCS:.c=.h)
LIBOBJS=$(LIBSRCS:.c=.o)
# Règles
.PHONY: clean
all: $(EXECS)
$(MAINOBJS) : %.o :%.c $(LIBHS) $(COMMONHS) $(MAINHS)
$(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) $<
$(LIBOBJS) : %.o :%.c %.h $(COMMONHS)
$(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) $<
$(EXECS) : % : %.o $(LIBOBJS)
$(CC) $(LDFLAGS) $^ -o abalone $(LDLIBS)
rm -f *.o */*/*.o
clean:
rm -f abalone *.o */*/*.o
tests:
@make; ./abalone -tests
docs:
doxygen doxygen_config_file