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
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
SRC=$(wildcard src/*.c)
OBJ=$(SRC:.c=.o)
all:$(EXEC)
run: main.o render.o map.o
$(CC) -o $@ $^ $(LDFLAGS)
@echo "Lancer le programme avec ./run"
$(EXEC):$(OBJ)
$(CC) -o $@ $^ $(LDFLAG)
mv $^ bin/
map.o : src/map.c src/map.h
$(CC) -o $@ -c $< $(CFLAGS)
%.o:%.c
$(CC) -o $@ -c $< $(CFLAG)
render.o : src/render.c src/render.h
$(CC) -o $@ -c $< $(CFLAGS)
main.o : src/main.c
$(CC) -o $@ -c $< $(CFLAGS)
.PHONY:clean
clean:
rm -rf *.o
rmExec: clean
rm -rf bin/*.o
rm -rf $(EXEC)
\ No newline at end of file
File added
#ifndef projet
#ifndef map_h
#define map_h
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <SDL2/SDL.h>
#endif
/* ------------------------------- Déclaration des fonctions.---------------------------------------*/
......@@ -13,3 +14,4 @@ int nombrevoisin(int **grille,int i , int j,int w);
void liberer_grille(int **grille,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);
#endif
\ No newline at end of file
#ifndef projet
#ifndef render_h
#define render_h
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <SDL2/SDL.h>
#endif
void init_sdl(SDL_Window *window_1 ,SDL_Renderer *renderer,int dimension_grille);
void dessiner_grille(SDL_Renderer* renderer, int ** grille, int taille);
void fin_sdl(SDL_Renderer* renderer,SDL_Window *window_1);
\ No newline at end of file
void fin_sdl(SDL_Renderer* renderer,SDL_Window *window_1);
#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