2023-12-01 13:32:18 +01:00
|
|
|
|
|
|
|
|
2023-11-30 13:44:06 +01:00
|
|
|
CC = gcc
|
|
|
|
CFLAGS = -ansi -pedantic -lgraph -g
|
2023-12-01 13:32:18 +01:00
|
|
|
SRCDIR = ./src
|
|
|
|
HDIR = ./fichier.h
|
|
|
|
ODIR = ./out
|
|
|
|
OFILES = $(subst src/,out/,$(subst .c,.o,$(shell find $(SRCDIR)/ -type f)))
|
|
|
|
EXE = snake
|
|
|
|
|
|
|
|
but : $(EXE)
|
2023-11-30 13:44:06 +01:00
|
|
|
|
2023-12-01 13:32:18 +01:00
|
|
|
$(ODIR)/%.o : $(SRCDIR)/%.c
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
$(CC) -c $< -o $@
|
2023-11-30 13:44:06 +01:00
|
|
|
|
2023-12-01 13:32:18 +01:00
|
|
|
$(EXE) : $(OFILES)
|
|
|
|
$(CC) $(CFLAGS) -o $(EXE) $(OFILES)
|
2023-11-30 13:44:06 +01:00
|
|
|
|
2023-12-01 13:32:18 +01:00
|
|
|
run : $(EXE)
|
|
|
|
./$(EXE)
|
|
|
|
|
|
|
|
clean : -rm -f $(OFILES) snake
|
2023-11-30 13:44:06 +01:00
|
|
|
|
|
|
|
.PHONY : but clean
|