From 495bf28cadf4402cae175d0837e0fab801674c59 Mon Sep 17 00:00:00 2001 From: Lyanis Souidi Date: Wed, 23 Nov 2022 17:03:16 +0100 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20du=20fichier=20Makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..089448e --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +### VARIABLES ### + +CC = gcc +CFLAGS = -lgraph +SRCDIR = ./src +HDIR = ./include +ODIR = ./out +OFILES = $(subst src/,out/,$(subst .c,.o,$(shell find $(SRCDIR)/ -type f))) +EXE = game + +### BUT PAR DEFAUT ### + +but : $(EXE) + +### REGLES ESSENTIELLES ### + +$(ODIR)/%.o : $(SRCDIR)/%.c + @mkdir -p $(@D) + $(CC) -c $< -o $@ + +$(EXE) : $(OFILES) + $(CC) $(CFLAGS) -o $(EXE) $(OFILES) + +### REGLES OPTIONNELLES ### + +start : $(EXE) + ./$(EXE) + +clean : + -rm -rf $(ODIR) + +### BUTS FACTICES ### + +.PHONY : but start clean