Skip to content
Snippets Groups Projects
Commit 5bb732bf authored by Léon GALL's avatar Léon GALL
Browse files

Makefile adapté au niveau 4

parent a32cc507
Branches
Tags 2.0.4
No related merge requests found
......@@ -6,9 +6,6 @@ SPATH = src/
HPATH = include/
BPATH = bin/
CPPFLAGS += -Iinclude -I/usr/include/cairo
LDFLAGS += -lcairo -lm -lX11
VERSION=4_0_1
ARCHIVE = $(SPATH) $(HPATH) makefile Doxyfile README.md
......@@ -21,31 +18,26 @@ vpath %.c $(SPATH)
vpath %.o $(OPATH)
SOURCES = $(wildcard $(SPATH)*.c)
OBJETS = $(patsubst %.c,$(OPATH)%.o,$(notdir $(SOURCES)))
OBJETS_ = $(patsubst %.c,$(OPATH)%.o,$(notdir $(SOURCES)))
##### COMPILATION JEU DE LA VIE TERMINAL
ifeq ($(MODE),TEXT)
$(EXEC) : $(OBJETS)
@mkdir -p $(BPATH)
$(CC) $(CFLAGS) -o $(BPATH)$(EXEC) $^
$(OPATH)%.o : %.c
@mkdir -p $(OPATH)
$(CC) $(CFLAGS) -o $@ -c $< $(IFLAGS)
OBJETS= $(filter-out %_cairo.o,$(OBJETS_))
##### COMPILATION JEU DE LA VIE GRAPHIQUE
else
IFLAGS += -I/usr/include/cairo
LDFLAGS += -lcairo -lm -lX11
OBJETS = $(filter-out %_terminal.o, $(OBJETS_))
endif
$(EXEC) : $(OBJETS)
@mkdir -p $(BPATH)
$(CC) $(CFLAGS) -o $(BPATH)$(EXEC) $^
$(CC) $(CFLAGS) -o $(BPATH)$(EXEC) $^ $(LDFLAGS)
$(OPATH)%.o : %.c
@mkdir -p $(OPATH)
$(CC) $(CFLAGS) -o $@ -c $< $(CPPFLAGS) $(LDFLAGS)
endif
$(CC) $(CFLAGS) -o $@ -c $< $(IFLAGS)
dist :
tar -Jcvf $(ARCHIVENAME).tar.xz $(ARCHIVE)
......
/**
* \file main_cairo.c
* Fichier principal, avec jeu graphique.
* \author Léon GALL
*/
#include <stdio.h>
#include "grille.h"
#include "io.h"
#include "jeu.h"
/**
* \fn int main (int argc, char ** argv);
* \param argc nombre d'éléments dans argv
* \param argv tableau de chaines de caractères
* \return Retourne l'état de sortie du programme
* \brief Cette fonction est appelée au lancement du programme. Nécessite un argument : le nom du fichier de grille.
*/
int main (int argc, char ** argv) {
if (argc != 2 )
{
printf("usage : main <fichier grille>\n");
return 1;
}
grille g, gc;
init_grille_from_file(argv[1],&g);
alloue_grille (g.nbl, g.nbc, &gc);
unset_vieillissement(); // Par défaut, le vieillissement est désactivé.
affiche_tout(g,0); // On affiche le temps (initial d'où 0) et la grille.
debut_jeu(&g, &gc);
libere_grille(&g);
libere_grille(&gc);
return 0;
}
/**
* \file main.c
* \file main_terminal.c
* Fichier principal.
* \author Léon GALL
*/
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment