2023-12-11 20:41:12 +01:00
|
|
|
### VARIABLES ###
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
CC = gcc
|
|
|
|
CFLAGS = -lgraph -ansi
|
|
|
|
SRCDIR = ./src
|
|
|
|
HDIR = ./include
|
|
|
|
ODIR = ./out
|
|
|
|
OFILES = $(subst src/,out/,$(subst .c,.o,$(shell find $(SRCDIR)/ -type f)))
|
|
|
|
EXE = game
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
### BUT PAR DEFAUT ###
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
but : $(EXE)
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
### REGLES ESSENTIELLES ###
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
$(ODIR)/%.o : $(SRCDIR)/%.c
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
$(CC) -c $< -o $@
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
$(EXE) : $(OFILES)
|
|
|
|
$(CC) $(CFLAGS) -o $(EXE) $(OFILES)
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
### REGLES OPTIONNELLES ###
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
run : $(EXE)
|
|
|
|
./$(EXE)
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
clean :
|
|
|
|
-rm -rf $(ODIR)
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
mrproper :
|
|
|
|
clean $(but)
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
### BUTS FACTICES ###
|
2023-12-10 21:50:49 +01:00
|
|
|
|
2023-12-11 20:41:12 +01:00
|
|
|
.PHONY : but run clean mrproper
|