From aad090d260ea7f14bd2c7210fd7f2e891fb6d70f Mon Sep 17 00:00:00 2001 From: orfao Date: Mon, 11 Dec 2023 15:36:53 +0100 Subject: [PATCH] =?UTF-8?q?makefile=20op=C3=A9rationnel=20(images=20ne=20m?= =?UTF-8?q?archent=20pas)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 34 +++++++++++++++++----------------- src/main.c | 1 + src/pomme.c | 4 ++-- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 2dc69dc..aa5cade 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,37 @@ Snake : main.o jeu.o grille.o menu.o obstacle.o pomme.o serpent.o timer.o - gcc -ansi -pedantic -lgraph -o Snake ../src/main.c ../src/jeu.c ../src/grille.c ../src/menu.c ../src/obstacle.c ../src/pomme.c ../src/serpent.c ../src/timer.c + gcc -lgraph -o Snake main.o jeu.o grille.o menu.o obstacle.o pomme.o serpent.o timer.o -main.o : ../src/main.c ../include/menu.h ../include/jeu.h +main.o : ./src/main.c ./include/main.h ./include/menu.h ./include/jeu.h - gcc -ansi -pedantic -lgraph ../src/main.c + gcc -ansi -pedantic -c ./src/main.c -jeu.o : ../src/jeu.c ../include/grille.h ../include/serpent.h ../include/pomme.h ../include/jeu.h ../include/menu.h ../include/timer.h ../include/obstacle.h +jeu.o : ./src/jeu.c ./include/grille.h ./include/serpent.h ./include/pomme.h ./include/jeu.h ./include/menu.h ./include/timer.h ./include/obstacle.h - gcc -ansi -pedantic -lgraph ../src/jeu.c + gcc -ansi -pedantic -c ./src/jeu.c -grille.o : ../src/grille.c ../include/grille.h +grille.o : ./src/grille.c ./include/grille.h - gcc -ansi -pedantic -lgraph ../src/grille.c + gcc -ansi -pedantic -c ./src/grille.c -menu.o : ../src/menu.c ../include/menu.h ../include/main.h +menu.o : ./src/menu.c ./include/menu.h ./include/main.h - gcc -ansi -pedantic -lgraph ../src/menu.c + gcc -ansi -pedantic -c ./src/menu.c -obstacle.o : ../src/obstacle.c ../include/grille.h ../include/serpent.h ../include/obstacle.h ../include/pomme.h +obstacle.o : ./src/obstacle.c ./include/grille.h ./include/serpent.h ./include/obstacle.h ./include/pomme.h - gcc -ansi -pedantic -lgraph ../src/obstacle.c + gcc -ansi -pedantic -c ./src/obstacle.c -pomme.o : ../src/pomme.c ../include/grille.h ../include/serpent.h +pomme.o : ./src/pomme.c ./include/grille.h ./include/serpent.h - gcc -ansi -pedantic -lgraph ../src/pomme.c + gcc -ansi -pedantic -c ./src/pomme.c -serpent.o : ../src/serpent.c ../include/serpent.h ../include/main.h ../include/timer.h +serpent.o : ./src/serpent.c ./include/serpent.h ./include/main.h ./include/timer.h - gcc -ansi -pedantic -lgraph ../src/serpent.c + gcc -ansi -pedantic -c ./src/serpent.c -timer.o : ../src/timer.c ../include/timer.h +timer.o : ./src/timer.c ./include/timer.h - gcc -ansi -pedantic -lgraph ../src/timer.c + gcc -ansi -pedantic -c ./src/timer.c clean : -rm -f main.o jeu.o grille.o menu.o obstacle.o pomme.o serpent.o timer.o diff --git a/src/main.c b/src/main.c index 808eb8e..82c9627 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,7 @@ #include #include #include +#include "../include/main.h" #include "../include/jeu.h" #include "../include/menu.h" diff --git a/src/pomme.c b/src/pomme.c index ce61496..f53e0d1 100644 --- a/src/pomme.c +++ b/src/pomme.c @@ -10,8 +10,8 @@ typedef struct { Pomme creerPomme() { Pomme pomme; - pomme.x = rand() % 60; - pomme.y = rand() % 40; + pomme.x = rand() % 59; + pomme.y = rand() % 39; return pomme; }