Skip to content
Snippets Groups Projects
Commit a40cb5be authored by maberet's avatar maberet
Browse files

Modification Makefile et ajout /bin

parent fd3e7f43
No related branches found
No related tags found
No related merge requests found
CC=gcc CC=gcc
CFLAGS=-Wextra -Wall -lm -lSDL2
LDFLAGS= LDFLAG=$(shell sdl2-config --cflags --libs) -Wall -Wextra -lm -lSDL2_ttf -D_REENTRANT -lSDL2_image -pthread
CFLAG=-Wall $(shell sdl2-config --cflags --libs)
EXEC=run EXEC=run
SRC=$(wildcard src/*.c)
OBJ=$(SRC:.c=.o)
all:$(EXEC) all:$(EXEC)
run: main.o render.o map.o $(EXEC):$(OBJ)
$(CC) -o $@ $^ $(LDFLAGS) $(CC) -o $@ $^ $(LDFLAG)
@echo "Lancer le programme avec ./run" mv $^ bin/
map.o : src/map.c src/map.h %.o:%.c
$(CC) -o $@ -c $< $(CFLAGS) $(CC) -o $@ -c $< $(CFLAG)
render.o : src/render.c src/render.h .PHONY:clean
$(CC) -o $@ -c $< $(CFLAGS)
main.o : src/main.c
$(CC) -o $@ -c $< $(CFLAGS)
clean: clean:
rm -rf *.o rm -rf bin/*.o
rmExec: clean
rm -rf $(EXEC) rm -rf $(EXEC)
\ No newline at end of file
File added
#ifndef projet #ifndef map_h
#define map_h
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#endif
/* ------------------------------- Déclaration des fonctions.---------------------------------------*/ /* ------------------------------- Déclaration des fonctions.---------------------------------------*/
...@@ -13,3 +14,4 @@ int nombrevoisin(int **grille,int i , int j,int w); ...@@ -13,3 +14,4 @@ int nombrevoisin(int **grille,int i , int j,int w);
void liberer_grille(int **grille,int taille); void liberer_grille(int **grille,int taille);
void iteration_suivante(int **grille,int **nouvelle_grille, int *regles_mort, int *regles_naissances, int taille); void iteration_suivante(int **grille,int **nouvelle_grille, int *regles_mort, int *regles_naissances, int taille);
void changer_case(int **grille,int i,int j,int taille); void changer_case(int **grille,int i,int j,int taille);
#endif
\ No newline at end of file
#ifndef projet #ifndef render_h
#define render_h
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#endif
void init_sdl(SDL_Window *window_1 ,SDL_Renderer *renderer,int dimension_grille); void init_sdl(SDL_Window *window_1 ,SDL_Renderer *renderer,int dimension_grille);
void dessiner_grille(SDL_Renderer* renderer, int ** grille, int taille); void dessiner_grille(SDL_Renderer* renderer, int ** grille, int taille);
void fin_sdl(SDL_Renderer* renderer,SDL_Window *window_1); void fin_sdl(SDL_Renderer* renderer,SDL_Window *window_1);
\ No newline at end of file #endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment