-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
44 lines (33 loc) · 2.48 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
SRCDIR=src
LIBDIR=lib
BINDIR=bin
INCLUDEDIR=include
TESTDIR=tests
DOC=doc
CC = gcc
AR = ar
CFLAGS=-Wall -pedantic -g -std=c99 -I$(INCLUDEDIR)
LDFLAGS=-lm -lcurses
EXEC=Othello
TEST1=TestListeCoupsPossibles
TEST2=TestTADs
TEST3=TestFaireUnePartie
all : $(BINDIR)/$(EXEC)
$(BINDIR)/$(EXEC) : $(SRCDIR)/main.o $(SRCDIR)/FaireUnePartie.o $(SRCDIR)/ListesCoupsPossibles.o $(SRCDIR)/TAD_Couleur.o $(SRCDIR)/TAD_Coup.o $(SRCDIR)/TAD_Coups.o $(SRCDIR)/TAD_Pion.o $(SRCDIR)/TAD_Plateau.o $(SRCDIR)/TAD_Position.o $(SRCDIR)/Affichage.o $(SRCDIR)/ObtenirCoupHumain.o $(SRCDIR)/ObtenirCoupIA.o
doxygen ./config_file
$(CC) -o $@ $^ $(LDFLAGS)
$(SRCDIR)/%.o : $(SRCDIR)/%.c
$(CC) $(CFLAGS) -o $@ -c $<
tests: $(TESTDIR)/$(TEST1) $(TESTDIR)/$(TEST2) $(TESTDIR)/$(TEST3)
$(TESTDIR)/$(TEST1):$(SRCDIR)/TestListeCoupsPossibles.o $(SRCDIR)/ListesCoupsPossibles.o $(SRCDIR)/FaireUnePartie.o $(SRCDIR)/TAD_Couleur.o $(SRCDIR)/TAD_Coup.o $(SRCDIR)/TAD_Coups.o $(SRCDIR)/TAD_Pion.o $(SRCDIR)/TAD_Plateau.o $(SRCDIR)/TAD_Position.o
$(CC) -o $(TESTDIR)/TestListeCoupsPossibles $(SRCDIR)/TestListeCoupsPossibles.o $(SRCDIR)/ObtenirCoupIA.o $(SRCDIR)/ListesCoupsPossibles.o $(SRCDIR)/FaireUnePartie.o $(SRCDIR)/TAD_Couleur.o $(SRCDIR)/TAD_Coup.o $(SRCDIR)/TAD_Coups.o $(SRCDIR)/TAD_Pion.o $(SRCDIR)/TAD_Plateau.o $(SRCDIR)/TAD_Position.o $(LDFLAGS) -lcunit
$(TESTDIR)/$(TEST2):$(SRCDIR)/TestTADs.o $(SRCDIR)/ListesCoupsPossibles.o $(SRCDIR)/FaireUnePartie.o $(SRCDIR)/TAD_Couleur.o $(SRCDIR)/TAD_Coup.o $(SRCDIR)/TAD_Coups.o $(SRCDIR)/TAD_Pion.o $(SRCDIR)/TAD_Plateau.o $(SRCDIR)/TAD_Position.o
$(CC) -o $(TESTDIR)/TestTADs $(SRCDIR)/TestTADs.o $(SRCDIR)/ListesCoupsPossibles.o $(SRCDIR)/FaireUnePartie.o $(SRCDIR)/TAD_Couleur.o $(SRCDIR)/TAD_Coup.o $(SRCDIR)/TAD_Coups.o $(SRCDIR)/TAD_Pion.o $(SRCDIR)/TAD_Plateau.o $(SRCDIR)/TAD_Position.o $(LDFLAGS) -lcunit
$(TESTDIR)/$(TEST3):$(SRCDIR)/TestFaireUnePartie.o $(SRCDIR)/ListesCoupsPossibles.o $(SRCDIR)/FaireUnePartie.o $(SRCDIR)/TAD_Couleur.o $(SRCDIR)/TAD_Coup.o $(SRCDIR)/TAD_Coups.o $(SRCDIR)/TAD_Pion.o $(SRCDIR)/TAD_Plateau.o $(SRCDIR)/TAD_Position.o
$(CC) -o $(TESTDIR)/TestFaireUnePartie $(SRCDIR)/TestFaireUnePartie.o $(SRCDIR)/ListesCoupsPossibles.o $(SRCDIR)/FaireUnePartie.o $(SRCDIR)/TAD_Couleur.o $(SRCDIR)/TAD_Coup.o $(SRCDIR)/TAD_Coups.o $(SRCDIR)/TAD_Pion.o $(SRCDIR)/TAD_Plateau.o $(SRCDIR)/TAD_Position.o $(LDFLAGS) -lcunit
clean :
rm -rf $(BINDIR)/*
rm -rf $(LIBDIR)/*
rm -rf $(SRCDIR)/*.o
rm -rf $(TESTDIR)/*
rm -rf $(DOC)/*